FindLAPACK.cmake 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #[=======================================================================[.rst:
  4. FindLAPACK
  5. ----------
  6. Find Linear Algebra PACKage (LAPACK) library
  7. This module finds an installed Fortran library that implements the
  8. LAPACK linear-algebra interface (see http://www.netlib.org/lapack/).
  9. The approach follows that taken for the ``autoconf`` macro file,
  10. ``acx_lapack.m4`` (distributed at
  11. http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
  12. Input Variables
  13. ^^^^^^^^^^^^^^^
  14. The following variables may be set to influence this module's behavior:
  15. ``BLA_STATIC``
  16. if ``ON`` use static linkage
  17. ``BLA_VENDOR``
  18. If set, checks only the specified vendor, if not set checks all the
  19. possibilities. List of vendors valid in this module:
  20. * ``OpenBLAS``
  21. * ``FLAME``
  22. * ``Intel10_32`` (intel mkl v10 32 bit)
  23. * ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model)
  24. * ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model)
  25. * ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model)
  26. * ``Intel10_64ilp_seq`` (intel mkl v10+ 64 bit, sequential code, ilp64 model)
  27. * ``Intel10_64_dyn`` (intel mkl v10+ 64 bit, single dynamic library)
  28. * ``Intel`` (obsolete versions of mkl 32 and 64 bit)
  29. * ``ACML``
  30. * ``Apple``
  31. * ``NAS``
  32. * ``Arm``
  33. * ``Arm_mp``
  34. * ``Arm_ilp64``
  35. * ``Arm_ilp64_mp``
  36. * ``Generic``
  37. ``BLA_F95``
  38. if ``ON`` tries to find the BLAS95/LAPACK95 interfaces
  39. Imported targets
  40. ^^^^^^^^^^^^^^^^
  41. This module defines the following :prop_tgt:`IMPORTED` target:
  42. ``LAPACK::LAPACK``
  43. The libraries to use for LAPACK, if found.
  44. Result Variables
  45. ^^^^^^^^^^^^^^^^
  46. This module defines the following variables:
  47. ``LAPACK_FOUND``
  48. library implementing the LAPACK interface is found
  49. ``LAPACK_LINKER_FLAGS``
  50. uncached list of required linker flags (excluding ``-l`` and ``-L``).
  51. ``LAPACK_LIBRARIES``
  52. uncached list of libraries (using full path name) to link against
  53. to use LAPACK
  54. ``LAPACK95_LIBRARIES``
  55. uncached list of libraries (using full path name) to link against
  56. to use LAPACK95
  57. ``LAPACK95_FOUND``
  58. library implementing the LAPACK95 interface is found
  59. .. note::
  60. C, CXX or Fortran must be enabled to detect a BLAS/LAPACK library.
  61. C or CXX must be enabled to use Intel Math Kernel Library (MKL).
  62. For example, to use Intel MKL libraries and/or Intel compiler:
  63. .. code-block:: cmake
  64. set(BLA_VENDOR Intel10_64lp)
  65. find_package(LAPACK)
  66. #]=======================================================================]
  67. # Check the language being used
  68. if(NOT (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED OR CMAKE_Fortran_COMPILER_LOADED))
  69. if(LAPACK_FIND_REQUIRED)
  70. message(FATAL_ERROR "FindLAPACK requires Fortran, C, or C++ to be enabled.")
  71. else()
  72. message(STATUS "Looking for LAPACK... - NOT found (Unsupported languages)")
  73. return()
  74. endif()
  75. endif()
  76. if(CMAKE_Fortran_COMPILER_LOADED)
  77. include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)
  78. else()
  79. include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
  80. endif()
  81. include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
  82. cmake_push_check_state()
  83. set(CMAKE_REQUIRED_QUIET ${LAPACK_FIND_QUIETLY})
  84. set(LAPACK_FOUND FALSE)
  85. set(LAPACK95_FOUND FALSE)
  86. set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
  87. if(BLA_STATIC)
  88. if(WIN32)
  89. set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
  90. else()
  91. set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
  92. endif()
  93. else()
  94. if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
  95. # for ubuntu's libblas3gf and liblapack3gf packages
  96. set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
  97. endif()
  98. endif()
  99. # TODO: move this stuff to a separate module
  100. macro(CHECK_LAPACK_LIBRARIES LIBRARIES _prefix _name _flags _list _threadlibs _addlibdir _subdirs _blas)
  101. # This macro checks for the existence of the combination of fortran libraries
  102. # given by _list. If the combination is found, this macro checks (using the
  103. # Check_Fortran_Function_Exists macro) whether can link against that library
  104. # combination using the name of a routine given by _name using the linker
  105. # flags given by _flags. If the combination of libraries is found and passes
  106. # the link test, LIBRARIES is set to the list of complete library paths that
  107. # have been found. Otherwise, LIBRARIES is set to FALSE.
  108. # N.B. _prefix is the prefix applied to the names of all cached variables that
  109. # are generated internally and marked advanced by this macro.
  110. # _addlibdir is a list of additional search paths. _subdirs is a list of path
  111. # suffixes to be used by find_library().
  112. set(_libraries_work TRUE)
  113. set(${LIBRARIES})
  114. set(_combined_name)
  115. set(_extaddlibdir "${_addlibdir}")
  116. if(WIN32)
  117. list(APPEND _extaddlibdir ENV LIB)
  118. elseif(APPLE)
  119. list(APPEND _extaddlibdir ENV DYLD_LIBRARY_PATH)
  120. else()
  121. list(APPEND _extaddlibdir ENV LD_LIBRARY_PATH)
  122. endif()
  123. list(APPEND _extaddlibdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
  124. foreach(_library ${_list})
  125. if(_library MATCHES "^-Wl,--(start|end)-group$")
  126. # Respect linker flags like --start/end-group (required by MKL)
  127. set(${LIBRARIES} ${${LIBRARIES}} "${_library}")
  128. else()
  129. set(_combined_name ${_combined_name}_${_library})
  130. if(_libraries_work)
  131. find_library(${_prefix}_${_library}_LIBRARY
  132. NAMES ${_library}
  133. PATHS ${_extaddlibdir}
  134. PATH_SUFFIXES ${_subdirs}
  135. )
  136. #message("DEBUG: find_library(${_library}) got ${${_prefix}_${_library}_LIBRARY}")
  137. mark_as_advanced(${_prefix}_${_library}_LIBRARY)
  138. set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
  139. set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
  140. endif()
  141. endif()
  142. endforeach()
  143. if(_libraries_work)
  144. # Test this combination of libraries.
  145. set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threadlibs})
  146. #message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
  147. if(CMAKE_Fortran_COMPILER_LOADED)
  148. check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
  149. else()
  150. check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
  151. endif()
  152. set(CMAKE_REQUIRED_LIBRARIES)
  153. set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
  154. endif()
  155. if(_libraries_work)
  156. if("${_list}${_blas}" STREQUAL "")
  157. set(${LIBRARIES} "${LIBRARIES}-PLACEHOLDER-FOR-EMPTY-LIBRARIES")
  158. else()
  159. set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threadlibs})
  160. endif()
  161. else()
  162. set(${LIBRARIES} FALSE)
  163. endif()
  164. #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
  165. endmacro()
  166. set(LAPACK_LINKER_FLAGS)
  167. set(LAPACK_LIBRARIES)
  168. set(LAPACK95_LIBRARIES)
  169. if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
  170. find_package(BLAS)
  171. else()
  172. find_package(BLAS REQUIRED)
  173. endif()
  174. if(BLAS_FOUND)
  175. set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
  176. if(NOT $ENV{BLA_VENDOR} STREQUAL "")
  177. set(BLA_VENDOR $ENV{BLA_VENDOR})
  178. else()
  179. if(NOT BLA_VENDOR)
  180. set(BLA_VENDOR "All")
  181. endif()
  182. endif()
  183. # LAPACK in the Intel MKL 10+ library?
  184. if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
  185. if(NOT LAPACK_LIBRARIES)
  186. if(CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED)
  187. # System-specific settings
  188. if(NOT WIN32)
  189. set(LAPACK_mkl_LM "-lm")
  190. set(LAPACK_mkl_LDL "-ldl")
  191. endif()
  192. if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
  193. find_package(Threads)
  194. else()
  195. find_package(Threads REQUIRED)
  196. endif()
  197. if(BLA_VENDOR MATCHES "_64ilp")
  198. set(LAPACK_mkl_ILP_MODE "ilp64")
  199. else()
  200. set(LAPACK_mkl_ILP_MODE "lp64")
  201. endif()
  202. set(LAPACK_SEARCH_LIBS "")
  203. if(BLA_F95)
  204. set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95")
  205. set(_LIBRARIES LAPACK95_LIBRARIES)
  206. set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES})
  207. # old
  208. list(APPEND LAPACK_SEARCH_LIBS
  209. "mkl_lapack95")
  210. # new >= 10.3
  211. list(APPEND LAPACK_SEARCH_LIBS
  212. "mkl_intel_c")
  213. list(APPEND LAPACK_SEARCH_LIBS
  214. "mkl_lapack95_${LAPACK_mkl_ILP_MODE}")
  215. else()
  216. set(LAPACK_mkl_SEARCH_SYMBOL "cheev")
  217. set(_LIBRARIES LAPACK_LIBRARIES)
  218. set(_BLAS_LIBRARIES ${BLAS_LIBRARIES})
  219. # old and new >= 10.3
  220. list(APPEND LAPACK_SEARCH_LIBS
  221. "mkl_lapack")
  222. endif()
  223. # MKL uses a multitude of partially platform-specific subdirectories:
  224. if(BLA_VENDOR STREQUAL "Intel10_32")
  225. set(LAPACK_mkl_ARCH_NAME "ia32")
  226. else()
  227. set(LAPACK_mkl_ARCH_NAME "intel64")
  228. endif()
  229. if(WIN32)
  230. set(LAPACK_mkl_OS_NAME "win")
  231. elseif(APPLE)
  232. set(LAPACK_mkl_OS_NAME "mac")
  233. else()
  234. set(LAPACK_mkl_OS_NAME "lin")
  235. endif()
  236. if(DEFINED ENV{MKLROOT})
  237. set(LAPACK_mkl_MKLROOT "$ENV{MKLROOT}")
  238. # If MKLROOT points to the subdirectory 'mkl', use the parent directory instead
  239. # so we can better detect other relevant libraries in 'compiler' or 'tbb':
  240. get_filename_component(LAPACK_mkl_MKLROOT_LAST_DIR "${LAPACK_mkl_MKLROOT}" NAME)
  241. if(LAPACK_mkl_MKLROOT_LAST_DIR STREQUAL "mkl")
  242. get_filename_component(LAPACK_mkl_MKLROOT "${LAPACK_mkl_MKLROOT}" DIRECTORY)
  243. endif()
  244. endif()
  245. set(LAPACK_mkl_LIB_PATH_SUFFIXES
  246. "compiler/lib" "compiler/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}"
  247. "mkl/lib" "mkl/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}"
  248. "lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}")
  249. # First try empty lapack libs
  250. if(NOT ${_LIBRARIES})
  251. check_lapack_libraries(
  252. ${_LIBRARIES}
  253. LAPACK
  254. ${LAPACK_mkl_SEARCH_SYMBOL}
  255. ""
  256. ""
  257. "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}"
  258. "${LAPACK_mkl_MKLROOT}"
  259. "${LAPACK_mkl_LIB_PATH_SUFFIXES}"
  260. "${_BLAS_LIBRARIES}"
  261. )
  262. endif()
  263. # Then try the search libs
  264. foreach(IT ${LAPACK_SEARCH_LIBS})
  265. string(REPLACE " " ";" SEARCH_LIBS ${IT})
  266. if(NOT ${_LIBRARIES})
  267. check_lapack_libraries(
  268. ${_LIBRARIES}
  269. LAPACK
  270. ${LAPACK_mkl_SEARCH_SYMBOL}
  271. ""
  272. "${SEARCH_LIBS}"
  273. "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}"
  274. "${LAPACK_mkl_MKLROOT}"
  275. "${LAPACK_mkl_LIB_PATH_SUFFIXES}"
  276. "${_BLAS_LIBRARIES}"
  277. )
  278. endif()
  279. endforeach()
  280. unset(LAPACK_mkl_ILP_MODE)
  281. unset(LAPACK_mkl_SEARCH_SYMBOL)
  282. unset(LAPACK_mkl_LM)
  283. unset(LAPACK_mkl_LDL)
  284. unset(LAPACK_mkl_MKLROOT)
  285. unset(LAPACK_mkl_ARCH_NAME)
  286. unset(LAPACK_mkl_OS_NAME)
  287. unset(LAPACK_mkl_LIB_PATH_SUFFIXES)
  288. endif()
  289. endif()
  290. endif()
  291. # gotoblas? (http://www.tacc.utexas.edu/tacc-projects/gotoblas2)
  292. if(BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
  293. if(NOT LAPACK_LIBRARIES)
  294. check_lapack_libraries(
  295. LAPACK_LIBRARIES
  296. LAPACK
  297. cheev
  298. ""
  299. "goto2"
  300. ""
  301. ""
  302. ""
  303. "${BLAS_LIBRARIES}"
  304. )
  305. endif()
  306. endif()
  307. # OpenBLAS? (http://www.openblas.net)
  308. if(BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All")
  309. if(NOT LAPACK_LIBRARIES)
  310. check_lapack_libraries(
  311. LAPACK_LIBRARIES
  312. LAPACK
  313. cheev
  314. ""
  315. "openblas"
  316. ""
  317. ""
  318. ""
  319. "${BLAS_LIBRARIES}"
  320. )
  321. endif()
  322. endif()
  323. # ArmPL? (https://developer.arm.com/tools-and-software/server-and-hpc/compile/arm-compiler-for-linux/arm-performance-libraries)
  324. if(BLA_VENDOR MATCHES "Arm" OR BLA_VENDOR STREQUAL "All")
  325. # Check for 64bit Integer support
  326. if(BLA_VENDOR MATCHES "_ilp64")
  327. set(LAPACK_armpl_LIB "armpl_ilp64")
  328. else()
  329. set(LAPACK_armpl_LIB "armpl_lp64")
  330. endif()
  331. # Check for OpenMP support, VIA BLA_VENDOR of Arm_mp or Arm_ipl64_mp
  332. if(BLA_VENDOR MATCHES "_mp")
  333. set(LAPACK_armpl_LIB "${LAPACK_armpl_LIB}_mp")
  334. endif()
  335. if(NOT LAPACK_LIBRARIES)
  336. check_lapack_libraries(
  337. LAPACK_LIBRARIES
  338. LAPACK
  339. cheev
  340. ""
  341. "${LAPACK_armpl_LIB}"
  342. ""
  343. ""
  344. ""
  345. "${BLAS_LIBRARIES}"
  346. )
  347. endif()
  348. endif()
  349. # FLAME's blis library? (https://github.com/flame/blis)
  350. if(BLA_VENDOR STREQUAL "FLAME" OR BLA_VENDOR STREQUAL "All")
  351. if(NOT LAPACK_LIBRARIES)
  352. check_lapack_libraries(
  353. LAPACK_LIBRARIES
  354. LAPACK
  355. cheev
  356. ""
  357. "flame"
  358. ""
  359. ""
  360. ""
  361. "${BLAS_LIBRARIES}"
  362. )
  363. endif()
  364. endif()
  365. # BLAS in acml library?
  366. if(BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
  367. if(BLAS_LIBRARIES MATCHES ".+acml.+")
  368. set(LAPACK_LIBRARIES ${BLAS_LIBRARIES})
  369. endif()
  370. endif()
  371. # Apple LAPACK library?
  372. if(BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
  373. if(NOT LAPACK_LIBRARIES)
  374. check_lapack_libraries(
  375. LAPACK_LIBRARIES
  376. LAPACK
  377. cheev
  378. ""
  379. "Accelerate"
  380. ""
  381. ""
  382. ""
  383. "${BLAS_LIBRARIES}"
  384. )
  385. endif()
  386. endif()
  387. # Apple NAS (vecLib) library?
  388. if(BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
  389. if(NOT LAPACK_LIBRARIES)
  390. check_lapack_libraries(
  391. LAPACK_LIBRARIES
  392. LAPACK
  393. cheev
  394. ""
  395. "vecLib"
  396. ""
  397. ""
  398. ""
  399. "${BLAS_LIBRARIES}"
  400. )
  401. endif()
  402. endif()
  403. # Generic LAPACK library?
  404. if(BLA_VENDOR STREQUAL "Generic" OR
  405. BLA_VENDOR STREQUAL "ATLAS" OR
  406. BLA_VENDOR STREQUAL "All")
  407. if(NOT LAPACK_LIBRARIES)
  408. check_lapack_libraries(
  409. LAPACK_LIBRARIES
  410. LAPACK
  411. cheev
  412. ""
  413. "lapack"
  414. ""
  415. ""
  416. ""
  417. "${BLAS_LIBRARIES}"
  418. )
  419. endif()
  420. endif()
  421. else()
  422. message(STATUS "LAPACK requires BLAS")
  423. endif()
  424. if(BLA_F95)
  425. if(LAPACK95_LIBRARIES)
  426. set(LAPACK95_FOUND TRUE)
  427. else()
  428. set(LAPACK95_FOUND FALSE)
  429. endif()
  430. if(NOT LAPACK_FIND_QUIETLY)
  431. if(LAPACK95_FOUND)
  432. message(STATUS "A library with LAPACK95 API found.")
  433. else()
  434. if(LAPACK_FIND_REQUIRED)
  435. message(FATAL_ERROR
  436. "A required library with LAPACK95 API not found. Please specify library location."
  437. )
  438. else()
  439. message(STATUS
  440. "A library with LAPACK95 API not found. Please specify library location."
  441. )
  442. endif()
  443. endif()
  444. endif()
  445. set(LAPACK_FOUND "${LAPACK95_FOUND}")
  446. set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}")
  447. else()
  448. if(LAPACK_LIBRARIES)
  449. set(LAPACK_FOUND TRUE)
  450. else()
  451. set(LAPACK_FOUND FALSE)
  452. endif()
  453. if(NOT LAPACK_FIND_QUIETLY)
  454. if(LAPACK_FOUND)
  455. message(STATUS "A library with LAPACK API found.")
  456. else()
  457. if(LAPACK_FIND_REQUIRED)
  458. message(FATAL_ERROR
  459. "A required library with LAPACK API not found. Please specify library location."
  460. )
  461. else()
  462. message(STATUS
  463. "A library with LAPACK API not found. Please specify library location."
  464. )
  465. endif()
  466. endif()
  467. endif()
  468. endif()
  469. # On compilers that implicitly link LAPACK (such as ftn, cc, and CC on Cray HPC machines)
  470. # we used a placeholder for empty LAPACK_LIBRARIES to get through our logic above.
  471. if(LAPACK_LIBRARIES STREQUAL "LAPACK_LIBRARIES-PLACEHOLDER-FOR-EMPTY-LIBRARIES")
  472. set(LAPACK_LIBRARIES "")
  473. endif()
  474. if(NOT TARGET LAPACK::LAPACK)
  475. add_library(LAPACK::LAPACK INTERFACE IMPORTED)
  476. set(_lapack_libs "${LAPACK_LIBRARIES}")
  477. if(_lapack_libs AND TARGET BLAS::BLAS)
  478. # remove the ${BLAS_LIBRARIES} from the interface and replace it
  479. # with the BLAS::BLAS target
  480. list(REMOVE_ITEM _lapack_libs "${BLAS_LIBRARIES}")
  481. endif()
  482. if(_lapack_libs)
  483. set_target_properties(LAPACK::LAPACK PROPERTIES
  484. INTERFACE_LINK_LIBRARIES "${_lapack_libs}"
  485. )
  486. endif()
  487. unset(_lapack_libs)
  488. endif()
  489. cmake_pop_check_state()
  490. set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})