Merge topic 'FindLAPACK_FindBLAS'
0cc8f05
FindBLAS/LAPACK fixes145de0a
FindBLAS/LAPACK fixes
This commit is contained in:
commit
a239fb6c16
|
@ -42,6 +42,8 @@
|
|||
include(CheckFunctionExists)
|
||||
include(CheckFortranFunctionExists)
|
||||
|
||||
set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
# Check the language being used
|
||||
get_property( _LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES )
|
||||
if( _LANGUAGES_ MATCHES Fortran )
|
||||
|
@ -89,13 +91,18 @@ foreach(_library ${_list})
|
|||
if(_libraries_work)
|
||||
if (BLA_STATIC)
|
||||
if (WIN32)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
endif ( WIN32 )
|
||||
if (APPLE)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
else (APPLE)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
endif (APPLE)
|
||||
else (BLA_STATIC)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
# for ubuntu's libblas3gf and liblapack3gf packages
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
|
||||
endif ()
|
||||
endif (BLA_STATIC)
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
|
@ -349,7 +356,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
|
|||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
"" "acml_mp;acml_mv;CALBLAS" "" ${BLAS_ACML_GPU_LIB_DIRS}
|
||||
"" "acml;acml_mv;CALBLAS" "" ${BLAS_ACML_GPU_LIB_DIRS}
|
||||
)
|
||||
if( BLAS_LIBRARIES )
|
||||
break()
|
||||
|
@ -361,7 +368,7 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
|
|||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
sgemm
|
||||
"" "acml_mp;acml_mv" "" ${BLAS_ACML_LIB_DIRS}
|
||||
"" "acml;acml_mv" "" ${BLAS_ACML_LIB_DIRS}
|
||||
)
|
||||
if( BLAS_LIBRARIES )
|
||||
break()
|
||||
|
@ -408,7 +415,7 @@ if(NOT BLAS_LIBRARIES)
|
|||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
cblas_dgemm
|
||||
dgemm
|
||||
""
|
||||
"Accelerate"
|
||||
""
|
||||
|
@ -421,7 +428,7 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
|
|||
check_fortran_libraries(
|
||||
BLAS_LIBRARIES
|
||||
BLAS
|
||||
cblas_dgemm
|
||||
dgemm
|
||||
""
|
||||
"vecLib"
|
||||
""
|
||||
|
@ -613,3 +620,5 @@ else(BLA_F95)
|
|||
endif(BLAS_FOUND)
|
||||
endif(NOT BLAS_FIND_QUIETLY)
|
||||
endif(BLA_F95)
|
||||
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
||||
get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
if (NOT _LANGUAGES_ MATCHES Fortran)
|
||||
include(CheckFunctionExists)
|
||||
|
@ -46,6 +48,8 @@ endif (NOT _LANGUAGES_ MATCHES Fortran)
|
|||
set(LAPACK_FOUND FALSE)
|
||||
set(LAPACK95_FOUND FALSE)
|
||||
|
||||
# TODO: move this stuff to separate module
|
||||
|
||||
macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads)
|
||||
# This macro checks for the existence of the combination of fortran libraries
|
||||
# given by _list. If the combination is found, this macro checks (using the
|
||||
|
@ -61,38 +65,38 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads
|
|||
set(_libraries_work TRUE)
|
||||
set(${LIBRARIES})
|
||||
set(_combined_name)
|
||||
if (NOT _libdir)
|
||||
if (WIN32)
|
||||
set(_libdir ENV LIB)
|
||||
elseif (APPLE)
|
||||
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH)
|
||||
else ()
|
||||
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
|
||||
endif ()
|
||||
endif ()
|
||||
foreach(_library ${_list})
|
||||
set(_combined_name ${_combined_name}_${_library})
|
||||
|
||||
if(_libraries_work)
|
||||
IF (WIN32)
|
||||
if (BLA_STATIC)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll")
|
||||
endif(BLA_STATIC)
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS ENV LIB
|
||||
)
|
||||
ENDIF (WIN32)
|
||||
|
||||
if (WIN32)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRRAY_SUFFIXES})
|
||||
endif ( WIN32 )
|
||||
if (APPLE)
|
||||
if(BLA_STATIC)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so;.dylib")
|
||||
endif(BLA_STATIC)
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH
|
||||
)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRRAY_SUFFIXES})
|
||||
else (APPLE)
|
||||
if(BLA_STATIC)
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRRAY_SUFFIXES})
|
||||
endif (APPLE)
|
||||
else (BLA_STATIC)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
# for ubuntu's libblas3gf and liblapack3gf packages
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRRAY_SUFFIXES} .so.3gf)
|
||||
endif ()
|
||||
endif (BLA_STATIC)
|
||||
find_library(${_prefix}_${_library}_LIBRARY
|
||||
NAMES ${_library}
|
||||
PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH
|
||||
PATHS ${_libdir}
|
||||
)
|
||||
endif(APPLE)
|
||||
|
||||
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
|
||||
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
|
||||
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
|
||||
|
@ -165,7 +169,7 @@ endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
|
|||
|
||||
|
||||
#acml lapack
|
||||
if (BLA_VENDOR STREQUAL "ACML.*" OR BLA_VENDOR STREQUAL "All")
|
||||
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
|
||||
if (BLAS_LIBRARIES MATCHES ".+acml.+")
|
||||
set (LAPACK_LIBRARIES ${BLAS_LIBRARIES})
|
||||
endif ()
|
||||
|
@ -199,7 +203,9 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
|
|||
endif ( NOT LAPACK_LIBRARIES )
|
||||
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
|
||||
# Generic LAPACK library?
|
||||
if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
|
||||
if (BLA_VENDOR STREQUAL "Generic" OR
|
||||
BLA_VENDOR STREQUAL "ATLAS" OR
|
||||
BLA_VENDOR STREQUAL "All")
|
||||
if ( NOT LAPACK_LIBRARIES )
|
||||
check_lapack_libraries(
|
||||
LAPACK_LIBRARIES
|
||||
|
@ -211,7 +217,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
|
|||
""
|
||||
)
|
||||
endif ( NOT LAPACK_LIBRARIES )
|
||||
endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
|
||||
endif ()
|
||||
#intel lapack
|
||||
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
|
||||
|
@ -297,3 +303,5 @@ else(BLA_F95)
|
|||
endif(LAPACK_FOUND)
|
||||
endif(NOT LAPACK_FIND_QUIETLY)
|
||||
endif(BLA_F95)
|
||||
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
|
|
Loading…
Reference in New Issue