summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorjulie <julielangou@users.noreply.github.com>2010-12-16 15:12:27 +0000
committerjulie <julielangou@users.noreply.github.com>2010-12-16 15:12:27 +0000
commit046375a08fef95e3946234f16b0d173199737fb7 (patch)
tree6e29f5e79c791787de7e113fb88d82b89e5bd54b /CMakeLists.txt
parent0d5645bfec753a636739e6177515f1b9a5d3da3e (diff)
downloadlapack-046375a08fef95e3946234f16b0d173199737fb7.tar.gz
lapack-046375a08fef95e3946234f16b0d173199737fb7.tar.bz2
lapack-046375a08fef95e3946234f16b0d173199737fb7.zip
1. Corrected the way linker flags from FindBLAS are being used
2. Changed LOOK_FOR_OPTIMIZED_BLAS to USE_OPTIMIZED_BLAS per CMake convention 3. Changed BLAS_VENDORS to use library names instead of manufacturer names: From: BLAS_VENDORS=AMD;IBM;INTEL;HP;SUN etc To: BLAS_VENDORS=ACML;ESSL;MKL;VECLIB;PERFLIB This seems to be a more intuitive interface 4. Added support for Intel MKL single dynamic library - Chuck Atkins (Kitware)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt59
1 files changed, 33 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c8fb0be7..4a9cc476 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,7 +15,7 @@ macro(lapack_install_library lib)
ARCHIVE DESTINATION lib${LIB_SUFFIX}
LIBRARY DESTINATION lib${LIB_SUFFIX}
RUNTIME DESTINATION bin
- )
+ )
endmacro()
# --------------------------------------------------
@@ -49,35 +49,42 @@ set(PKG_CONFIG_DIR ${libdir}/pkgconfig)
# --------------------------------------------------
# Subdirectories that need to be processed
-option(LOOK_FOR_OPTIMZED_BLAS "Whether or not to use an optimized BLAS library or the included netlib BLAS" OFF)
-if (BLAS_LIBRAIRIES)
- # User provided a BLAS Library
- include(CheckFortranFunctionExists)
- set(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRAIRIES})
- CHECK_FORTRAN_FUNCTION_EXISTS("dgemm" BLAS_FOUND)
- unset( CMAKE_REQUIRED_LIBRARIES )
- if (BLAS_FOUND)
- message(STATUS "--> BLAS supplied by user is WORKING, will use ${BLAS_LIBRAIRIES}.")
- else(BLAS_FOUND)
- message(ERROR "--> BLAS supplied by user is not WORKING, CANNOT USE ${BLAS_LIBRAIRIES}.")
- message(ERROR "--> Will use REFERENCE BLAS (by default)")
- message(ERROR "--> Or Correct your BLAS_LIBRAIRIES entry ")
- message(ERROR "--> Or Consider checking LOOK_FOR_OPTIMZED_BLAS")
- endif(BLAS_FOUND)
-else (BLAS_LIBRAIRIES)
- # User did not provide a BLAS Library
- if( LOOK_FOR_OPTIMZED_BLAS )
- find_package( BLAS )
- endif(LOOK_FOR_OPTIMZED_BLAS)
+option(USE_OPTIMIZED_BLAS "Whether or not to use an optimized BLAS library instead of included netlib BLAS" OFF)
+
+# Check the usage of the user provided BLAS libraries
+if(BLAS_LIBRAIRIES)
+ include(CheckFortranFunctionExists)
+ set(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRAIRIES})
+ CHECK_FORTRAN_FUNCTION_EXISTS("dgemm" BLAS_FOUND)
+ unset( CMAKE_REQUIRED_LIBRARIES )
+ if(BLAS_FOUND)
+ message(STATUS "--> BLAS supplied by user is WORKING, will use ${BLAS_LIBRAIRIES}.")
+ else(BLAS_FOUND)
+ message(ERROR "--> BLAS supplied by user is not WORKING, CANNOT USE ${BLAS_LIBRAIRIES}.")
+ message(ERROR "--> Will use REFERENCE BLAS (by default)")
+ message(ERROR "--> Or Correct your BLAS_LIBRAIRIES entry ")
+ message(ERROR "--> Or Consider checking USE_OPTIMIZED_BLAS")
+ endif(BLAS_FOUND)
+
+# User did not provide a BLAS Library but specified to search for one
+elseif( USE_OPTIMIZED_BLAS )
+ find_package( BLAS )
endif (BLAS_LIBRAIRIES)
+# Neither user specified or optimized BLAS libraries can be used
if(NOT BLAS_FOUND)
- add_subdirectory(BLAS)
- set( BLAS_LIBRARIES blas )
+ add_subdirectory(BLAS)
+ set( BLAS_LIBRARIES blas )
else()
- set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${BLAS_LINKER_FLAGS}"
- CACHE STRING "Flags for Fortran compiler" FORCE
- )
+ set( CMAKE_EXE_LINKER_FLAGS
+ "${CMAKE_EXE_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
+ CACHE STRING "Linker flags for executables" FORCE)
+ set( CMAKE_MODULE_LINKER_FLAGS
+ "${CMAKE_MODULE_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
+ CACHE STRING "Linker flags for modules" FORCE)
+ set( CMAKE_SHARED_LINKER_FLAGS
+ "${CMAKE_SHARED_LINKER_FLAGS} ${BLAS_LINKER_FLAGS}"
+ CACHE STRING "Linker flags for shared libs" FORCE)
endif( NOT BLAS_FOUND )
add_subdirectory(SRC)