I am using armadillo as a wrapper framework for linear algebra routines which further uses linear algebra static libraries like lapack and blas.
I have manually compiled blas and lapack libraries and so as per readme.txt of armadillo, i am supposed to link to these two libraries at compile time. This is the gcc commandline i use -
g++ example2.cpp -I../include/armadillo -L../lib/BLAS -lblas_LINUX -L../lib/lapack - llapack_LINUX -lgfortran
This induces these errors -
../lib/lapack/liblapack_LINUX.a(dgetrf.o): In function `dgetrf_':
dgetrf.f:(.text+0x3da): undefined reference to `dtrsm_ '
../lib/lapack/liblapack_LINUX.a(dgetri.o): In function `dgetri_':
dgetri.f:(.text+0x286): undefined reference to `dswap_'
dgetri.f:(.text+0x609): undefined reference to `dtrsm_'
and more of these kind of errors.
Can anyone give me a suggestion to overcome this?
You should first give the LAPACK library then the BLAS library:
g++ example2.cpp -I../include/armadillo -L../lib/lapack -llapack_LINUX -L../lib/BLAS -lblas_LINUX -lgfortran
LAPACK references routines in the BLAS library, and not the other way around; in this situation the LAPACK library must come first.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With