summaryrefslogtreecommitdiffstats
path: root/Modules/FindLAPACK.cmake
diff options
context:
space:
mode:
authorLeszek Swirski <leszek@swirski.co.uk>2013-10-08 14:47:42 (GMT)
committerLeszek Swirski <leszek@swirski.co.uk>2013-10-08 15:07:43 (GMT)
commit192a9182f8bbc533ed3f45372b7daaf5026054ed (patch)
treed38e0b1e52cd13986d831183c83c8bc6adc05144 /Modules/FindLAPACK.cmake
parent46c7bcaf967f4bca31df08c247c4fcc6624c57b5 (diff)
downloadCMake-192a9182f8bbc533ed3f45372b7daaf5026054ed.zip
CMake-192a9182f8bbc533ed3f45372b7daaf5026054ed.tar.gz
CMake-192a9182f8bbc533ed3f45372b7daaf5026054ed.tar.bz2
FindLAPACK: MKL clean up and fix for windows
Diffstat (limited to 'Modules/FindLAPACK.cmake')
-rw-r--r--Modules/FindLAPACK.cmake94
1 files changed, 49 insertions, 45 deletions
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 3167850..fecadeb 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -229,57 +229,61 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
else()
find_package(Threads REQUIRED)
endif()
+
+ set(LAPACK_SEARCH_LIBS "")
+
if (BLA_F95)
- if(NOT LAPACK95_LIBRARIES)
- # old
- check_lapack_libraries(
- LAPACK95_LIBRARIES
- LAPACK
- cheev
- ""
- "mkl_lapack95"
- "${BLAS95_LIBRARIES}"
- "${CMAKE_THREAD_LIBS_INIT};${LM}"
- )
- endif()
- if(NOT LAPACK95_LIBRARIES)
- # new >= 10.3
- check_lapack_libraries(
- LAPACK95_LIBRARIES
- LAPACK
- CHEEV
- ""
- "mkl_intel_lp64"
- "${BLAS95_LIBRARIES}"
- "${CMAKE_THREAD_LIBS_INIT};${LM}"
- )
- endif()
+ set(LAPACK_mkl_SEARCH_SYMBOL "CHEEV")
+ set(_LIBRARIES LAPACK95_LIBRARIES)
+ set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES})
+
+ # old
+ list(APPEND LAPACK_SEARCH_LIBS
+ "mkl_lapack95")
+ # new >= 10.3
+ list(APPEND LAPACK_SEARCH_LIBS
+ "mkl_intel_c")
+ list(APPEND LAPACK_SEARCH_LIBS
+ "mkl_intel_lp64")
else()
- if(NOT LAPACK_LIBRARIES)
- # old
- check_lapack_libraries(
- LAPACK_LIBRARIES
- LAPACK
- cheev
- ""
- "mkl_lapack"
- "${BLAS_LIBRARIES}"
- "${CMAKE_THREAD_LIBS_INIT};${LM}"
- )
- endif()
- if(NOT LAPACK_LIBRARIES)
- # new >= 10.3
+ set(LAPACK_mkl_SEARCH_SYMBOL "cheev")
+ set(_LIBRARIES LAPACK_LIBRARIES)
+ set(_BLAS_LIBRARIES ${BLAS_LIBRARIES})
+
+ # old
+ list(APPEND LAPACK_SEARCH_LIBS
+ "mkl_lapack")
+ # new >= 10.3
+ list(APPEND LAPACK_SEARCH_LIBS
+ "mkl_gf_lp64")
+ endif()
+
+ # First try empty lapack libs
+ if (NOT ${_LIBRARIES})
+ check_lapack_libraries(
+ ${_LIBRARIES}
+ BLAS
+ ${LAPACK_mkl_SEARCH_SYMBOL}
+ ""
+ ""
+ "${_BLAS_LIBRARIES}"
+ "${CMAKE_THREAD_LIBS_INIT};${LM}"
+ )
+ endif ()
+ # Then try the search libs
+ foreach (IT ${LAPACK_SEARCH_LIBS})
+ if (NOT ${_LIBRARIES})
check_lapack_libraries(
- LAPACK_LIBRARIES
- LAPACK
- cheev
+ ${_LIBRARIES}
+ BLAS
+ ${LAPACK_mkl_SEARCH_SYMBOL}
""
- "mkl_gf_lp64"
- "${BLAS_LIBRARIES}"
+ "${IT}"
+ "${_BLAS_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
- endif()
- endif()
+ endif ()
+ endforeach ()
endif ()
endif()
else()