Hello,<br><br>I would like to know if there are any general rules on the correct order for linking libraries when compiling CP2K.<br><br>For instance, I have this:<br><br>LIBS     = -L/home/mirix/hwloc/lib/libhwloc.a -lxml2 -lpci\<br>/home/mirix/Software/cp2k/cp2k-2.3/tools/build_libsmm/lib/libsmm_znn.a\<br>/home/mirix/Software/cp2k/scalapack-2.0.2/libscalapack.a\<br>$(ATLASPATH)/liblapack.a\<br>$(ATLASPATH)/libcblas.a\<br>$(ATLASPATH)/libf77blas.a\<br>$(ATLASPATH)/libptcblas.a\<br>$(ATLASPATH)/libptf77blas.a\<br>$(ATLASPATH)/libatlas.a\<br>$(LIBINTPATH)/libderiv.a\<br>$(LIBINTPATH)/libr12.a\<br>$(LIBINTPATH)/libint.a\<br>/usr/local/lib/libfftw3f.a\<br>/usr/local/cuda/lib64/libcudart.so.5.0\<br>/usr/local/cuda/lib64/libcufft.so.5.0\<br>/usr/local/cuda/lib64/libcublas.so.5.0\<br>/home/mirix/hwloc/lib/libhwloc.a -lxml2 -lpci\<br>-lstdc++ -lpthread -lrt<br><br><br>This gives: cuda_cublas.f90:(.text+0x91): undefined reference to `cpu_d_gemm_'<br><br>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.<br><br>Any ideas?<br><br>Best regards,<br><br>Miro<br>