summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-12-28 20:26:26 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2010-12-28 20:26:26 (GMT)
commit96d0203bc0a497695aa204e69b6d7e0bebcb1df3 (patch)
tree881343fc6904c6df8c230d42717d502db735ff9b /Modules
parent726861ce691db9e2228bdf5fca08fb48f048083a (diff)
parent51253da8bb193cdac4ac45ac43b250cecc2c0e87 (diff)
downloadCMake-96d0203bc0a497695aa204e69b6d7e0bebcb1df3.zip
CMake-96d0203bc0a497695aa204e69b6d7e0bebcb1df3.tar.gz
CMake-96d0203bc0a497695aa204e69b6d7e0bebcb1df3.tar.bz2
Merge topic 'FindBLAS_FindLAPACK'
51253da FindLAPACK works with C/C++ only projects (issue 0009976) e64b5da fix for Fortran-only projects 1279bd7 find ACML fixes
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindBLAS.cmake10
-rw-r--r--Modules/FindLAPACK.cmake34
2 files changed, 31 insertions, 13 deletions
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index b605164..d57513c 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -40,7 +40,11 @@
# License text for the above reference.)
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
+if (NOT _LANGUAGES_ MATCHES Fortran)
include(CheckFunctionExists)
+else ()
+include(CheckFortranFunctionExists)
+endif()
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _threads)
# This macro checks for the existence of the combination of fortran libraries
@@ -98,7 +102,11 @@ if(_libraries_work)
# Test this combination of libraries.
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_threads})
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
- check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
+ if (_LANGUAGES_ MATCHES Fortran)
+ check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
+ else()
+ check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
+ endif()
set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 40effb0..bf45406 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -37,17 +37,12 @@
# License text for the above reference.)
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
-if(NOT _LANGUAGES_ MATCHES Fortran)
- if(LAPACK_FIND_REQUIRED)
- message(FATAL_ERROR
- "FindLAPACK is Fortran-only so Fortran must be enabled.")
- else(LAPACK_FIND_REQUIRED)
- message(STATUS "Looking for LAPACK... - NOT found (Fortran not enabled)")
- return()
- endif(LAPACK_FIND_REQUIRED)
-endif(NOT _LANGUAGES_ MATCHES Fortran)
-
+if (NOT _LANGUAGES_ MATCHES Fortran)
+include(CheckFunctionExists)
+else (NOT _LANGUAGES_ MATCHES Fortran)
include(CheckFortranFunctionExists)
+endif (NOT _LANGUAGES_ MATCHES Fortran)
+
set(LAPACK_FOUND FALSE)
set(LAPACK95_FOUND FALSE)
@@ -112,7 +107,11 @@ if(_libraries_work)
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads})
endif(UNIX AND BLA_STATIC)
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
- check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
+ if (NOT _LANGUAGES_ MATCHES Fortran)
+ check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
+ else (NOT _LANGUAGES_ MATCHES Fortran)
+ check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
+ endif (NOT _LANGUAGES_ MATCHES Fortran)
set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
@@ -157,7 +156,18 @@ if(BLAS_FOUND)
LAPACK
cheev
""
- "acml"
+ "acml;acml_mv"
+ ""
+ ""
+ )
+ endif(NOT LAPACK_LIBRARIES)
+ if(NOT LAPACK_LIBRARIES)
+ check_lapack_libraries(
+ LAPACK_LIBRARIES
+ LAPACK
+ cheev
+ ""
+ "acml_mp;acml_mv"
""
""
)