FindNativeBlasLapack.cmake 1.01 KB
Newer Older
Blake Nelson's avatar
Blake Nelson committed
1 2 3 4 5 6


SET(NATIVE_BLAS_LAPACK_SEARCH_PATHS /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64 )

FIND_LIBRARY(NATIVE_BLAS NAMES blas PATHS ${NATIVE_BLAS_LAPACK_SEARCH_PATHS})
FIND_LIBRARY(NATIVE_LAPACK NAMES lapack PATHS ${NATIVE_BLAS_LAPACK_SEARCH_PATHS})
Kilian Lackhove's avatar
Kilian Lackhove committed
7 8
GET_FILENAME_COMPONENT(NATIVE_BLAS_LIB_DIR ${NATIVE_BLAS} PATH)
GET_FILENAME_COMPONENT(NATIVE_LAPACK_LIB_DIR ${NATIVE_LAPACK} PATH)
Blake Nelson's avatar
Blake Nelson committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


IF (NATIVE_BLAS AND NATIVE_LAPACK)
  SET(NATIVE_BLAS_LAPACK_FOUND ON)
ENDIF (NATIVE_BLAS AND NATIVE_LAPACK)

IF (NATIVE_BLAS_LAPACK_FOUND)
  IF (NOT NATIVE_BLAS_LAPACK_FIND_QUIETLY)
     MESSAGE(STATUS "Found Native Blas and Lapack")
  ENDIF (NOT NATIVE_BLAS_LAPACK_FIND_QUIETLY)
ELSE(NATIVE_BLAS_LAPACK_FOUND)
  IF (NATIVE_BLAS_LAPACK_FIND_REQUIRED)
     MESSAGE(FATAL_ERROR "Could not find Native blas and lapack libraries.")
  ENDIF (NATIVE_BLAS_LAPACK_FIND_REQUIRED)
ENDIF (NATIVE_BLAS_LAPACK_FOUND)

25 26
MARK_AS_ADVANCED(NATIVE_BLAS)
MARK_AS_ADVANCED(NATIVE_LAPACK)
Kilian Lackhove's avatar
Kilian Lackhove committed
27 28
MARK_AS_ADVANCED(NATIVE_BLAS_LIB_DIR)
MARK_AS_ADVANCED(NATIVE_LAPACK_LIB_DIR)
Blake Nelson's avatar
Blake Nelson committed
29