[原创] 解决编译ELL的错误:undefined reference to `cblas_xxx'

OS:Ubuntu 14.04 LTS
在PC上编译ELL的时候,尽管你可能已经安装了所有ELL文档中要求的软件依赖,可能还是会遇到 undefined reference to `cblas_xxx' 的错误,如下:

0%] Built target documentation
[ 10%] Built target utilities
[ 11%] Built target math
[ 14%] Built target data
[ 23%] Built target emitters
[ 24%] Built target evaluators
[ 28%] Built target functions
[ 37%] Built target model
[ 39%] Built target predictors
[ 48%] Built target nodes
[ 52%] Built target trainers
[ 59%] Built target common
[ 60%] Built target testing
[ 61%] Linking CXX executable common_test
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Copy(int, float const*, int, float*, int)': BlasWrapper.cpp:(.text+0x31): undefined reference tocblas_scopy'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Copy(int, double const*, int, double*, int)': BlasWrapper.cpp:(.text+0x69): undefined reference tocblas_dcopy'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Asum(int, float const*, int)': BlasWrapper.cpp:(.text+0x92): undefined reference tocblas_sasum'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Asum(int, double const*, int)': BlasWrapper.cpp:(.text+0xba): undefined reference tocblas_dasum'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Nrm2(int, float const*, int)': BlasWrapper.cpp:(.text+0xf0): undefined reference tocblas_snrm2'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Nrm2(int, double const*, int)': BlasWrapper.cpp:(.text+0x118): undefined reference tocblas_dnrm2'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Scal(int, float, float*, int)': BlasWrapper.cpp:(.text+0x15b): undefined reference tocblas_sscal'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Scal(int, double, double*, int)': BlasWrapper.cpp:(.text+0x193): undefined reference tocblas_dscal'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Axpy(int, float, float const*, int, float*, int)': BlasWrapper.cpp:(.text+0x1d9): undefined reference tocblas_saxpy'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Axpy(int, double, double const*, int, double*, int)': BlasWrapper.cpp:(.text+0x221): undefined reference tocblas_daxpy'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Dot(int, float const*, int, float const*, int)': BlasWrapper.cpp:(.text+0x259): undefined reference tocblas_sdot'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Dot(int, double const*, int, double const*, int)': BlasWrapper.cpp:(.text+0x290): undefined reference tocblas_ddot'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Gemv(CBLAS_ORDER, CBLAS_TRANSPOSE, int, int, float, float const*, int, float const*, int, float, float*, int)': BlasWrapper.cpp:(.text+0x309): undefined reference tocblas_sgemv'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Gemv(CBLAS_ORDER, CBLAS_TRANSPOSE, int, int, double, double const*, int, double const*, int, double, double*, int)': BlasWrapper.cpp:(.text+0x37c): undefined reference tocblas_dgemv'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Gemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, float, float const*, int, float const*, int, float, float*, int)': BlasWrapper.cpp:(.text+0x3f5): undefined reference tocblas_sgemm'
../math/libmath.a(BlasWrapper.cpp.o): In function ell::math::Blas::Gemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, int, int, int, double, double const*, int, double const*, int, double, double*, int)': BlasWrapper.cpp:(.text+0x471): undefined reference tocblas_dgemm'
collect2: error: ld returned 1 exit status
make[2]: *** [libraries/common/common_test] Error 1
make[1]: *** [libraries/common/CMakeFiles/common_test.dir/all] Error 2
make: *** [all] Error 2