1 # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 # file Copyright.txt or https://cmake.org/licensing for details.
4 #[=======================================================================[.rst:
8 Find Linear Algebra PACKage (LAPACK) library
10 This module finds an installed Fortran library that implements the
11 `LAPACK linear-algebra interface`_.
13 At least one of the ``C``, ``CXX``, or ``Fortran`` languages must be enabled.
15 .. _`LAPACK linear-algebra interface`: http://www.netlib.org/lapack/
20 The following variables may be set to influence this module's behavior:
23 if ``ON`` use static linkage
26 Set to one of the :ref:`BLAS/LAPACK Vendors` to search for BLAS only
27 from the specified vendor. If not set, all vendors are considered.
30 if ``ON`` tries to find the BLAS95/LAPACK95 interfaces
32 ``BLA_PREFER_PKGCONFIG``
33 .. versionadded:: 3.20
35 if set ``pkg-config`` will be used to search for a LAPACK library first
36 and if one is found that is preferred
38 ``BLA_SIZEOF_INTEGER``
39 .. versionadded:: 3.22
41 Specify the BLAS/LAPACK library integer size:
44 Search for a BLAS/LAPACK with 32-bit integer interfaces.
46 Search for a BLAS/LAPACK with 64-bit integer interfaces.
48 Search for any BLAS/LAPACK.
49 Most likely, a BLAS/LAPACK with 32-bit integer interfaces will be found.
54 This module defines the following :prop_tgt:`IMPORTED` targets:
57 .. versionadded:: 3.18
59 The libraries to use for LAPACK, if found.
64 This module defines the following variables:
67 library implementing the LAPACK interface is found
68 ``LAPACK_LINKER_FLAGS``
69 uncached list of required linker flags (excluding ``-l`` and ``-L``).
71 uncached list of libraries (using full path name) to link against
73 ``LAPACK95_LIBRARIES``
74 uncached list of libraries (using full path name) to link against
77 library implementing the LAPACK95 interface is found
82 To use the Intel MKL implementation of LAPACK, a project must enable at least
83 one of the ``C`` or ``CXX`` languages. Set ``BLA_VENDOR`` to an Intel MKL
84 variant either on the command-line as ``-DBLA_VENDOR=Intel10_64lp`` or in
89 set(BLA_VENDOR Intel10_64lp)
92 In order to build a project using Intel MKL, and end user must first
93 establish an Intel MKL environment. See the :module:`FindBLAS` module
94 section on :ref:`Intel MKL` for details.
96 #]=======================================================================]
98 # The approach follows that of the ``autoconf`` macro file, ``acx_lapack.m4``
99 # (distributed at http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
101 if(CMAKE_Fortran_COMPILER_LOADED)
102 include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)
104 include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
106 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
108 function(_add_lapack_target)
109 if(LAPACK_FOUND AND NOT TARGET LAPACK::LAPACK)
110 add_library(LAPACK::LAPACK INTERFACE IMPORTED)
112 # Filter out redundant BLAS info and replace with the BLAS target
113 set(_lapack_libs "${LAPACK_LIBRARIES}")
114 set(_lapack_flags "${LAPACK_LINKER_FLAGS}")
115 if(TARGET BLAS::BLAS)
116 if(_lapack_libs AND BLAS_LIBRARIES)
117 foreach(_blas_lib IN LISTS BLAS_LIBRARIES)
118 list(REMOVE_ITEM _lapack_libs "${_blas_lib}")
121 if(_lapack_flags AND BLAS_LINKER_FLAGS)
122 foreach(_blas_flag IN LISTS BLAS_LINKER_FLAGS)
123 list(REMOVE_ITEM _lapack_flags "${_blas_flag}")
126 list(APPEND _lapack_libs BLAS::BLAS)
129 set_target_properties(LAPACK::LAPACK PROPERTIES
130 INTERFACE_LINK_LIBRARIES "${_lapack_libs}"
134 set_target_properties(LAPACK::LAPACK PROPERTIES
135 INTERFACE_LINK_OPTIONS "${_lapack_flags}"
141 # TODO: move this stuff to a separate module
143 function(CHECK_LAPACK_LIBRARIES LIBRARIES _prefix _name _flags _list _deps _addlibdir _subdirs _blas)
144 # This function checks for the existence of the combination of libraries
145 # given by _list. If the combination is found, this checks whether can link
146 # against that library combination using the name of a routine given by _name
147 # using the linker flags given by _flags. If the combination of libraries is
148 # found and passes the link test, ${LIBRARIES} is set to the list of complete
149 # library paths that have been found. Otherwise, ${LIBRARIES} is set to FALSE.
151 set(_libraries_work TRUE)
157 set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
159 set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
162 if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
163 # for ubuntu's libblas3gf and liblapack3gf packages
164 set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
168 set(_extaddlibdir "${_addlibdir}")
170 list(APPEND _extaddlibdir ENV LIB)
172 list(APPEND _extaddlibdir ENV DYLD_LIBRARY_PATH)
174 list(APPEND _extaddlibdir ENV LD_LIBRARY_PATH)
176 list(APPEND _extaddlibdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
178 foreach(_library ${_list})
179 if(_library MATCHES "^-")
180 # Respect linker flags as-is (required by MKL)
181 list(APPEND _libraries "${_library}")
183 string(REGEX REPLACE "[^A-Za-z0-9]" "_" _lib_var "${_library}")
184 string(APPEND _combined_name "_${_lib_var}")
185 if(NOT "${_deps}" STREQUAL "")
186 string(APPEND _combined_name "_deps")
189 find_library(${_prefix}_${_lib_var}_LIBRARY
192 PATHS ${_extaddlibdir}
193 PATH_SUFFIXES ${_subdirs}
195 mark_as_advanced(${_prefix}_${_lib_var}_LIBRARY)
196 list(APPEND _libraries ${${_prefix}_${_lib_var}_LIBRARY})
197 set(_libraries_work ${${_prefix}_${_lib_var}_LIBRARY})
202 foreach(_flag ${_flags})
203 string(REGEX REPLACE "[^A-Za-z0-9]" "_" _flag_var "${_flag}")
204 string(APPEND _combined_name "_${_flag_var}")
207 # Test this combination of libraries.
208 set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${_libraries} ${_blas} ${_deps})
209 set(CMAKE_REQUIRED_QUIET ${LAPACK_FIND_QUIETLY})
210 if(CMAKE_Fortran_COMPILER_LOADED)
211 check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
213 check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
215 set(CMAKE_REQUIRED_LIBRARIES)
216 set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
220 if("${_list}${_blas}" STREQUAL "")
221 set(_libraries "${LIBRARIES}-PLACEHOLDER-FOR-EMPTY-LIBRARIES")
223 list(APPEND _libraries ${_blas} ${_deps})
226 set(_libraries FALSE)
228 set(${LIBRARIES} "${_libraries}" PARENT_SCOPE)
231 macro(_lapack_find_dependency dep)
232 set(_lapack_quiet_arg)
233 if(LAPACK_FIND_QUIETLY)
234 set(_lapack_quiet_arg QUIET)
236 set(_lapack_required_arg)
237 if(LAPACK_FIND_REQUIRED)
238 set(_lapack_required_arg REQUIRED)
240 find_package(${dep} ${ARGN}
242 ${_lapack_required_arg}
244 if (NOT ${dep}_FOUND)
245 set(LAPACK_NOT_FOUND_MESSAGE "LAPACK could not be found because dependency ${dep} could not be found.")
248 set(_lapack_required_arg)
249 set(_lapack_quiet_arg)
252 set(LAPACK_LINKER_FLAGS)
253 set(LAPACK_LIBRARIES)
254 set(LAPACK95_LIBRARIES)
255 set(_lapack_fphsa_req_var LAPACK_LIBRARIES)
257 # Check the language being used
258 if(NOT (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED OR CMAKE_Fortran_COMPILER_LOADED))
259 set(LAPACK_NOT_FOUND_MESSAGE
260 "FindLAPACK requires Fortran, C, or C++ to be enabled.")
263 if(NOT BLA_SIZEOF_INTEGER)
264 # in the reality we do not know which API of BLAS/LAPACK is masked in library
265 set(_lapack_sizeof_integer "ANY")
266 elseif((BLA_SIZEOF_INTEGER STREQUAL "ANY") OR
267 (BLA_SIZEOF_INTEGER STREQUAL "4") OR
268 (BLA_SIZEOF_INTEGER STREQUAL "8"))
269 set(_lapack_sizeof_integer ${BLA_SIZEOF_INTEGER})
271 message(FATAL_ERROR "BLA_SIZEOF_INTEGER can have only <no value>, ANY, 4, or 8 values")
275 if(NOT LAPACK_NOT_FOUND_MESSAGE)
276 _lapack_find_dependency(BLAS)
279 # Search with pkg-config if specified
280 if(BLA_PREFER_PKGCONFIG)
281 find_package(PkgConfig QUIET)
282 pkg_check_modules(PKGC_LAPACK QUIET lapack)
283 if(PKGC_LAPACK_FOUND)
284 set(LAPACK_FOUND TRUE)
285 set(LAPACK_LIBRARIES "${PKGC_LAPACK_LINK_LIBRARIES}")
287 list(APPEND LAPACK_LIBRARIES "${BLAS_LIBRARIES}")
294 # Search for different LAPACK distributions if BLAS is found
295 if(NOT LAPACK_NOT_FOUND_MESSAGE)
296 set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
297 if(NOT $ENV{BLA_VENDOR} STREQUAL "")
298 set(BLA_VENDOR $ENV{BLA_VENDOR})
299 elseif(NOT BLA_VENDOR)
300 set(BLA_VENDOR "All")
303 # LAPACK in the Intel MKL 10+ library?
304 if(NOT LAPACK_LIBRARIES
305 AND (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
306 AND (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED))
307 # System-specific settings
309 set(LAPACK_mkl_LM "-lm")
310 set(LAPACK_mkl_LDL "-ldl")
313 _lapack_find_dependency(Threads)
315 if(_lapack_sizeof_integer EQUAL 8)
316 set(LAPACK_mkl_ILP_MODE "ilp64")
317 elseif(_lapack_sizeof_integer EQUAL 4)
318 set(LAPACK_mkl_ILP_MODE "lp64")
320 if(BLA_VENDOR MATCHES "_64ilp")
321 set(LAPACK_mkl_ILP_MODE "ilp64")
323 set(LAPACK_mkl_ILP_MODE "lp64")
327 set(LAPACK_SEARCH_LIBS "")
330 set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95")
331 set(_LAPACK_LIBRARIES LAPACK95_LIBRARIES)
332 set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES})
335 list(APPEND LAPACK_SEARCH_LIBS
338 list(APPEND LAPACK_SEARCH_LIBS
340 list(APPEND LAPACK_SEARCH_LIBS
341 "mkl_lapack95_${LAPACK_mkl_ILP_MODE}")
343 set(LAPACK_mkl_SEARCH_SYMBOL "cheev")
344 set(_LAPACK_LIBRARIES LAPACK_LIBRARIES)
345 set(_BLAS_LIBRARIES ${BLAS_LIBRARIES})
347 # old and new >= 10.3
348 list(APPEND LAPACK_SEARCH_LIBS
352 # MKL uses a multitude of partially platform-specific subdirectories:
353 if(BLA_VENDOR STREQUAL "Intel10_32")
354 set(LAPACK_mkl_ARCH_NAME "ia32")
356 set(LAPACK_mkl_ARCH_NAME "intel64")
359 set(LAPACK_mkl_OS_NAME "win")
361 set(LAPACK_mkl_OS_NAME "mac")
363 set(LAPACK_mkl_OS_NAME "lin")
365 if(DEFINED ENV{MKLROOT})
366 file(TO_CMAKE_PATH "$ENV{MKLROOT}" LAPACK_mkl_MKLROOT)
367 # If MKLROOT points to the subdirectory 'mkl', use the parent directory instead
368 # so we can better detect other relevant libraries in 'compiler' or 'tbb':
369 get_filename_component(LAPACK_mkl_MKLROOT_LAST_DIR "${LAPACK_mkl_MKLROOT}" NAME)
370 if(LAPACK_mkl_MKLROOT_LAST_DIR STREQUAL "mkl")
371 get_filename_component(LAPACK_mkl_MKLROOT "${LAPACK_mkl_MKLROOT}" DIRECTORY)
374 set(LAPACK_mkl_LIB_PATH_SUFFIXES
375 "compiler/lib" "compiler/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}"
376 "compiler/lib/${LAPACK_mkl_ARCH_NAME}"
377 "mkl/lib" "mkl/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}"
378 "mkl/lib/${LAPACK_mkl_ARCH_NAME}"
379 "lib" "lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}"
380 "lib/${LAPACK_mkl_ARCH_NAME}"
383 # First try empty lapack libs (implicitly linked or automatic from BLAS)
384 if(NOT ${_LAPACK_LIBRARIES})
385 check_lapack_libraries(
388 ${LAPACK_mkl_SEARCH_SYMBOL}
391 "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}"
392 "${LAPACK_mkl_MKLROOT}"
393 "${LAPACK_mkl_LIB_PATH_SUFFIXES}"
396 if(LAPACK_WORKS AND NOT _BLAS_LIBRARIES)
397 # Give a more helpful "found" message
398 set(LAPACK_WORKS "implicitly linked")
399 set(_lapack_fphsa_req_var LAPACK_WORKS)
403 # Then try the search libs
404 foreach(_search ${LAPACK_SEARCH_LIBS})
405 string(REPLACE " " ";" _search ${_search})
406 if(NOT ${_LAPACK_LIBRARIES})
407 check_lapack_libraries(
410 ${LAPACK_mkl_SEARCH_SYMBOL}
413 "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}"
414 "${LAPACK_mkl_MKLROOT}"
415 "${LAPACK_mkl_LIB_PATH_SUFFIXES}"
422 unset(LAPACK_mkl_ILP_MODE)
423 unset(LAPACK_mkl_SEARCH_SYMBOL)
425 unset(LAPACK_mkl_LDL)
426 unset(LAPACK_mkl_MKLROOT)
427 unset(LAPACK_mkl_ARCH_NAME)
428 unset(LAPACK_mkl_OS_NAME)
429 unset(LAPACK_mkl_LIB_PATH_SUFFIXES)
432 # gotoblas? (http://www.tacc.utexas.edu/tacc-projects/gotoblas2)
433 if(NOT LAPACK_LIBRARIES
434 AND (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All"))
435 check_lapack_libraries(
448 # FlexiBLAS? (http://www.mpi-magdeburg.mpg.de/mpcsc/software/FlexiBLAS/)
449 if(NOT LAPACK_LIBRARIES
450 AND (BLA_VENDOR STREQUAL "FlexiBLAS" OR BLA_VENDOR STREQUAL "All"))
451 set(_lapack_flexiblas_lib "flexiblas")
453 if(_lapack_sizeof_integer EQUAL 8)
454 string(APPEND _lapack_flexiblas_lib "64")
457 check_lapack_libraries(
462 "${_lapack_flexiblas_lib}"
469 unset(_lapack_flexiblas_lib)
472 # OpenBLAS? (http://www.openblas.net)
473 if(NOT LAPACK_LIBRARIES
474 AND (BLA_VENDOR STREQUAL "OpenBLAS" OR BLA_VENDOR STREQUAL "All"))
475 set(_lapack_openblas_lib "openblas")
477 if(_lapack_sizeof_integer EQUAL 8)
478 string(APPEND _lapack_openblas_lib "64")
481 check_lapack_libraries(
486 "${_lapack_openblas_lib}"
493 unset(_lapack_openblas_lib)
496 # ArmPL? (https://developer.arm.com/tools-and-software/server-and-hpc/compile/arm-compiler-for-linux/arm-performance-libraries)
497 if(NOT LAPACK_LIBRARIES
498 AND (BLA_VENDOR MATCHES "Arm" OR BLA_VENDOR STREQUAL "All"))
499 # Check for 64bit Integer support
500 if(_lapack_sizeof_integer EQUAL 8)
501 set(LAPACK_armpl_LIB "armpl_ilp64")
502 elseif(_lapack_sizeof_integer EQUAL 4)
503 set(LAPACK_armpl_LIB "armpl_lp64")
505 if(BLA_VENDOR MATCHES "_ilp64")
506 set(LAPACK_armpl_LIB "armpl_ilp64")
508 set(LAPACK_armpl_LIB "armpl_lp64")
512 # Check for OpenMP support, VIA BLA_VENDOR of Arm_mp or Arm_ipl64_mp
513 if(BLA_VENDOR MATCHES "_mp")
514 string(APPEND LAPACK_armpl_LIB "_mp")
517 check_lapack_libraries(
522 "${LAPACK_armpl_LIB}"
530 # FLAME's blis library? (https://github.com/flame/blis)
531 if(NOT LAPACK_LIBRARIES
532 AND (BLA_VENDOR STREQUAL "FLAME" OR BLA_VENDOR STREQUAL "All"))
533 if(_lapack_sizeof_integer EQUAL 8)
534 if(BLA_VENDOR STREQUAL "FLAME")
535 message(FATAL_ERROR "libFLAME does not support Int64 type")
538 check_lapack_libraries(
552 # LAPACK in SCSL library? (SGI/Cray Scientific Library)
553 if(NOT LAPACK_LIBRARIES
554 AND (BLA_VENDOR MATCHES "SCSL" OR BLA_VENDOR STREQUAL "All"))
555 set(_lapack_scsl_lib "scs")
557 if(_lapack_sizeof_integer EQUAL 8)
558 string(APPEND _lapack_scsl_lib "_i8")
560 # Check for OpenMP support, VIA BLA_VENDOR of scs_mp
561 if(BLA_VENDOR MATCHES "_mp")
562 string(APPEND _lapack_scsl_lib "_mp")
565 check_lapack_libraries(
570 "${_lapack_scsl_lib}"
576 unset(_lapack_scsl_lib)
579 # BLAS in acml library?
580 if(BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All")
581 if(BLAS_LIBRARIES MATCHES ".+acml.+")
582 set(LAPACK_LIBRARIES ${BLAS_LIBRARIES})
586 # Apple LAPACK library?
587 if(NOT LAPACK_LIBRARIES
588 AND (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All"))
589 if(_lapack_sizeof_integer EQUAL 8)
590 if(BLA_VENDOR STREQUAL "Apple")
591 message(FATAL_ERROR "Accelerate Framework does not support Int64 type")
594 check_lapack_libraries(
608 # Apple NAS (vecLib) library?
609 if(NOT LAPACK_LIBRARIES
610 AND (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All"))
611 if(_lapack_sizeof_integer EQUAL 8)
612 if(BLA_VENDOR STREQUAL "NAS")
613 message(FATAL_ERROR "Accelerate Framework does not support Int64 type")
616 check_lapack_libraries(
630 # Elbrus Math Library?
631 if(NOT LAPACK_LIBRARIES
632 AND (BLA_VENDOR MATCHES "EML" OR BLA_VENDOR STREQUAL "All"))
633 if(BLAS_LIBRARIES MATCHES "eml.+")
634 set(LAPACK_LIBRARIES ${BLAS_LIBRARIES})
638 # Fujitsu SSL2 Library?
639 if(NOT LAPACK_LIBRARIES
640 AND (BLA_VENDOR MATCHES "Fujitsu_SSL2" OR BLA_VENDOR STREQUAL "All"))
641 if(BLAS_LIBRARIES MATCHES "fjlapack.+")
642 set(LAPACK_LIBRARIES ${BLAS_LIBRARIES})
643 set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS})
647 # LAPACK in IBM ESSL library?
648 if(NOT LAPACK_LIBRARIES
649 AND (BLA_VENDOR MATCHES "IBMESSL" OR BLA_VENDOR STREQUAL "All"))
650 if(BLAS_LIBRARIES MATCHES "essl.+")
651 set(LAPACK_LIBRARIES ${BLAS_LIBRARIES})
657 if(NOT LAPACK_LIBRARIES
658 AND (BLA_VENDOR MATCHES "NVHPC" OR BLA_VENDOR STREQUAL "All"))
659 set(_lapack_nvhpc_lib "lapack")
661 if(_lapack_sizeof_integer EQUAL 8)
662 string(APPEND _lapack_nvhpc_lib "_ilp64")
663 elseif(_lapack_sizeof_integer EQUAL 4)
664 string(APPEND _lapack_nvhpc_lib "_lp64")
666 set(_lapack_nvhpc_flags)
667 if(";${CMAKE_C_COMPILER_ID};${CMAKE_CXX_COMPILER_ID};${CMAKE_Fortran_COMPILER_ID};" MATCHES ";(NVHPC|PGI);")
668 set(_lapack_nvhpc_flags "-fortranlibs")
671 check_lapack_libraries(
676 "${_lapack_nvhpc_lib}"
677 "${_lapack_nvhpc_flags}"
683 # an additional check for NVHPC 2020
684 # which does not have differentiation
685 # between lp64 and ilp64 modes
686 if(NOT LAPACK_LIBRARIES AND NOT _lapack_sizeof_integer EQUAL 8)
687 set(_lapack_nvhpc_lib "lapack")
689 check_lapack_libraries(
694 "${_lapack_nvhpc_lib}"
695 "${_lapack_nvhpc_flags}"
702 unset(_lapack_nvhpc_lib)
703 unset(_lapack_nvhpc_flags)
706 # Generic LAPACK library?
707 if(NOT LAPACK_LIBRARIES
708 AND (BLA_VENDOR STREQUAL "Generic"
709 OR BLA_VENDOR STREQUAL "ATLAS"
710 OR BLA_VENDOR STREQUAL "All"))
711 set(_lapack_generic_lib "lapack")
713 # We do not know for sure how the LAPACK reference implementation
714 # is built on this host. Guess typical dependencies.
715 set(_lapack_generic_deps "-lgfortran;-lm")
717 set(_lapack_generic_deps "")
720 if(_lapack_sizeof_integer EQUAL 8)
721 string(APPEND _lapack_generic_lib "64")
724 check_lapack_libraries(
729 "${_lapack_generic_lib}"
730 "${_lapack_generic_deps}"
736 unset(_lapack_generic_deps)
737 unset(_lapack_generic_lib)
742 set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}")
745 if(LAPACK_NOT_FOUND_MESSAGE)
746 set(LAPACK_NOT_FOUND_MESSAGE
747 REASON_FAILURE_MESSAGE ${LAPACK_NOT_FOUND_MESSAGE})
749 find_package_handle_standard_args(LAPACK REQUIRED_VARS ${_lapack_fphsa_req_var}
750 ${LAPACK_NOT_FOUND_MESSAGE})
751 unset(LAPACK_NOT_FOUND_MESSAGE)
754 set(LAPACK95_FOUND ${LAPACK_FOUND})
757 # On compilers that implicitly link LAPACK (such as ftn, cc, and CC on Cray HPC machines)
758 # we used a placeholder for empty LAPACK_LIBRARIES to get through our logic above.
759 if(LAPACK_LIBRARIES STREQUAL "LAPACK_LIBRARIES-PLACEHOLDER-FOR-EMPTY-LIBRARIES")
760 set(LAPACK_LIBRARIES "")
764 unset(_lapack_fphsa_req_var)
765 unset(_lapack_sizeof_integer)
766 unset(_LAPACK_LIBRARIES)