Compiling PLUMED with mkl libraries of lapack and blas failed

Compiling PLUMED with mkl libraries of lapack and blas failed

I am trying to compile a big program called PLUMED which needs libraries of lapack and blas. I am using icc compilers  in a  Red Hat Enterprise Linux Server release 5.7, and I assigned the libraires of lapack and blas to the mkl libraires of libmkl_lapack95_ilp64.a and libmkl_blas95_ilp64.a. During the compilation I have the following problem:


icpc -rdynamic ../main/main.o ../wrapper/Plumed.o -o plumed-runtime -ldl
Building, runtime-linking version
Building, shared version
Building Plumed.cmake, runtime-linking version
Building Plumed.cmake, shared version
Building Plumed.cmake, static version
../bias/MetaD.o: In function `int PLMD::Invert<double>(PLMD::Matrix<double> const&, PLMD::Matrix<double>&)':
MetaD.cpp:(.gnu.linkonce.t._ZN4PLMD6InvertIdEEiRKNS_6MatrixIT_EERNS1_IdEE[.gnu.linkonce.t._ZN4PLMD6InvertIdEEiRKNS_6MatrixIT_EERNS1_IdEE]+0x11a): undefined reference to `dgetrf_'
MetaD.cpp:(.gnu.linkonce.t._ZN4PLMD6InvertIdEEiRKNS_6MatrixIT_EERNS1_IdEE[.gnu.linkonce.t._ZN4PLMD6InvertIdEEiRKNS_6MatrixIT_EERNS1_IdEE]+0x187): undefined reference to `dgetri_'
MetaD.cpp:(.gnu.linkonce.t._ZN4PLMD6InvertIdEEiRKNS_6MatrixIT_EERNS1_IdEE[.gnu.linkonce.t._ZN4PLMD6InvertIdEEiRKNS_6MatrixIT_EERNS1_IdEE]+0x1de): undefined reference to `dgetri_'
../bias/MetaD.o: In function `int PLMD::diagMat<double>(PLMD::Matrix<double> const&, std::vector<double, std::allocator<double> >&, PLMD::Matrix<double>&)':
MetaD.cpp:(.gnu.linkonce.t._ZN4PLMD7diagMatIdEEiRKNS_6MatrixIT_EERSt6vectorIdSaIdEERNS1_IdEE[.gnu.linkonce.t._ZN4PLMD7diagMatIdEEiRKNS_6MatrixIT_EERSt6vectorIdSaIdEERNS1_IdEE]+0x24e): undefined reference to `dsyevr_'
MetaD.cpp:(.gnu.linkonce.t._ZN4PLMD7diagMatIdEEiRKNS_6MatrixIT_EERSt6vectorIdSaIdEERNS1_IdEE[.gnu.linkonce.t._ZN4PLMD7diagMatIdEEiRKNS_6MatrixIT_EERSt6vectorIdSaIdEERNS1_IdEE]+0x385): undefined reference to `dsyevr_'
../tools/KernelFunctions.o: In function `PLMD::KernelFunctions::KernelFunctions(std::vector<double, std::allocator<double> > const&, std::vector<double, std::allocator<double> > const&, std::string const&, bool, double const&, bool)':
KernelFunctions.cpp:(.text+0xd13): undefined reference to `dsyevr_'
KernelFunctions.cpp:(.text+0xe41): undefined reference to `dsyevr_'
make[4]: *** [plumed] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/home/bshen/plumed-2.0.1/src/lib'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/bshen/plumed-2.0.1/src/lib'
make[2]: *** [lib] Error 2
make[2]: Leaving directory `/home/bshen/plumed-2.0.1/src'
make[1]: *** [lib] Error 2
make[1]: Leaving directory `/home/bshen/plumed-2.0.1'
make: *** [all] Error 2


It is looks like there is something wrong with the blas and lapack libraries. Or I'm using the wrong compiler ? I'm new to compilation problems and I have no idea how to fix it. Can you help me?
Thanks in advance,

Bo Shen

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Please try to find the correct list of mkl's libs you need to link with your application by following with this article:

Best Reply

The Blas95 and Lapack95 libraries provide wrappers for Blas and Lapack  routines with more convenient Fortran-95 interfaces. The actual computational routines are provided in other libraries. In particular, the routine "dsyevr" is in the F77 callable Lapack libraries. Unless the installation guide for your software package (PLUMED) specifies them, there is no need to include the xxx95yyy libraries at all.

Try the simple solution of using the compiler flag -mkl. If that does not work, use the MKL Link Line Advisor as Gennady F. recommended.

Thanks for mecej4, your way of using the compiler flag -mkl works, this is the most simple solution for me!

Leave a Comment

Please sign in to add a comment. Not a member? Join today