Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 26c7431b authored by PRUVOST Florent's avatar PRUVOST Florent
Browse files

FindBLAS/LAPACK: improve to find ibm essl and better logs

parent cb6f7883
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
### List of vendors (BLA_VENDOR) valid in this module ### List of vendors (BLA_VENDOR) valid in this module
########## List of vendors (BLA_VENDOR) valid in this module ########## List of vendors (BLA_VENDOR) valid in this module
## Open (for OpenBlas), Eigen (for EigenBlas), Goto, ATLAS PhiPACK, ## Open (for OpenBlas), Eigen (for EigenBlas), Goto, ATLAS PhiPACK,
## CXML, DXML, SunPerf, SCSL, SGIMATH, IBMESSL, ## CXML, DXML, SunPerf, SCSL, SGIMATH, IBMESSL, IBMESSLMT
## Intel10_32 (intel mkl v10 32 bit), Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model), ## Intel10_32 (intel mkl v10 32 bit), Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model),
## Intel10_64lp_seq (intel mkl v10 64 bit,sequential code, lp64 model), ## Intel10_64lp_seq (intel mkl v10 64 bit,sequential code, lp64 model),
## Intel( older versions of mkl 32 and 64 bit), ## Intel( older versions of mkl 32 and 64 bit),
...@@ -330,11 +330,9 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread) ...@@ -330,11 +330,9 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
if(_libraries_work) if(_libraries_work)
set(${LIBRARIES} ${${LIBRARIES}} ${_thread}) set(${LIBRARIES} ${${LIBRARIES}} ${_thread})
else(_libraries_work) else(_libraries_work)
set(${LIBRARIES} FALSE) set(${LIBRARIES} FALSE)
endif(_libraries_work) endif(_libraries_work)
# message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
endmacro(Check_Fortran_Libraries) endmacro(Check_Fortran_Libraries)
...@@ -707,6 +705,14 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") ...@@ -707,6 +705,14 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(NOT BLAS_FIND_QUIETLY)
if(${_LIBRARIES})
message(STATUS "Looking for MKL BLAS: found")
else()
message(STATUS "Looking for MKL BLAS: not found")
endif()
endif()
endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
...@@ -722,6 +728,13 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") ...@@ -722,6 +728,13 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
"goto2" "goto2"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for Goto BLAS: found")
else()
message(STATUS "Looking for Goto BLAS: not found")
endif()
endif()
endif() endif()
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
...@@ -740,6 +753,13 @@ if (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All") ...@@ -740,6 +753,13 @@ if (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
"openblas" "openblas"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for Open BLAS: found")
else()
message(STATUS "Looking for Open BLAS: not found")
endif()
endif()
endif() endif()
endif (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
...@@ -758,6 +778,13 @@ if (BLA_VENDOR STREQUAL "Eigen" OR BLA_VENDOR STREQUAL "All") ...@@ -758,6 +778,13 @@ if (BLA_VENDOR STREQUAL "Eigen" OR BLA_VENDOR STREQUAL "All")
"eigen_blas" "eigen_blas"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for Eigen BLAS: found")
else()
message(STATUS "Looking for Eigen BLAS: not found")
endif()
endif()
endif() endif()
if(NOT BLAS_LIBRARIES) if(NOT BLAS_LIBRARIES)
...@@ -770,6 +797,13 @@ if (BLA_VENDOR STREQUAL "Eigen" OR BLA_VENDOR STREQUAL "All") ...@@ -770,6 +797,13 @@ if (BLA_VENDOR STREQUAL "Eigen" OR BLA_VENDOR STREQUAL "All")
"eigen_blas_static" "eigen_blas_static"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for Eigen BLAS: found")
else()
message(STATUS "Looking for Eigen BLAS: not found")
endif()
endif()
endif() endif()
endif (BLA_VENDOR STREQUAL "Eigen" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "Eigen" OR BLA_VENDOR STREQUAL "All")
...@@ -787,6 +821,13 @@ if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All") ...@@ -787,6 +821,13 @@ if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
"f77blas;atlas" "f77blas;atlas"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for Atlas BLAS: found")
else()
message(STATUS "Looking for Atlas BLAS: not found")
endif()
endif()
endif() endif()
endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
...@@ -804,6 +845,13 @@ if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All") ...@@ -804,6 +845,13 @@ if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
"sgemm;dgemm;blas" "sgemm;dgemm;blas"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for PhiPACK BLAS: found")
else()
message(STATUS "Looking for PhiPACK BLAS: not found")
endif()
endif()
endif() endif()
endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
...@@ -821,6 +869,13 @@ if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All") ...@@ -821,6 +869,13 @@ if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
"cxml" "cxml"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for CXML BLAS: found")
else()
message(STATUS "Looking for CXML BLAS: not found")
endif()
endif()
endif() endif()
endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
...@@ -838,6 +893,13 @@ if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All") ...@@ -838,6 +893,13 @@ if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
"dxml" "dxml"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for DXML BLAS: found")
else()
message(STATUS "Looking for DXML BLAS: not found")
endif()
endif()
endif() endif()
endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
...@@ -858,6 +920,13 @@ if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All") ...@@ -858,6 +920,13 @@ if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
if(BLAS_LIBRARIES) if(BLAS_LIBRARIES)
set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf") set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf")
endif() endif()
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for SunPerf BLAS: found")
else()
message(STATUS "Looking for SunPerf BLAS: not found")
endif()
endif()
endif() endif()
endif () endif ()
...@@ -875,6 +944,13 @@ if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All") ...@@ -875,6 +944,13 @@ if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
"scsl" "scsl"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for SCSL BLAS: found")
else()
message(STATUS "Looking for SCSL BLAS: not found")
endif()
endif()
endif() endif()
endif () endif ()
...@@ -892,12 +968,19 @@ if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All") ...@@ -892,12 +968,19 @@ if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
"complib.sgimath" "complib.sgimath"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for SGIMATH BLAS: found")
else()
message(STATUS "Looking for SGIMATH BLAS: not found")
endif()
endif()
endif() endif()
endif () endif ()
# BLAS in IBM ESSL library? (requires generic BLAS lib, too) # BLAS in IBM ESSL library (requires generic BLAS lib, too)
if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES) if(NOT BLAS_LIBRARIES)
...@@ -906,9 +989,39 @@ if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All") ...@@ -906,9 +989,39 @@ if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
BLAS BLAS
sgemm sgemm
"" ""
"essl" "essl;xlfmath;xlf90_r;blas"
""
)
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for IBM ESSL BLAS: found")
else()
message(STATUS "Looking for IBM ESSL BLAS: not found")
endif()
endif()
endif()
endif ()
# BLAS in IBM ESSL_MT library (requires generic BLAS lib, too)
if (BLA_VENDOR STREQUAL "IBMESSLMT" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"esslsmp;xlsmp;xlfmath;xlf90_r;blas"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for IBM ESSL MT BLAS: found")
else()
message(STATUS "Looking for IBM ESSL MT BLAS: not found")
endif()
endif()
endif() endif()
endif () endif ()
...@@ -1035,6 +1148,13 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") ...@@ -1035,6 +1148,13 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
"acml;acml_mv" "acml;acml_mv"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for ACML BLAS: found")
else()
message(STATUS "Looking for ACML BLAS: not found")
endif()
endif()
endif() endif()
if(NOT BLAS_LIBRARIES) if(NOT BLAS_LIBRARIES)
...@@ -1046,6 +1166,13 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") ...@@ -1046,6 +1166,13 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
"acml_mp;acml_mv" "acml_mp;acml_mv"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for ACML BLAS: found")
else()
message(STATUS "Looking for ACML BLAS: not found")
endif()
endif()
endif() endif()
if(NOT BLAS_LIBRARIES) if(NOT BLAS_LIBRARIES)
...@@ -1057,6 +1184,13 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") ...@@ -1057,6 +1184,13 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
"acml;acml_mv;CALBLAS" "acml;acml_mv;CALBLAS"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for ACML BLAS: found")
else()
message(STATUS "Looking for ACML BLAS: not found")
endif()
endif()
endif() endif()
endif (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") # ACML endif (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") # ACML
...@@ -1074,6 +1208,13 @@ if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") ...@@ -1074,6 +1208,13 @@ if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
"Accelerate" "Accelerate"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for Apple BLAS: found")
else()
message(STATUS "Looking for Apple BLAS: not found")
endif()
endif()
endif() endif()
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
...@@ -1090,8 +1231,16 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") ...@@ -1090,8 +1231,16 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
"vecLib" "vecLib"
"" ""
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for NAS BLAS: found")
else()
message(STATUS "Looking for NAS BLAS: not found")
endif()
endif()
endif () endif ()
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
...@@ -1110,6 +1259,13 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All") ...@@ -1110,6 +1259,13 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
"${SEARCH_LIB}" "${SEARCH_LIB}"
"${LGFORTRAN}" "${LGFORTRAN}"
) )
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
message(STATUS "Looking for Generic BLAS: found")
else()
message(STATUS "Looking for Generic BLAS: not found")
endif()
endif()
endif() endif()
endforeach () endforeach ()
......
...@@ -43,13 +43,25 @@ ...@@ -43,13 +43,25 @@
# add a cache variable to let the user specify the BLAS vendor # add a cache variable to let the user specify the BLAS vendor
set(BLA_VENDOR "" CACHE STRING "list of possible BLAS vendor: set(BLA_VENDOR "" CACHE STRING "list of possible BLAS vendor:
Open, Eigen, Goto, ATLAS PhiPACK, CXML, DXML, SunPerf, SCSL, SGIMATH, IBMESSL, Open, Eigen, Goto, ATLAS PhiPACK, CXML, DXML, SunPerf, SCSL, SGIMATH, IBMESSL, IBMESSLMT,
Intel10_32 (intel mkl v10 32 bit), Intel10_32 (intel mkl v10 32 bit),
Intel10_64lp (intel mkl v10 64 bit, lp thread model, lp64 model), Intel10_64lp (intel mkl v10 64 bit, lp thread model, lp64 model),
Intel10_64lp_seq (intel mkl v10 64 bit, sequential code, lp64 model), Intel10_64lp_seq (intel mkl v10 64 bit, sequential code, lp64 model),
Intel( older versions of mkl 32 and 64 bit), Intel( older versions of mkl 32 and 64 bit),
ACML, ACML_MP, ACML_GPU, Apple, NAS, Generic") ACML, ACML_MP, ACML_GPU, Apple, NAS, Generic")
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "In FindBLASEXT")
message(STATUS "If you want to force the use of one specific library, "
"please specify the BLAS vendor by setting -DBLA_VENDOR=blas_vendor_name"
"at cmake configure.")
message(STATUS "List of possible BLAS vendor: Goto, ATLAS PhiPACK, CXML, "
"DXML, SunPerf, SCSL, SGIMATH, IBMESSL, IBMESSLMT, Intel10_32 (intel mkl v10 32 bit),"
"Intel10_64lp (intel mkl v10 64 bit, lp thread model, lp64 model),"
"Intel10_64lp_seq (intel mkl v10 64 bit, sequential code, lp64 model),"
"Intel( older versions of mkl 32 and 64 bit),"
"ACML, ACML_MP, ACML_GPU, Apple, NAS, Generic")
endif()
if (NOT BLAS_FOUND) if (NOT BLAS_FOUND)
# First try to detect two cases: # First try to detect two cases:
...@@ -75,34 +87,24 @@ if(BLA_VENDOR STREQUAL "All" AND ...@@ -75,34 +87,24 @@ if(BLA_VENDOR STREQUAL "All" AND
endif() endif()
if(NOT BLASEXT_FIND_QUIETLY) if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "A BLAS library has been found (${BLAS_LIBRARIES}) but we" message(STATUS "A BLAS library has been found (${BLAS_LIBRARIES}) but we"
"have also potentially detected some BLAS libraries from the MKL." "have also potentially detected some multithreaded BLAS libraries from the MKL."
"We try to use this one.") "We try to find both libraries lists (Sequential/Multithreaded).")
message(STATUS "If you want to force the use of one specific library, "
"please specify the BLAS vendor by setting -DBLA_VENDOR=blas_vendor_name"
"at cmake configure.")
message(STATUS "List of possible BLAS vendor: Goto, ATLAS PhiPACK, CXML, "
"DXML, SunPerf, SCSL, SGIMATH, IBMESSL, Intel10_32 (intel mkl v10 32 bit),"
"Intel10_64lp (intel mkl v10 64 bit, lp thread model, lp64 model),"
"Intel10_64lp_seq (intel mkl v10 64 bit, sequential code, lp64 model),"
"Intel( older versions of mkl 32 and 64 bit),"
"ACML, ACML_MP, ACML_GPU, Apple, NAS, Generic")
endif() endif()
set(BLAS_FOUND "") set(BLAS_FOUND "")
elseif(BLA_VENDOR STREQUAL "All" AND BLAS_acml_LIBRARY) elseif(BLA_VENDOR STREQUAL "All" AND BLAS_acml_LIBRARY)
set(BLA_VENDOR "ACML") set(BLA_VENDOR "ACML")
if(NOT BLASEXT_FIND_QUIETLY) if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "A BLAS library has been found (${BLAS_LIBRARIES}) but we" message(STATUS "A BLAS library has been found (${BLAS_LIBRARIES}) but we"
"have also potentially detected some BLAS libraries from the ACML." "have also potentially detected some multithreaded BLAS libraries from the ACML."
"We try to use this one.") "We try to find both libraries lists (Sequential/Multithreaded).")
message(STATUS "If you want to force the use of one specific library, " endif()
"please specify the BLAS vendor by setting -DBLA_VENDOR=blas_vendor_name" set(BLAS_FOUND "")
"at cmake configure.") elseif(BLA_VENDOR STREQUAL "All" AND BLAS_essl_LIBRARY)
message(STATUS "List of possible BLAS vendor: Goto, ATLAS PhiPACK, CXML, " set(BLA_VENDOR "IBMESSL")
"DXML, SunPerf, SCSL, SGIMATH, IBMESSL, Intel10_32 (intel mkl v10 32 bit)," if(NOT BLASEXT_FIND_QUIETLY)
"Intel10_64lp (intel mkl v10 64 bit, lp thread model, lp64 model)," message(STATUS "A BLAS library has been found (${BLAS_LIBRARIES}) but we"
"Intel10_64lp_seq (intel mkl v10 64 bit, sequential code, lp64 model)," "have also potentially detected some multithreaded BLAS libraries from the ESSL."
"Intel( older versions of mkl 32 and 64 bit)," "We try to find both libraries lists (Sequential/Multithreaded).")
"ACML, ACML_MP, ACML_GPU, Apple, NAS, Generic")
endif() endif()
set(BLAS_FOUND "") set(BLAS_FOUND "")
endif() endif()
...@@ -238,6 +240,35 @@ elseif(BLA_VENDOR MATCHES "ACML*") ...@@ -238,6 +240,35 @@ elseif(BLA_VENDOR MATCHES "ACML*")
set(BLAS_PAR_LIBRARIES "${BLAS_PAR_LIBRARIES-NOTFOUND}") set(BLAS_PAR_LIBRARIES "${BLAS_PAR_LIBRARIES-NOTFOUND}")
endif() endif()
# IBMESSL case
elseif(BLA_VENDOR MATCHES "IBMESSL*")
## look for the sequential version
set(BLA_VENDOR "IBMESSL")
if(BLASEXT_FIND_REQUIRED)
find_package(BLAS REQUIRED)
else()
find_package(BLAS)
endif()
if(BLAS_FOUND)
set(BLAS_SEQ_LIBRARIES "${BLAS_LIBRARIES}")
else()
set(BLAS_SEQ_LIBRARIES "${BLAS_SEQ_LIBRARIES-NOTFOUND}")
endif()
## look for the multithreaded version
set(BLA_VENDOR "IBMESSLMT")
if(BLASEXT_FIND_REQUIRED)
find_package(BLAS REQUIRED)
else(BLAS_FOUND)
find_package(BLAS)
endif()
if(BLAS_FOUND)
set(BLAS_PAR_LIBRARIES "${BLAS_LIBRARIES}")
else()
set(BLAS_PAR_LIBRARIES "${BLAS_PAR_LIBRARIES-NOTFOUND}")
endif()
else() else()
if(BLAS_FOUND) if(BLAS_FOUND)
...@@ -254,7 +285,6 @@ endif() ...@@ -254,7 +285,6 @@ endif()
if(BLAS_SEQ_LIBRARIES) if(BLAS_SEQ_LIBRARIES)
set(BLAS_LIBRARIES "${BLAS_SEQ_LIBRARIES}") set(BLAS_LIBRARIES "${BLAS_SEQ_LIBRARIES}")
endif() endif()
# message("DEBUG BLAS: ${BLAS_SEQ_LIBRARIES} ${BLAS_LIBRARIES}")
# extract libs paths # extract libs paths
# remark: because it is not given by find_package(BLAS) # remark: because it is not given by find_package(BLAS)
...@@ -275,15 +305,6 @@ if (BLAS_LIBRARY_DIRS) ...@@ -275,15 +305,6 @@ if (BLAS_LIBRARY_DIRS)
list(REMOVE_DUPLICATES BLAS_LIBRARY_DIRS) list(REMOVE_DUPLICATES BLAS_LIBRARY_DIRS)
endif () endif ()
# message(STATUS "BLAS_FOUND: ${BLAS_FOUND}")
# message(STATUS "BLA_VENDOR: ${BLA_VENDOR}")
# message(STATUS "BLAS_LIBRARIES: ${BLAS_LIBRARIES}")
# message(STATUS "BLAS_SEQ_LIBRARIES: ${BLAS_SEQ_LIBRARIES}")
# message(STATUS "BLAS_PAR_LIBRARIES: ${BLAS_PAR_LIBRARIES}")
# message(STATUS "BLAS_INCLUDE_DIRS: ${BLAS_INCLUDE_DIRS}")
# message(STATUS "BLAS_LIBRARY_DIRS: ${BLAS_LIBRARY_DIRS}")
# check that BLAS has been found # check that BLAS has been found
# --------------------------------- # ---------------------------------
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
...@@ -324,8 +345,24 @@ elseif(BLA_VENDOR MATCHES "ACML*") ...@@ -324,8 +345,24 @@ elseif(BLA_VENDOR MATCHES "ACML*")
endif() endif()
find_package_handle_standard_args(BLAS DEFAULT_MSG find_package_handle_standard_args(BLAS DEFAULT_MSG
BLAS_SEQ_LIBRARIES BLAS_SEQ_LIBRARIES
BLAS_LIBRARY_DIRS BLAS_LIBRARY_DIRS)
BLAS_INCLUDE_DIRS) if(BLAS_PAR_LIBRARIES)
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES")
endif()
find_package_handle_standard_args(BLAS DEFAULT_MSG
BLAS_PAR_LIBRARIES)
endif()
elseif(BLA_VENDOR MATCHES "IBMESSL*")
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS found is ESSL:"
"we manage two lists of libs,"
" one sequential and one parallel if found (see BLAS_SEQ_LIBRARIES and BLAS_PAR_LIBRARIES)")
message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES")
endif()
find_package_handle_standard_args(BLAS DEFAULT_MSG
BLAS_SEQ_LIBRARIES
BLAS_LIBRARY_DIRS)
if(BLAS_PAR_LIBRARIES) if(BLAS_PAR_LIBRARIES)
if(NOT BLASEXT_FIND_QUIETLY) if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES") message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES")
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
# environment variable # environment variable
# Note that if BLAS_DIR is set, it will also look for lapack in it # Note that if BLAS_DIR is set, it will also look for lapack in it
### List of vendors (BLA_VENDOR) valid in this module ### List of vendors (BLA_VENDOR) valid in this module
## Intel(mkl), ACML,Apple, NAS, Generic ## Intel(mkl), ACML, Apple, NAS, Generic
#============================================================================= #=============================================================================
# Copyright 2007-2009 Kitware, Inc. # Copyright 2007-2009 Kitware, Inc.
...@@ -347,6 +347,7 @@ endif() ...@@ -347,6 +347,7 @@ endif()
#intel lapack #intel lapack
if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_PACKAGE(Threads) find_PACKAGE(Threads)
...@@ -391,7 +392,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") ...@@ -391,7 +392,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if (NOT ${_LIBRARIES}) if (NOT ${_LIBRARIES})
check_lapack_libraries( check_lapack_libraries(
${_LIBRARIES} ${_LIBRARIES}
BLAS LAPACK
${LAPACK_mkl_SEARCH_SYMBOL} ${LAPACK_mkl_SEARCH_SYMBOL}
"${additional_flags}" "${additional_flags}"
"" ""
...@@ -407,7 +408,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") ...@@ -407,7 +408,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if (NOT ${_LIBRARIES}) if (NOT ${_LIBRARIES})
check_lapack_libraries( check_lapack_libraries(
${_LIBRARIES} ${_LIBRARIES}
BLAS LAPACK
${LAPACK_mkl_SEARCH_SYMBOL} ${LAPACK_mkl_SEARCH_SYMBOL}
"${additional_flags}" "${additional_flags}"
"${IT}" "${IT}"
...@@ -419,6 +420,13 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") ...@@ -419,6 +420,13 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
endif() endif()
endif () endif ()
endforeach () endforeach ()
if(NOT LAPACK_FIND_QUIETLY)
if(${_LIBRARIES})
message(STATUS "Looking for MKL LAPACK: found")
else()
message(STATUS "Looking for MKL LAPACK: not found")
endif()
endif()
endif () endif ()
endif() endif()
...@@ -434,16 +442,73 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") ...@@ -434,16 +442,73 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
"${BLAS_LIBRARIES}" "${BLAS_LIBRARIES}"
"" ""
) )
if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES)
message(STATUS "Looking for Goto LAPACK: found")
else()
message(STATUS "Looking for Goto LAPACK: not found")
endif()
endif()
endif(NOT LAPACK_LIBRARIES) endif(NOT LAPACK_LIBRARIES)
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
# LAPACK in IBM ESSL library (requires generic lapack lib, too)
if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES)
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
cheevd
""
"essl;lapack"
"${BLAS_LIBRARIES}"
""
)
if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES)
message(STATUS "Looking for IBM ESSL LAPACK: found")
else()
message(STATUS "Looking for IBM ESSL LAPACK: not found")
endif()
endif()
endif()
endif ()
# LAPACK in IBM ESSL_MT library (requires generic lapack lib, too)
if (BLA_VENDOR STREQUAL "IBMESSLMT" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES)
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
cheevd
""
"esslsmp;lapack"
"${BLAS_PAR_LIBRARIES}"
""
)
if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES)
message(STATUS "Looking for IBM ESSL MT LAPACK: found")
else()
message(STATUS "Looking for IBM ESSL MT LAPACK: not found")
endif()
endif()
endif()
endif ()
#acml lapack #acml lapack
if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
if (BLAS_LIBRARIES MATCHES ".+acml.+") if (BLAS_LIBRARIES MATCHES ".+acml.+")
set (LAPACK_LIBRARIES ${BLAS_LIBRARIES}) set (LAPACK_LIBRARIES ${BLAS_LIBRARIES})
if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES)
message(STATUS "Looking for ACML LAPACK: found")
else()
message(STATUS "Looking for ACML LAPACK: not found")
endif()
endif()
endif () endif ()
endif () endif ()
# Apple LAPACK library? # Apple LAPACK library?
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
...@@ -457,8 +522,16 @@ if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") ...@@ -457,8 +522,16 @@ if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
"${BLAS_LIBRARIES}" "${BLAS_LIBRARIES}"
"" ""
) )
if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES)
message(STATUS "Looking for Apple Accelerate LAPACK: found")
else()
message(STATUS "Looking for Apple Accelerate LAPACK: not found")
endif()
endif()
endif(NOT LAPACK_LIBRARIES) endif(NOT LAPACK_LIBRARIES)
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
if ( NOT LAPACK_LIBRARIES ) if ( NOT LAPACK_LIBRARIES )
check_lapack_libraries( check_lapack_libraries(
...@@ -470,8 +543,16 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") ...@@ -470,8 +543,16 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
"${BLAS_LIBRARIES}" "${BLAS_LIBRARIES}"
"" ""
) )
if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES)
message(STATUS "Looking for NAS LAPACK: found")
else()
message(STATUS "Looking for NAS LAPACK: not found")
endif()
endif()
endif ( NOT LAPACK_LIBRARIES ) endif ( NOT LAPACK_LIBRARIES )
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
# Generic LAPACK library? # Generic LAPACK library?
if (BLA_VENDOR STREQUAL "Generic" OR if (BLA_VENDOR STREQUAL "Generic" OR
BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "ATLAS" OR
...@@ -486,6 +567,13 @@ if (BLA_VENDOR STREQUAL "Generic" OR ...@@ -486,6 +567,13 @@ if (BLA_VENDOR STREQUAL "Generic" OR
"${BLAS_LIBRARIES};${LM}" "${BLAS_LIBRARIES};${LM}"
"" ""
) )
if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES)
message(STATUS "Looking for Generic LAPACK: found")
else()
message(STATUS "Looking for Generic LAPACK: not found")
endif()
endif()
endif ( NOT LAPACK_LIBRARIES ) endif ( NOT LAPACK_LIBRARIES )
endif () endif ()
else(BLAS_FOUND) else(BLAS_FOUND)
......
...@@ -13,10 +13,8 @@ ...@@ -13,10 +13,8 @@
# This module allows to find LAPACK libraries by calling the official FindLAPACK module # This module allows to find LAPACK libraries by calling the official FindLAPACK module
# and handles the creation of different library lists whether the user wishes to link # and handles the creation of different library lists whether the user wishes to link
# with a sequential LAPACK or a multihreaded (LAPACK_SEQ_LIBRARIES and LAPACK_PAR_LIBRARIES). # with a sequential LAPACK or a multihreaded (LAPACK_SEQ_LIBRARIES and LAPACK_PAR_LIBRARIES).
# LAPACK is detected with a FindLAPACK call then if the LAPACK vendor is in the following list, # LAPACK is detected with a FindLAPACK call and if the BLAS vendor is in the following list,
# Intel mkl, Goto, Openlapack, ACML, IBMESSL # Intel mkl, ACML then the module tries find the corresponding multithreaded libraries
# then the module tries find the corresponding multithreaded libraries
# LAPACK_LIBRARIES does not exists anymore.
# #
# The following variables have been added to manage links with sequential or multithreaded # The following variables have been added to manage links with sequential or multithreaded
# versions: # versions:
...@@ -54,6 +52,7 @@ if (NOT BLAS_FOUND) ...@@ -54,6 +52,7 @@ if (NOT BLAS_FOUND)
endif() endif()
endif () endif ()
message(STATUS "In FindLAPACKEXT")
if(BLA_VENDOR MATCHES "Intel*") if(BLA_VENDOR MATCHES "Intel*")
...@@ -145,6 +144,42 @@ if(BLA_VENDOR MATCHES "Intel*") ...@@ -145,6 +144,42 @@ if(BLA_VENDOR MATCHES "Intel*")
endif() endif()
endif() endif()
elseif(BLA_VENDOR MATCHES "IBMESSL*")
## look for the sequential version
set(BLA_VENDOR "IBMESSL")
if(LAPACKEXT_FIND_REQUIRED)
find_package(LAPACK REQUIRED)
else()
find_package(LAPACK)
endif()
if (LAPACK_FOUND)
if(LAPACK_LIBRARIES)
set(LAPACK_SEQ_LIBRARIES "${LAPACK_LIBRARIES}")
else()
set(LAPACK_SEQ_LIBRARIES "${LAPACK_SEQ_LIBRARIES-NOTFOUND}")
endif()
endif()
## look for the multithreaded version
set(BLA_VENDOR "IBMESSLMT")
if(LAPACKEXT_FIND_REQUIRED)
find_package(LAPACK REQUIRED)
else()
find_package(LAPACK)
endif()
if (LAPACK_FOUND)
if(LAPACK_LIBRARIES)
set(LAPACK_PAR_LIBRARIES "${LAPACK_LIBRARIES}")
else()
set(LAPACK_PAR_LIBRARIES "${LAPACK_PAR_LIBRARIES-NOTFOUND}")
endif()
endif()
elseif(BLA_VENDOR MATCHES "ACML*") elseif(BLA_VENDOR MATCHES "ACML*")
### ###
...@@ -228,14 +263,6 @@ if (LAPACK_LIBRARY_DIRS) ...@@ -228,14 +263,6 @@ if (LAPACK_LIBRARY_DIRS)
endif () endif ()
# message(STATUS "LAPACK_FOUND: ${LAPACK_FOUND}")
# message(STATUS "LAPACK_VENDOR: ${LAPACK_VENDOR}")
# message(STATUS "LAPACK_LIBRARIES: ${LAPACK_LIBRARIES}")
# message(STATUS "LAPACK_SEQ_LIBRARIES: ${LAPACK_SEQ_LIBRARIES}")
# message(STATUS "LAPACK_PAR_LIBRARIES: ${LAPACK_PAR_LIBRARIES}")
# message(STATUS "LAPACK_INCLUDE_DIRS: ${LAPACK_INCLUDE_DIRS}")
# message(STATUS "LAPACK_LIBRARY_DIRS: ${LAPACK_LIBRARY_DIRS}")
# check that LAPACK has been found # check that LAPACK has been found
# --------------------------------- # ---------------------------------
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
...@@ -283,8 +310,27 @@ elseif(BLA_VENDOR MATCHES "ACML*") ...@@ -283,8 +310,27 @@ elseif(BLA_VENDOR MATCHES "ACML*")
endif() endif()
find_package_handle_standard_args(LAPACK DEFAULT_MSG find_package_handle_standard_args(LAPACK DEFAULT_MSG
LAPACK_SEQ_LIBRARIES LAPACK_SEQ_LIBRARIES
LAPACK_LIBRARY_DIRS LAPACK_LIBRARY_DIRS)
LAPACK_INCLUDE_DIRS) if(LAPACK_PAR_LIBRARIES)
if(NOT LAPACKEXT_FIND_QUIETLY)
message(STATUS "LAPACK parallel libraries stored in"
"LAPACK_PAR_LIBRARIES")
endif()
find_package_handle_standard_args(LAPACK DEFAULT_MSG
LAPACK_PAR_LIBRARIES)
endif()
elseif(BLA_VENDOR MATCHES "IBMESSL*")
if(NOT LAPACKEXT_FIND_QUIETLY)
message(STATUS "LAPACK found is IBMESSL:"
"we manage two lists of libs,"
" one sequential and one parallel (see"
"LAPACK_SEQ_LIBRARIES and LAPACK_PAR_LIBRARIES)")
message(STATUS "LAPACK sequential libraries stored in"
"LAPACK_SEQ_LIBRARIES")
endif()
find_package_handle_standard_args(LAPACK DEFAULT_MSG
LAPACK_SEQ_LIBRARIES
LAPACK_LIBRARY_DIRS)
if(LAPACK_PAR_LIBRARIES) if(LAPACK_PAR_LIBRARIES)
if(NOT LAPACKEXT_FIND_QUIETLY) if(NOT LAPACKEXT_FIND_QUIETLY)
message(STATUS "LAPACK parallel libraries stored in" message(STATUS "LAPACK parallel libraries stored in"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment