Link BLAS explicitly on non-Mac platforms

Fixes issue #3.
This commit is contained in:
Keir Mierle
2012-05-01 18:33:08 -07:00
parent df3e54eb4a
commit 92d5ab5f8a
2 changed files with 18 additions and 0 deletions
+12
View File
@@ -145,6 +145,18 @@ IF (SUITESPARSE)
ENDIF (NOT EXISTS ${LAPACK_LIB})
MESSAGE ("-- Found LAPACK library: ${LAPACK_LIB}")
# On Apple BLAS is linked with vecLib, so don't add it separately.
IF (NOT APPLE)
MESSAGE("-- Check for BLAS")
FIND_LIBRARY(BLAS_LIB NAMES blas)
IF (NOT EXISTS ${BLAS_LIB})
MESSAGE(FATAL_ERROR
"Can't find BLAS (needed for LAPACK and SuiteSparse.)"
"Please specify -DBLAS_LIB=...")
ENDIF (NOT EXISTS ${BLAS_LIB})
MESSAGE ("-- Found BLAS library: ${BLAS_LIB}")
ENDIF (NOT APPLE)
ELSE (SUITESPARSE)
ADD_DEFINITIONS(-DCERES_NO_SUITESPARSE)
ENDIF (SUITESPARSE)
+6
View File
@@ -119,6 +119,12 @@ IF (EXISTS ${METIS_LIB})
${METIS_LIB})
ENDIF (EXISTS ${METIS_LIB})
IF (EXISTS ${BLAS_LIB})
SET(CERES_LIBRARY_DEPENDENCIES
${CERES_LIBRARY_DEPENDENCIES}
${BLAS_LIB})
ENDIF (EXISTS ${BLAS_LIB})
IF (OPENMP_FOUND)
SET(CERES_LIBRARY_DEPENDENCIES
${CERES_LIBRARY_DEPENDENCIES}