I compiled LAPACK 3.3.1 (on linux with gcc) and installed it in /home/martin/local/lapack. I would like to link a little test code against this library, but my cmake file always finds the lapack library which is installed in /usr/lib. The contents of my CMakeLists.txt is this:
- Code: Select all
cmake_minimum_required(VERSION 2.8)
project(LapackTest)
set(CMAKE_PREFIX_PATH "/home/martin/local/lapack/lib/cmake")
find_package(LAPACK REQUIRED)
if(LAPACK_FOUND)
message("Found Lapack")
add_executable(test lapack_test1.cpp)
target_link_libraries(test ${LAPACK_LIBRARIES})
message("Lapack link library is ${LAPACK_LIBRARIES}")
endif()
When I run cmake, the output is always the same:
Lapack link library is /usr/lib/liblapack.so;/usr/lib/libblas.so
Could you please tell me what am I doing wrong? In case you don't use find_package(LAPACK), could you tell me what's the proper way to detect LAPACK compiled with cmake?
Thank you very much.
Best regards,
Martin Vymazal

