Merge topic 'FindBLAS_FindLAPACK'

51253da FindLAPACK works with C/C++ only projects (issue 0009976)
e64b5da fix for Fortran-only projects
1279bd7 find ACML fixes
This commit is contained in:
Brad King 2010-12-28 15:26:26 -05:00 committed by CMake Topic Stage
commit 96d0203bc0
2 changed files with 31 additions and 13 deletions

View File

@ -40,7 +40,11 @@
# License text for the above reference.) # License text for the above reference.)
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES) get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
if (NOT _LANGUAGES_ MATCHES Fortran)
include(CheckFunctionExists) include(CheckFunctionExists)
else ()
include(CheckFortranFunctionExists)
endif()
macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _threads) macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _threads)
# This macro checks for the existence of the combination of fortran libraries # This macro checks for the existence of the combination of fortran libraries
@ -98,7 +102,11 @@ if(_libraries_work)
# Test this combination of libraries. # Test this combination of libraries.
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_threads}) set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_threads})
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") # 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) set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS) mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) set(_libraries_work ${${_prefix}${_combined_name}_WORKS})

View File

@ -37,17 +37,12 @@
# License text for the above reference.) # License text for the above reference.)
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES) get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
if(NOT _LANGUAGES_ MATCHES Fortran) if (NOT _LANGUAGES_ MATCHES Fortran)
if(LAPACK_FIND_REQUIRED) include(CheckFunctionExists)
message(FATAL_ERROR else (NOT _LANGUAGES_ MATCHES Fortran)
"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)
include(CheckFortranFunctionExists) include(CheckFortranFunctionExists)
endif (NOT _LANGUAGES_ MATCHES Fortran)
set(LAPACK_FOUND FALSE) set(LAPACK_FOUND FALSE)
set(LAPACK95_FOUND FALSE) set(LAPACK95_FOUND FALSE)
@ -112,7 +107,11 @@ if(_libraries_work)
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads}) set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads})
endif(UNIX AND BLA_STATIC) endif(UNIX AND BLA_STATIC)
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") # 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) set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced(${_prefix}${_combined_name}_WORKS) mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
@ -157,7 +156,18 @@ if(BLAS_FOUND)
LAPACK LAPACK
cheev cheev
"" ""
"acml" "acml;acml_mv"
""
""
)
endif(NOT LAPACK_LIBRARIES)
if(NOT LAPACK_LIBRARIES)
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
cheev
""
"acml_mp;acml_mv"
"" ""
"" ""
) )