[CMake] Linking error after having found a package

Cedric Doucet cedric.doucet at inria.fr
Wed Jul 22 08:24:14 EDT 2015


Hello, 

I try to use the find_package function to find BLAS and LAPACK libraries which are required in my code. 

To do that, I do the following: 

====================== 
FIND_PACKAGE(BLAS) 
FIND_PACKAGE(LAPACK) 

# I should test with BLAS_FOUND and LAPACK_FOUND here but that's not the problem 
LIST(GET BLAS_LIBRARIES 0 BLAS_LIB) 
LIST(GET LAPACK_LIBRARIES 0 LAPACK_LIB) 

TARGET_LINK_LIBRARY(myexe ${LAPACK_LIB}$ ${BLAS_LIB}$) 
======================= 

I have manually checked that BLAS and LAPACK are actually found. 
As explained in FindBLAS.cmake and Find.LAPACK.cmake, BLAS_LIBRARIES and LAPACK_LIBRARIES are lists containing paths to these libraries. 
I get the first entry in each of these lists and try to link with these entries (/usr/lib/libf77blas.so, /usr/lib/liblapack.so). 
But I obtain the following error message: 

================================================== 


g++: error: /usr/lib/liblapack.so$: No such file or directory 
g++: error: /usr/lib/libf77blas.so$: No such file or directory 

================================================== 




But these files exist in my computer. 




Do you know where the problem come from? 




Cheers, 




Cédric 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150722/49097869/attachment.html>


More information about the CMake mailing list