Commit 26c7431b authored by PRUVOST Florent's avatar PRUVOST Florent

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

parent cb6f7883
This diff is collapsed.
......@@ -43,13 +43,25 @@
# add a cache variable to let the user specify the 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_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")
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)
# First try to detect two cases:
......@@ -75,34 +87,24 @@ if(BLA_VENDOR STREQUAL "All" AND
endif()
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "A BLAS library has been found (${BLAS_LIBRARIES}) but we"
"have also potentially detected some BLAS libraries from the MKL."
"We try to use this one.")
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")
"have also potentially detected some multithreaded BLAS libraries from the MKL."
"We try to find both libraries lists (Sequential/Multithreaded).")
endif()
set(BLAS_FOUND "")
elseif(BLA_VENDOR STREQUAL "All" AND BLAS_acml_LIBRARY)
set(BLA_VENDOR "ACML")
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "A BLAS library has been found (${BLAS_LIBRARIES}) but we"
"have also potentially detected some BLAS libraries from the ACML."
"We try to use this one.")
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")
"have also potentially detected some multithreaded BLAS libraries from the ACML."
"We try to find both libraries lists (Sequential/Multithreaded).")
endif()
set(BLAS_FOUND "")
elseif(BLA_VENDOR STREQUAL "All" AND BLAS_essl_LIBRARY)
set(BLA_VENDOR "IBMESSL")
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "A BLAS library has been found (${BLAS_LIBRARIES}) but we"
"have also potentially detected some multithreaded BLAS libraries from the ESSL."
"We try to find both libraries lists (Sequential/Multithreaded).")
endif()
set(BLAS_FOUND "")
endif()
......@@ -238,6 +240,35 @@ elseif(BLA_VENDOR MATCHES "ACML*")
set(BLAS_PAR_LIBRARIES "${BLAS_PAR_LIBRARIES-NOTFOUND}")
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()
if(BLAS_FOUND)
......@@ -254,7 +285,6 @@ endif()
if(BLAS_SEQ_LIBRARIES)
set(BLAS_LIBRARIES "${BLAS_SEQ_LIBRARIES}")
endif()
# message("DEBUG BLAS: ${BLAS_SEQ_LIBRARIES} ${BLAS_LIBRARIES}")
# extract libs paths
# remark: because it is not given by find_package(BLAS)
......@@ -275,15 +305,6 @@ if (BLAS_LIBRARY_DIRS)
list(REMOVE_DUPLICATES BLAS_LIBRARY_DIRS)
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
# ---------------------------------
include(FindPackageHandleStandardArgs)
......@@ -324,8 +345,24 @@ elseif(BLA_VENDOR MATCHES "ACML*")
endif()
find_package_handle_standard_args(BLAS DEFAULT_MSG
BLAS_SEQ_LIBRARIES
BLAS_LIBRARY_DIRS
BLAS_INCLUDE_DIRS)
BLAS_LIBRARY_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(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES")
......
......@@ -41,7 +41,7 @@
# environment variable
# Note that if BLAS_DIR is set, it will also look for lapack in it
### 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.
......@@ -347,6 +347,7 @@ endif()
#intel lapack
if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_PACKAGE(Threads)
......@@ -391,7 +392,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if (NOT ${_LIBRARIES})
check_lapack_libraries(
${_LIBRARIES}
BLAS
LAPACK
${LAPACK_mkl_SEARCH_SYMBOL}
"${additional_flags}"
""
......@@ -407,7 +408,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if (NOT ${_LIBRARIES})
check_lapack_libraries(
${_LIBRARIES}
BLAS
LAPACK
${LAPACK_mkl_SEARCH_SYMBOL}
"${additional_flags}"
"${IT}"
......@@ -419,6 +420,13 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
endif()
endif ()
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()
......@@ -434,16 +442,73 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
"${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 (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
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.+")
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 ()
# Apple LAPACK library?
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}"
""
)
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 (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
if ( NOT LAPACK_LIBRARIES )
check_lapack_libraries(
......@@ -470,8 +543,16 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
"${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 (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
# Generic LAPACK library?
if (BLA_VENDOR STREQUAL "Generic" OR
BLA_VENDOR STREQUAL "ATLAS" OR
......@@ -486,6 +567,13 @@ if (BLA_VENDOR STREQUAL "Generic" OR
"${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 ()
else(BLAS_FOUND)
......
......@@ -13,10 +13,8 @@
# 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
# 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,
# Intel mkl, Goto, Openlapack, ACML, IBMESSL
# then the module tries find the corresponding multithreaded libraries
# LAPACK_LIBRARIES does not exists anymore.
# LAPACK is detected with a FindLAPACK call and if the BLAS vendor is in the following list,
# Intel mkl, ACML then the module tries find the corresponding multithreaded libraries
#
# The following variables have been added to manage links with sequential or multithreaded
# versions:
......@@ -54,6 +52,7 @@ if (NOT BLAS_FOUND)
endif()
endif ()
message(STATUS "In FindLAPACKEXT")
if(BLA_VENDOR MATCHES "Intel*")
......@@ -145,6 +144,42 @@ if(BLA_VENDOR MATCHES "Intel*")
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*")
###
......@@ -228,14 +263,6 @@ if (LAPACK_LIBRARY_DIRS)
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
# ---------------------------------
include(FindPackageHandleStandardArgs)
......@@ -283,8 +310,27 @@ elseif(BLA_VENDOR MATCHES "ACML*")
endif()
find_package_handle_standard_args(LAPACK DEFAULT_MSG
LAPACK_SEQ_LIBRARIES
LAPACK_LIBRARY_DIRS
LAPACK_INCLUDE_DIRS)
LAPACK_LIBRARY_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(NOT LAPACKEXT_FIND_QUIETLY)
message(STATUS "LAPACK parallel libraries stored in"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment