Commit 8a568012 authored by Quentin Khan's avatar Quentin Khan

Merge branch 'devel' into master

parents 0f9e1cf9 16b3a43f
......@@ -125,10 +125,14 @@ public:
virtual void M2M(CellClass* const FRestrict cell, const CellClass*const FRestrict *const FRestrict children, const int level) {
if(kernel.m2m_full){
std::vector<void *> userCellArray;
for(int i=0 ;i<8 ; ++i){
userCellArray.push_back(children[i]->getContainer());
kernel.m2m_full(level, cell->getContainer(), userCellArray.data(), userData);
for(int idx=0 ;idx<8 ; ++idx){
if( children[idx] ){
userCellArray.push_back(children[idx]->getContainer());
}else{
userCellArray.push_back(nullptr);
}
}
kernel.m2m_full(level, cell->getContainer(), userCellArray.data(), userData);
}else{
if(kernel.m2m){
for(int idx = 0 ; idx < 8 ; ++idx){
......@@ -167,7 +171,11 @@ public:
if(kernel.l2l_full){
std::vector<void *> userCellArray;
for(int i=0 ;i<8 ; ++i){
userCellArray.push_back(children[i]->getContainer());
if(children[i]){
userCellArray.push_back(children[i]->getContainer());
}else{
userCellArray.push_back(nullptr);
}
kernel.l2l_full(level, cell->getContainer(), userCellArray.data(), userData);
}
}else{
......
......@@ -328,9 +328,10 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
# SYMBOL_NAMESPACE "PM_"
# SYMBOLS init testPPM:init)
message(STATUS "CMAKE_CXX_COMPILER_ID STREQUAL ${CMAKE_CXX_COMPILER_ID}")
option( SCALFMM_USE_MKL_AS_BLAS "Set to ON to use MKL CBLAS" OFF )
option( SCALFMM_USE_MKL_AS_BLAS "Set to ON to use MKL BLAS/LAPACK" OFF )
option( SCALFMM_USE_ESSL_AS_BLAS "Set to ON to use ESSL BLAS/LAPACK" OFF )
if( SCALFMM_USE_MKL_AS_BLAS )
set(BLA_VENDOR "Intel10_64lp_seq")
find_package(BLASEXT QUIET) # not REQUIRED
......@@ -338,6 +339,16 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
if (BLAS_LIBRARIES)
set(BLASLAPACK_LIBRARIES ${BLAS_LIBRARIES})
endif()
elseif(SCALFMM_USE_ESSL_AS_BLAS)
set(BLA_VENDOR "IBMESSL")
find_package(BLASEXT QUIET) # not REQUIRED
find_package(LAPACKEXT QUIET) # not REQUIRED
if (LAPACK_LIBRARIES)
set(BLASLAPACK_LIBRARIES "${LAPACK_LIBRARIES}")
endif()
if (BLAS_LIBRARIES)
list(APPEND BLASLAPACK_LIBRARIES ${BLAS_LIBRARIES})
endif()
elseif(SCALFMM_USE_EXTERNAL_BLAS)
message(STATUS "BLAS SET BY EXTERNAL PROGRAM = ${BLAS_LIBRARIES}")
list(APPEND BLASLAPACK_LIBRARIES "${BLAS_LIBRARIES}")
......@@ -352,7 +363,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
list(APPEND BLASLAPACK_LIBRARIES "${BLAS_LIBRARIES}")
endif()
endif()
if(BLAS_FOUND)
set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${BLASLAPACK_LIBRARIES}")
if(BLAS_LIBRARY_DIRS)
......@@ -363,6 +374,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
# the RPATH to be used when installing
list(APPEND CMAKE_INSTALL_RPATH "${LAPACK_LIBRARY_DIRS}")
endif()
message (STATUS "check BLAS Fortran mangling")
# check blas and lapack symbols naming
set(CMAKE_REQUIRED_LIBRARIES "${BLAS_LIBRARIES}")
check_function_exists(dgemv_ DGEMV_ADD_)
......@@ -374,19 +386,19 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
message (STATUS "BLAS dgemv_ symbol found, SCALFMM_BLAS_ADD_ is ON")
else (DGEMV_ADD_)
set (SCALFMM_BLAS_ADD_ OFF)
check_function_exists(DGEMV DGEMV_UPCASE)
if (DGEMV_UPCASE)
set (SCALFMM_BLAS_UPCASE ON)
message (STATUS "BLAS DGEMV symbol found, SCALFMM_BLAS_UPCASE is ON")
else (DGEMV_UPCASE)
# set (SCALFMM_BLAS_UPCASE OFF)
check_function_exists(DGEMV DGEMV_UPCASE)
if (DGEMV_UPCASE)
set (SCALFMM_BLAS_UPCASE ON)
message (STATUS "BLAS DGEMV symbol found, SCALFMM_BLAS_UPCASE is ON")
else (DGEMV_UPCASE)
# set (SCALFMM_BLAS_UPCASE OFF)
check_function_exists(dgemv DGEMV_NOCHANGE)
if (DGEMV_NOCHANGE)
set (SCALFMM_BLAS_NOCHANGE ON)
message (STATUS "BLAS dgemv symbol found, SCALFMM_BLAS_NOCHANGE is ON")
# else (DGEMV_NOCHANGE)
# set (SCALFMM_BLAS_NOCHANGE OFF)
endif (DGEMV_NOCHANGE)
# else (DGEMV_NOCHANGE)
# set (SCALFMM_BLAS_NOCHANGE OFF)
endif (DGEMV_NOCHANGE)
endif (DGEMV_UPCASE)
endif (DGEMV_ADD_)
if ( (NOT DGEMV_ADD_) AND (NOT DGEMV_UPCASE) AND (NOT DGEMV_NOCHANGE) )
......@@ -403,88 +415,59 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
#
# FFT option
#
CMAKE_DEPENDENT_OPTION(SCALFMM_USE_MKL_AS_FFTW "Set to ON to use MKL FFTW" ON "SCALFMM_USE_FFT;SCALFMM_USE_MKL_AS_BLAS" OFF )
CMAKE_DEPENDENT_OPTION(SCALFMM_USE_MKL_AS_FFTW "Set to ON to use MKL FFTW" ON "SCALFMM_USE_FFT;SCALFMM_USE_MKL_AS_BLAS" OFF )
CMAKE_DEPENDENT_OPTION(SCALFMM_USE_ESSL_AS_FFTW "Set to ON to use ESSL FFTW" ON "SCALFMM_USE_FFT;SCALFMM_USE_ESSL_AS_BLAS" OFF )
if( SCALFMM_USE_FFT )
message(STATUS "SCALFMM USE FFT Configure:")
# The package find_package(FFTW) can be used with the following COMPONENTS:
# MKL, ESSL, THREADS|OMP and/or SIMPLE|LONG|QUAD
# Default will find the real double precision fftw library version without THREADS|OMP
if( SCALFMM_USE_MKL_AS_FFTW )
message(STATUS " SCALFMM USE FFT from MKL")
find_package(FFTW COMPONENTS MKL)
elseif (SCALFMM_USE_ESSL_AS_FFTW)
message(STATUS " SCALFMM USE FFT from ESSL ")
find_package(FFTW COMPONENTS ESSL)
add_definitions(-DSCALFMM_USE_ESSL_AS_FFTW)
else()
message(STATUS " SCALFMM USE FFTW")
find_package(FFTW COMPONENTS SIMPLE)
endif()
message(STATUS " SCALFMM USE MKL ")
if( SCALFMM_USE_MKL_AS_BLAS )
unset(FFT_LIBRARIES CACHE)
message(STATUS " SCALFMM USE MKL already defined")
set(FFT_INCLUDES "$ENV{MKLROOT}/include/fftw" CACHE STRING "Set your MKL flags")
if (BLAS_FOUND)
set(FFTW_FOUND ON)
endif()
else(SCALFMM_USE_MKL_AS_BLAS)
# The package can be used with the following COMPONENTS:
# MKL, THREADS|OMP and/or SIMPLE|DOUBLE|LONG|QUAD
# Default is DOUBLE and without THREADS|OMP
find_package(FFTW COMPONENTS MKL) # not REQUIRED
if (FFTW_LIBRARY_DIRS_DEP)
set(FFT_LIBRARIES "-L${FFTW_LIBRARY_DIRS_DEP};" CACHE STRING "Set your MKL flags")
endif()
if (FFTW_LIBRARIES_DEP)
foreach (fft_lib ${FFTW_LIBRARIES_DEP})
set(FFT_LIBRARIES "${FFT_LIBRARIES};${fft_lib};")
endforeach()
endif()
set(FFT_INCLUDES "${FFTW_INCLUDE_DIRS_DEP}" )
if (FFT_LIBRARIES)
set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${FFT_LIBRARIES}")
endif()
endif(SCALFMM_USE_MKL_AS_BLAS)
else(SCALFMM_USE_MKL_AS_FFTW)
message(STATUS " SCALFMM USE FFTW ")
# The package can be used with the following COMPONENTS:
# MKL, THREADS|OMP and/or SIMPLE|DOUBLE|LONG|QUAD
# Default is DOUBLE and without THREADS|OMP
find_package(FFTW COMPONENTS SIMPLE) # not REQUIRED
if (FFTW_LIBRARY_DIRS_DEP)
set(FFT_LIBRARIES "-L${FFTW_LIBRARY_DIRS_DEP};" CACHE STRING "Set your FFTW path")
endif()
if (FFTW_LIBRARIES_DEP)
foreach (fft_lib ${FFTW_LIBRARIES_DEP})
set(FFT_LIBRARIES "${FFT_LIBRARIES};${fft_lib};")
endforeach()
endif()
set(FFT_INCLUDES "${FFTW_INCLUDE_DIRS_DEP}" )
if (FFT_LIBRARIES)
set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${FFT_LIBRARIES}")
endif()
if(FFTW_LIBRARY_DIRS)
# the RPATH to be used when installing
list(APPEND CMAKE_INSTALL_RPATH "${FFTW_LIBRARY_DIRS}")
endif()
if (FFTW_LIBRARY_DIRS_DEP)
set(FFT_LIBRARIES "-L${FFTW_LIBRARY_DIRS_DEP};" CACHE STRING "Set your MKL flags")
endif()
if (FFTW_LIBRARIES_DEP)
foreach (fft_lib ${FFTW_LIBRARIES_DEP})
set(FFT_LIBRARIES "${FFT_LIBRARIES};${fft_lib};")
endforeach()
endif()
endif(SCALFMM_USE_MKL_AS_FFTW)
set(FFT_INCLUDES "${FFTW_INCLUDE_DIRS_DEP}" )
if (FFT_LIBRARIES)
set(SCALFMM_LIBRARIES "${SCALFMM_LIBRARIES};${FFT_LIBRARIES}")
endif()
if(FFTW_LIBRARY_DIRS)
# the RPATH to be used when installing
list(APPEND CMAKE_INSTALL_RPATH "${FFTW_LIBRARY_DIRS}")
endif()
if (FFT_INCLUDES)
set(SCALFMM_INCLUDES "${SCALFMM_INCLUDES}; ${FFT_INCLUDES}")
endif()
if(FFTW_FOUND)
message(STATUS " SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}")
message(STATUS " SCALFMM_INCLUDES = ${SCALFMM_INCLUDES}")
else()
if(NOT FFTW_FOUND)
message(WARNING "FFTW has not been found, SCALFMM will continue to compile but some applications will be disabled.")
message(WARNING "If you have FFTW set FFTW_LIBDIR, FFTW_INCDIR or FFTW_DIR (CMake variables using -D or environment variables).")
set(SCALFMM_USE_FFT OFF)
endif()
endif(SCALFMM_USE_FFT)
list(APPEND FUSE_LIST "FFT")
message(STATUS " SCALFMM_LIBRARIES = ${SCALFMM_LIBRARIES}")
message(STATUS " SCALFMM_INCLUDES = ${SCALFMM_INCLUDES}")
message(STATUS "SCALFMM_USE_FFT = ${SCALFMM_USE_FFT}")
list(REMOVE_DUPLICATES SCALFMM_INCLUDES)
list(REMOVE_DUPLICATES SCALFMM_LIBRARIES)
#
# C++ 2011
......@@ -788,7 +771,7 @@ if (MORSE_DISTRIB_DIR OR EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/morse/
set(SCALFMM_COMPILE_LIBS "")
foreach(lib_var ${SCALFMM_LIBRARIES})
string(STRIP ${lib_var} lib_var)
LIST(APPEND SCALFMM_COMPILE_LIBS ${lib_var})
LIST(APPEND SCALFMM_COMPILE_LIBS ${lib_var})
endforeach()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/Src/ScalFmmConfig.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/Src/ScalFmmConfig.h )
......
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")
......
This diff is collapsed.
......@@ -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"
......
......@@ -38,6 +38,7 @@
#cmakedefine SCALFMM_USE_FFT
#cmakedefine SCALFMM_USE_MKL_AS_FFTW
#cmakedefine SCALFMM_USE_ESSL_AS_FFTW
//////////////////////////////////////////////////////
// MPI
......
......@@ -26,10 +26,11 @@
#include <iostream>
#include <stdlib.h>
// include fftw3 (specify path in cmake)
// if MKL: path/to/mkl/include/fftw/fftw3.h