]>
Commit | Line | Data |
---|---|---|
8271ff34 AM |
1 | diff -ruN clapack-3.2.1-CMAKE.1.allexfb/CMakeLists.txt clapack-3.2.1-CMAKE/CMakeLists.txt |
2 | --- clapack-3.2.1-CMAKE.1.allexfb/CMakeLists.txt 2011-06-19 22:13:27.000000000 +0200 | |
3 | +++ clapack-3.2.1-CMAKE/CMakeLists.txt 2011-06-19 22:23:14.000000000 +0200 | |
4 | @@ -30,6 +30,29 @@ | |
5 | ||
6 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") | |
7 | ||
8 | +if(BLAS_LIBRARIES) | |
9 | + include(CheckFortranFunctionExists) | |
10 | + set(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRARIES}) | |
11 | + CHECK_FORTRAN_FUNCTION_EXISTS("dgemm" BLAS_FOUND) | |
12 | + unset( CMAKE_REQUIRED_LIBRARIES ) | |
13 | + if(BLAS_FOUND) | |
14 | + message(STATUS "--> BLAS supplied by user is WORKING, will use ${BLAS_LIBRARIES}.") | |
15 | + else(BLAS_FOUND) | |
16 | + message(ERROR "--> BLAS supplied by user is not WORKING, CANNOT USE ${BLAS_LIBRARIES}.") | |
17 | + message(ERROR "--> Will use REFERENCE BLAS (by default)") | |
18 | + message(ERROR "--> Or Correct your BLAS_LIBRARIES entry ") | |
19 | + message(ERROR "--> Or Consider checking USE_OPTIMIZED_BLAS") | |
20 | + endif(BLAS_FOUND) | |
21 | +else(BLAS_LIBRARIES) | |
22 | + # User did not provide a BLAS Library | |
23 | + find_package(PkgConfig) | |
24 | + pkg_check_modules(BLAS blas) | |
25 | +endif (BLAS_LIBRARIES) | |
26 | + | |
27 | +if(NOT BLAS_FOUND) | |
28 | + message(FATAL_ERROR "--> BLAS libraries needed but not found.") | |
29 | +endif(NOT BLAS_FOUND) | |
30 | + | |
31 | add_subdirectory(SRC) | |
32 | ||
33 | if(ENABLE_TESTS) | |
34 | @@ -44,4 +67,3 @@ | |
35 | ${CLAPACK_BINARY_DIR}/clapack-config-version.cmake @ONLY) | |
36 | configure_file(${CLAPACK_SOURCE_DIR}/clapack-config.cmake.in | |
37 | ${CLAPACK_BINARY_DIR}/clapack-config.cmake @ONLY) | |
38 | - | |
39 | diff -ruN clapack-3.2.1-CMAKE.1.allexfb/SRC/CMakeLists.txt clapack-3.2.1-CMAKE/SRC/CMakeLists.txt | |
40 | --- clapack-3.2.1-CMAKE.1.allexfb/SRC/CMakeLists.txt 2011-06-19 22:13:44.000000000 +0200 | |
41 | +++ clapack-3.2.1-CMAKE/SRC/CMakeLists.txt 2011-06-19 22:15:04.000000000 +0200 | |
42 | @@ -380,7 +380,7 @@ | |
43 | endif() | |
44 | ||
45 | add_library(clapack SHARED ${ALLOBJ} ${ALLXOBJ}) | |
46 | -target_link_libraries(clapack blas f2c m) | |
47 | +target_link_libraries(clapack ${BLAS_LIBRARIES} f2c m) | |
48 | set_target_properties(clapack PROPERTIES SOVERSION "${CLAPACK_VERSION}") | |
49 | ||
50 | install( |