parent
34cc537132
commit
4585e573b8
|
@ -23,6 +23,7 @@
|
||||||
##########
|
##########
|
||||||
### List of vendors (BLA_VENDOR) valid in this module
|
### List of vendors (BLA_VENDOR) valid in this module
|
||||||
## 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),
|
## 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
|
## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic
|
||||||
# C/CXX should be enabled to use Intel mkl
|
# C/CXX should be enabled to use Intel mkl
|
||||||
|
|
||||||
|
@ -85,6 +86,7 @@ if (NOT _libdir)
|
||||||
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
|
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
foreach(_library ${_list})
|
foreach(_library ${_list})
|
||||||
set(_combined_name ${_combined_name}_${_library})
|
set(_combined_name ${_combined_name}_${_library})
|
||||||
|
|
||||||
|
@ -115,7 +117,7 @@ foreach(_library ${_list})
|
||||||
endforeach(_library ${_list})
|
endforeach(_library ${_list})
|
||||||
if(_libraries_work)
|
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}} ${_thread})
|
||||||
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
||||||
if (_CHECK_FORTRAN)
|
if (_CHECK_FORTRAN)
|
||||||
check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
|
check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
|
||||||
|
@ -460,117 +462,99 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||||
else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
|
else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
|
endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
|
||||||
if (WIN32)
|
|
||||||
|
set(BLAS_SEARCH_LIBS "")
|
||||||
|
|
||||||
if(BLA_F95)
|
if(BLA_F95)
|
||||||
if(NOT BLAS95_LIBRARIES)
|
set(BLAS_mkl_SEARCH_SYMBOL SGEMM)
|
||||||
check_fortran_libraries(
|
set(_LIBRARIES BLAS95_LIBRARIES)
|
||||||
BLAS95_LIBRARIES
|
if (WIN32)
|
||||||
BLAS
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
sgemm
|
"mkl_blas95 mkl_intel_c mkl_intel_thread mkl_core libguide40")
|
||||||
""
|
else (WIN32)
|
||||||
"mkl_blas95;mkl_intel_c;mkl_intel_thread;mkl_core;libguide40"
|
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
|
||||||
""
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
)
|
"mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide")
|
||||||
endif(NOT BLAS95_LIBRARIES)
|
endif ()
|
||||||
else(BLA_F95)
|
if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
|
||||||
if(NOT BLAS_LIBRARIES)
|
# old version
|
||||||
check_fortran_libraries(
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
BLAS_LIBRARIES
|
"mkl_blas95 mkl_intel_lp64 mkl_intel_thread mkl_core guide")
|
||||||
BLAS
|
|
||||||
SGEMM
|
# mkl >= 10.3
|
||||||
""
|
if (CMAKE_C_COMPILER MATCHES ".+gcc.*")
|
||||||
"mkl_c_dll;mkl_intel_thread_dll;mkl_core_dll;libguide40"
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
""
|
"mkl_blas95_lp64 mkl_intel_lp64 mkl_gnu_thread mkl_core")
|
||||||
)
|
set(LM "${LM};-lgomp")
|
||||||
endif(NOT BLAS_LIBRARIES)
|
else ()
|
||||||
endif(BLA_F95)
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
else(WIN32)
|
"mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core iomp5")
|
||||||
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
|
endif ()
|
||||||
if(BLA_F95)
|
endif ()
|
||||||
if(NOT BLAS95_LIBRARIES)
|
endif (WIN32)
|
||||||
|
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
|
"mkl_blas95_lp64 mkl_intel_lp64 mkl_sequential mkl_core")
|
||||||
|
endif ()
|
||||||
|
else (BLA_F95)
|
||||||
|
set(BLAS_mkl_SEARCH_SYMBOL sgemm)
|
||||||
|
set(_LIBRARIES BLAS_LIBRARIES)
|
||||||
|
if (WIN32)
|
||||||
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
|
"mkl_c_dll mkl_intel_thread_dll mkl_core_dll libguide40")
|
||||||
|
else (WIN32)
|
||||||
|
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
|
"mkl_intel mkl_intel_thread mkl_core guide")
|
||||||
|
endif ()
|
||||||
|
if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
# old version
|
||||||
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
|
"mkl_intel_lp64 mkl_intel_thread mkl_core guide")
|
||||||
|
|
||||||
|
# mkl >= 10.3
|
||||||
|
if (CMAKE_C_COMPILER MATCHES ".+gcc.*")
|
||||||
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
|
"mkl_intel_lp64 mkl_gnu_thread mkl_core")
|
||||||
|
set(LM "${LM};-lgomp")
|
||||||
|
else ()
|
||||||
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
|
"mkl_intel_lp64 mkl_intel_thread mkl_core iomp5")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
#older vesions of intel mkl libs
|
||||||
|
if (BLA_VENDOR STREQUAL "Intel" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
|
"mkl")
|
||||||
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
|
"mkl_ia32")
|
||||||
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
|
"mkl_em64t")
|
||||||
|
endif ()
|
||||||
|
endif (WIN32)
|
||||||
|
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
list(APPEND BLAS_SEARCH_LIBS
|
||||||
|
"mkl_intel_lp64 mkl_sequential mkl_core")
|
||||||
|
endif ()
|
||||||
|
endif (BLA_F95)
|
||||||
|
|
||||||
|
foreach (IT ${BLAS_SEARCH_LIBS})
|
||||||
|
string(REPLACE " " ";" SEARCH_LIBS ${IT})
|
||||||
|
if (${_LIBRARIES})
|
||||||
|
else ()
|
||||||
check_fortran_libraries(
|
check_fortran_libraries(
|
||||||
BLAS95_LIBRARIES
|
${_LIBRARIES}
|
||||||
BLAS
|
BLAS
|
||||||
sgemm
|
${BLAS_mkl_SEARCH_SYMBOL}
|
||||||
""
|
""
|
||||||
"mkl_blas95;mkl_intel;mkl_intel_thread;mkl_core;guide"
|
"${SEARCH_LIBS}"
|
||||||
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||||
)
|
)
|
||||||
endif(NOT BLAS95_LIBRARIES)
|
endif ()
|
||||||
else(BLA_F95)
|
endforeach ()
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"mkl_intel;mkl_intel_thread;mkl_core;guide"
|
|
||||||
"${CMAKE_THREAD_LIBS_INIT}"
|
|
||||||
"${LM}"
|
|
||||||
)
|
|
||||||
endif(NOT BLAS_LIBRARIES)
|
|
||||||
endif(BLA_F95)
|
|
||||||
endif (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
|
|
||||||
if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
|
|
||||||
if(BLA_F95)
|
|
||||||
if(NOT BLAS95_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS95_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"mkl_blas95;mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
|
|
||||||
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
|
||||||
)
|
|
||||||
endif(NOT BLAS95_LIBRARIES)
|
|
||||||
else(BLA_F95)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
|
|
||||||
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
|
||||||
)
|
|
||||||
endif(NOT BLAS_LIBRARIES)
|
|
||||||
endif(BLA_F95)
|
|
||||||
endif (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
|
|
||||||
endif (WIN32)
|
|
||||||
#older vesions of intel mkl libs
|
|
||||||
# BLAS in intel mkl library? (shared)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"mkl;guide"
|
|
||||||
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
|
||||||
)
|
|
||||||
endif(NOT BLAS_LIBRARIES)
|
|
||||||
#BLAS in intel mkl library? (static, 32bit)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"mkl_ia32;guide"
|
|
||||||
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
|
||||||
)
|
|
||||||
endif(NOT BLAS_LIBRARIES)
|
|
||||||
#BLAS in intel mkl library? (static, em64t 64bit)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"mkl_em64t;guide"
|
|
||||||
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
|
||||||
)
|
|
||||||
endif(NOT BLAS_LIBRARIES)
|
|
||||||
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
|
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
|
||||||
endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||||
|
|
||||||
|
|
|
@ -219,40 +219,69 @@ if (BLA_VENDOR STREQUAL "Generic" OR
|
||||||
endif ( NOT LAPACK_LIBRARIES )
|
endif ( NOT LAPACK_LIBRARIES )
|
||||||
endif ()
|
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 (NOT WIN32)
|
||||||
|
set(LM "-lm")
|
||||||
|
endif ()
|
||||||
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)
|
||||||
else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
||||||
if (BLA_F95)
|
if (BLA_F95)
|
||||||
if(NOT LAPACK95_LIBRARIES)
|
if(NOT LAPACK95_LIBRARIES)
|
||||||
check_lapack_libraries(
|
# old
|
||||||
LAPACK95_LIBRARIES
|
check_lapack_libraries(
|
||||||
LAPACK
|
LAPACK95_LIBRARIES
|
||||||
cheev
|
LAPACK
|
||||||
""
|
cheev
|
||||||
"mkl_lapack95"
|
""
|
||||||
"${BLAS95_LIBRARIES}"
|
"mkl_lapack95"
|
||||||
"${CMAKE_THREAD_LIBS_INIT}"
|
"${BLAS95_LIBRARIES}"
|
||||||
)
|
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||||
endif(NOT LAPACK95_LIBRARIES)
|
)
|
||||||
else(BLA_F95)
|
endif(NOT LAPACK95_LIBRARIES)
|
||||||
if(NOT LAPACK_LIBRARIES)
|
if(NOT LAPACK95_LIBRARIES)
|
||||||
check_lapack_libraries(
|
# new >= 10.3
|
||||||
LAPACK_LIBRARIES
|
check_lapack_libraries(
|
||||||
LAPACK
|
LAPACK95_LIBRARIES
|
||||||
cheev
|
LAPACK
|
||||||
""
|
CHEEV
|
||||||
"mkl_lapack"
|
""
|
||||||
"${BLAS_LIBRARIES}"
|
"mkl_intel_lp64"
|
||||||
"${CMAKE_THREAD_LIBS_INIT}"
|
"${BLAS95_LIBRARIES}"
|
||||||
)
|
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||||
endif(NOT LAPACK_LIBRARIES)
|
)
|
||||||
endif(BLA_F95)
|
endif(NOT LAPACK95_LIBRARIES)
|
||||||
|
else(BLA_F95)
|
||||||
|
if(NOT LAPACK_LIBRARIES)
|
||||||
|
# old
|
||||||
|
check_lapack_libraries(
|
||||||
|
LAPACK_LIBRARIES
|
||||||
|
LAPACK
|
||||||
|
cheev
|
||||||
|
""
|
||||||
|
"mkl_lapack"
|
||||||
|
"${BLAS_LIBRARIES}"
|
||||||
|
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||||
|
)
|
||||||
|
endif(NOT LAPACK_LIBRARIES)
|
||||||
|
if(NOT LAPACK_LIBRARIES)
|
||||||
|
# new >= 10.3
|
||||||
|
check_lapack_libraries(
|
||||||
|
LAPACK_LIBRARIES
|
||||||
|
LAPACK
|
||||||
|
cheev
|
||||||
|
""
|
||||||
|
"mkl_gf_lp64"
|
||||||
|
"${BLAS_LIBRARIES}"
|
||||||
|
"${CMAKE_THREAD_LIBS_INIT};${LM}"
|
||||||
|
)
|
||||||
|
endif(NOT LAPACK_LIBRARIES)
|
||||||
|
endif(BLA_F95)
|
||||||
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
|
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
|
||||||
endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
|
||||||
else(BLAS_FOUND)
|
else(BLAS_FOUND)
|
||||||
message(STATUS "LAPACK requires BLAS")
|
message(STATUS "LAPACK requires BLAS")
|
||||||
endif(BLAS_FOUND)
|
endif(BLAS_FOUND)
|
||||||
|
|
Loading…
Reference in New Issue