Debian Codegraph @

debian/external_deps/fetk/cmake/FindARPACK.cmake

raw
1 ################################################################################
2 # [FETK header]
3 # From sidch/CMake
4 # https://github.com/sidch/CMake/blob/master/Modules/FindARPACK.cmake
5 # Accessed on June 18, 2021
6 ################################################################################
7
8 # Searches for an installation of the ARPACK library. On success, it sets the following variables:
9 #
10 # ARPACK_FOUND Set to true to indicate the library was found
11 # ARPACK_LIBRARIES All libraries needed to use ARPACK (with full path)
12 #
13 # To specify an additional directory to search, set ARPACK_ROOT.
14 #
15 # TODO: Do we need to explicitly search for BLAS and LAPACK as well? The source distribution statically links these to
16 # libarpack. Are there any installations that don't do this or the equivalent?
17 #
18 # Author: Siddhartha Chaudhuri, 2009
19 #
20
21 SET(ARPACK_FOUND FALSE)
22
23 # First look in user-provided root directory, then look in system locations
24 FIND_LIBRARY(ARPACK_LIBRARIES NAMES arpack libarpack ARPACK libARPACK PATHS "${ARPACK_ROOT}" "${ARPACK_ROOT}/lib"
25 NO_DEFAULT_PATH)
26 IF(NOT ARPACK_LIBRARIES)
27 FIND_LIBRARY(ARPACK_LIBRARIES NAMES arpack libarpack ARPACK libARPACK)
28 ENDIF(NOT ARPACK_LIBRARIES)
29
30 IF(ARPACK_LIBRARIES)
31 # On OS X we probably also need gfortran and BLAS and LAPACK libraries
32 IF(APPLE)
33 FIND_LIBRARY(ARPACK_LAPACK_LIBRARY NAMES lapack LAPACK PATHS "${ARPACK_ROOT}" "${ARPACK_ROOT}/lib")
34 FIND_LIBRARY(ARPACK_BLAS_LIBRARY NAMES blas BLAS PATHS "${ARPACK_ROOT}" "${ARPACK_ROOT}/lib")
35 FIND_LIBRARY(ARPACK_GFORTRAN_LIBRARY NAMES gfortran PATHS "${ARPACK_ROOT}" "${ARPACK_ROOT}/lib"
36 PATH_SUFFIXES "" "gfortran/lib" "../gfortran/lib")
37
38 IF(ARPACK_BLAS_LIBRARY)
39 SET(ARPACK_LIBRARIES ${ARPACK_LIBRARIES} ${ARPACK_BLAS_LIBRARY})
40 ENDIF(ARPACK_BLAS_LIBRARY)
41
42 IF(ARPACK_LAPACK_LIBRARY)
43 SET(ARPACK_LIBRARIES ${ARPACK_LIBRARIES} ${ARPACK_LAPACK_LIBRARY})
44 ENDIF(ARPACK_LAPACK_LIBRARY)
45
46 IF(ARPACK_GFORTRAN_LIBRARY)
47 SET(ARPACK_LIBRARIES ${ARPACK_LIBRARIES} ${ARPACK_GFORTRAN_LIBRARY})
48 ENDIF(ARPACK_GFORTRAN_LIBRARY)
49 ENDIF(APPLE)
50
51 SET(ARPACK_FOUND TRUE)
52 ENDIF(ARPACK_LIBRARIES)
53
54 IF(ARPACK_FOUND)
55 IF(NOT ARPACK_FIND_QUIETLY)
56 MESSAGE(STATUS "Found ARPACK: libraries at ${ARPACK_LIBRARIES}")
57 ENDIF(NOT ARPACK_FIND_QUIETLY)
58 ELSE(ARPACK_FOUND)
59 IF(ARPACK_FIND_REQUIRED)
60 MESSAGE(FATAL_ERROR "ARPACK not found")
61 ENDIF(ARPACK_FIND_REQUIRED)
62 ENDIF(ARPACK_FOUND)