Linking libraries in the right order

mirix miro... at gmail.com
Sat Mar 9 13:30:33 UTC 2013


Hello,

I would like to know if there are any general rules on the correct order 
for linking libraries when compiling CP2K.

For instance, I have this:

LIBS     = -L/home/mirix/hwloc/lib/libhwloc.a -lxml2 -lpci\
/home/mirix/Software/cp2k/cp2k-2.3/tools/build_libsmm/lib/libsmm_znn.a\
/home/mirix/Software/cp2k/scalapack-2.0.2/libscalapack.a\
$(ATLASPATH)/liblapack.a\
$(ATLASPATH)/libcblas.a\
$(ATLASPATH)/libf77blas.a\
$(ATLASPATH)/libptcblas.a\
$(ATLASPATH)/libptf77blas.a\
$(ATLASPATH)/libatlas.a\
$(LIBINTPATH)/libderiv.a\
$(LIBINTPATH)/libr12.a\
$(LIBINTPATH)/libint.a\
/usr/local/lib/libfftw3f.a\
/usr/local/cuda/lib64/libcudart.so.5.0\
/usr/local/cuda/lib64/libcufft.so.5.0\
/usr/local/cuda/lib64/libcublas.so.5.0\
/home/mirix/hwloc/lib/libhwloc.a -lxml2 -lpci\
-lstdc++ -lpthread -lrt


This gives: cuda_cublas.f90:(.text+0x91): undefined reference to 
`cpu_d_gemm_'

Depending on the order of the libraries I receive different "undefined 
reference" errors. I am trying different options, but I still have not 
found a working combination.

Any ideas?

Best regards,

Miro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20130309/d19bf9b9/attachment.htm>


More information about the CP2K-user mailing list