Mentions légales du service

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

add _DEP lists to CBLAS and LAPACKE

parent ace7c7b0
Branches
No related tags found
No related merge requests found
...@@ -1354,9 +1354,6 @@ if(BLA_F95) ...@@ -1354,9 +1354,6 @@ if(BLA_F95)
set(BLAS_FOUND TRUE) set(BLAS_FOUND TRUE)
set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}") set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
if (NOT BLAS_LIBRARIES_DEP)
set(BLAS_LIBRARIES_DEP "${BLAS95_LIBRARIES}")
endif()
else(BLA_F95) else(BLA_F95)
......
...@@ -114,22 +114,24 @@ if (BLAS_FOUND) ...@@ -114,22 +114,24 @@ if (BLAS_FOUND)
# Check for faster complex GEMM routine # Check for faster complex GEMM routine
# (only C/Z, no S/D version) # (only C/Z, no S/D version)
if ( CBLAS_ZGEMM3M_FOUND ) if ( CBLAS_ZGEMM3M_FOUND )
add_definitions(-DCBLAS_HAS_ZGEMM3M -DCBLAS_HAS_CGEMM3M) add_definitions(-DCBLAS_HAS_ZGEMM3M -DCBLAS_HAS_CGEMM3M)
endif() endif()
if(NOT CBLAS_FIND_QUIETLY) if(NOT CBLAS_FIND_QUIETLY)
message(STATUS "Looking for cblas: test with blas succeeds") message(STATUS "Looking for cblas: test with blas succeeds")
endif() endif()
# test succeeds: CBLAS is in BLAS # test succeeds: CBLAS is in BLAS
set(CBLAS_LIBRARIES "${BLAS_LIBRARIES}") set(CBLAS_LIBRARIES "${BLAS_LIBRARIES}")
set(CBLAS_LIBRARIES_DEP "${BLAS_LIBRARIES}")
if (BLAS_LIBRARY_DIRS) if (BLAS_LIBRARY_DIRS)
set(CBLAS_LIBRARY_DIRS "${BLAS_LIBRARY_DIRS}") set(CBLAS_LIBRARY_DIRS "${BLAS_LIBRARY_DIRS}")
endif() endif()
if(BLAS_INCLUDE_DIRS) if(BLAS_INCLUDE_DIRS)
set(CBLAS_INCLUDE_DIRS "${BLAS_INCLUDE_DIRS}") set(CBLAS_INCLUDE_DIRS "${BLAS_INCLUDE_DIRS}")
set(CBLAS_INCLUDE_DIRS_DEP "${BLAS_INCLUDE_DIRS_DEP}")
endif() endif()
if (BLAS_LINKER_FLAGS) if (BLAS_LINKER_FLAGS)
set(CBLAS_LINKER_FLAGS "${BLAS_LINKER_FLAGS}") set(CBLAS_LINKER_FLAGS "${BLAS_LINKER_FLAGS}")
endif() endif()
endif() endif()
endif (NOT CBLAS_STANDALONE) endif (NOT CBLAS_STANDALONE)
...@@ -160,17 +162,17 @@ if (BLAS_FOUND) ...@@ -160,17 +162,17 @@ if (BLAS_FOUND)
list(APPEND _inc_env "${ENV_CBLAS_DIR}/include/cblas") list(APPEND _inc_env "${ENV_CBLAS_DIR}/include/cblas")
else() else()
if(WIN32) if(WIN32)
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}") string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}")
list(APPEND _inc_env "${_path_env}") list(APPEND _inc_env "${_path_env}")
else() else()
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}") string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}")
list(APPEND _inc_env "${_path_env}") list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{C_INCLUDE_PATH}") string(REPLACE ":" ";" _path_env "$ENV{C_INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}") list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{CPATH}") string(REPLACE ":" ";" _path_env "$ENV{CPATH}")
list(APPEND _inc_env "${_path_env}") list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE_PATH}") string(REPLACE ":" ";" _path_env "$ENV{INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}") list(APPEND _inc_env "${_path_env}")
endif() endif()
endif() endif()
list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}") list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}")
...@@ -184,21 +186,21 @@ if (BLAS_FOUND) ...@@ -184,21 +186,21 @@ if (BLAS_FOUND)
if(CBLAS_INCDIR) if(CBLAS_INCDIR)
set(CBLAS_cblas.h_DIRS "CBLAS_cblas.h_DIRS-NOTFOUND") set(CBLAS_cblas.h_DIRS "CBLAS_cblas.h_DIRS-NOTFOUND")
find_path(CBLAS_cblas.h_DIRS find_path(CBLAS_cblas.h_DIRS
NAMES cblas.h NAMES cblas.h
HINTS ${CBLAS_INCDIR}) HINTS ${CBLAS_INCDIR})
else() else()
if(CBLAS_DIR) if(CBLAS_DIR)
set(CBLAS_cblas.h_DIRS "CBLAS_cblas.h_DIRS-NOTFOUND") set(CBLAS_cblas.h_DIRS "CBLAS_cblas.h_DIRS-NOTFOUND")
find_path(CBLAS_cblas.h_DIRS find_path(CBLAS_cblas.h_DIRS
NAMES cblas.h NAMES cblas.h
HINTS ${CBLAS_DIR} HINTS ${CBLAS_DIR}
PATH_SUFFIXES "include" "include/cblas") PATH_SUFFIXES "include" "include/cblas")
else() else()
set(CBLAS_cblas.h_DIRS "CBLAS_cblas.h_DIRS-NOTFOUND") set(CBLAS_cblas.h_DIRS "CBLAS_cblas.h_DIRS-NOTFOUND")
find_path(CBLAS_cblas.h_DIRS find_path(CBLAS_cblas.h_DIRS
NAMES cblas.h NAMES cblas.h
HINTS ${_inc_env} HINTS ${_inc_env}
PATH_SUFFIXES "cblas") PATH_SUFFIXES "cblas")
endif() endif()
endif() endif()
mark_as_advanced(CBLAS_cblas.h_DIRS) mark_as_advanced(CBLAS_cblas.h_DIRS)
...@@ -210,7 +212,7 @@ if (BLAS_FOUND) ...@@ -210,7 +212,7 @@ if (BLAS_FOUND)
else () else ()
set(CBLAS_INCLUDE_DIRS "CBLAS_INCLUDE_DIRS-NOTFOUND") set(CBLAS_INCLUDE_DIRS "CBLAS_INCLUDE_DIRS-NOTFOUND")
if(NOT CBLAS_FIND_QUIETLY) if(NOT CBLAS_FIND_QUIETLY)
message(STATUS "Looking for cblas -- cblas.h not found") message(STATUS "Looking for cblas -- cblas.h not found")
endif() endif()
endif() endif()
...@@ -229,15 +231,15 @@ if (BLAS_FOUND) ...@@ -229,15 +231,15 @@ if (BLAS_FOUND)
list(APPEND _lib_env "${ENV_CBLAS_DIR}/lib") list(APPEND _lib_env "${ENV_CBLAS_DIR}/lib")
else() else()
if(WIN32) if(WIN32)
string(REPLACE ":" ";" _lib_env "$ENV{LIB}") string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else() else()
if(APPLE) if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}") string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else() else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}") string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif() endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}") list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
endif() endif()
endif() endif()
list(REMOVE_DUPLICATES _lib_env) list(REMOVE_DUPLICATES _lib_env)
...@@ -249,20 +251,20 @@ if (BLAS_FOUND) ...@@ -249,20 +251,20 @@ if (BLAS_FOUND)
if(CBLAS_LIBDIR) if(CBLAS_LIBDIR)
set(CBLAS_cblas_LIBRARY "CBLAS_cblas_LIBRARY-NOTFOUND") set(CBLAS_cblas_LIBRARY "CBLAS_cblas_LIBRARY-NOTFOUND")
find_library(CBLAS_cblas_LIBRARY find_library(CBLAS_cblas_LIBRARY
NAMES cblas NAMES cblas
HINTS ${CBLAS_LIBDIR}) HINTS ${CBLAS_LIBDIR})
else() else()
if(CBLAS_DIR) if(CBLAS_DIR)
set(CBLAS_cblas_LIBRARY "CBLAS_cblas_LIBRARY-NOTFOUND") set(CBLAS_cblas_LIBRARY "CBLAS_cblas_LIBRARY-NOTFOUND")
find_library(CBLAS_cblas_LIBRARY find_library(CBLAS_cblas_LIBRARY
NAMES cblas NAMES cblas
HINTS ${CBLAS_DIR} HINTS ${CBLAS_DIR}
PATH_SUFFIXES lib lib32 lib64) PATH_SUFFIXES lib lib32 lib64)
else() else()
set(CBLAS_cblas_LIBRARY "CBLAS_cblas_LIBRARY-NOTFOUND") set(CBLAS_cblas_LIBRARY "CBLAS_cblas_LIBRARY-NOTFOUND")
find_library(CBLAS_cblas_LIBRARY find_library(CBLAS_cblas_LIBRARY
NAMES cblas NAMES cblas
HINTS ${_lib_env}) HINTS ${_lib_env})
endif() endif()
endif() endif()
mark_as_advanced(CBLAS_cblas_LIBRARY) mark_as_advanced(CBLAS_cblas_LIBRARY)
...@@ -278,7 +280,7 @@ if (BLAS_FOUND) ...@@ -278,7 +280,7 @@ if (BLAS_FOUND)
set(CBLAS_LIBRARIES "CBLAS_LIBRARIES-NOTFOUND") set(CBLAS_LIBRARIES "CBLAS_LIBRARIES-NOTFOUND")
set(CBLAS_LIBRARY_DIRS "CBLAS_LIBRARY_DIRS-NOTFOUND") set(CBLAS_LIBRARY_DIRS "CBLAS_LIBRARY_DIRS-NOTFOUND")
if (NOT CBLAS_FIND_QUIETLY) if (NOT CBLAS_FIND_QUIETLY)
message(STATUS "Looking for cblas -- lib cblas not found") message(STATUS "Looking for cblas -- lib cblas not found")
endif() endif()
endif () endif ()
...@@ -292,22 +294,22 @@ if (BLAS_FOUND) ...@@ -292,22 +294,22 @@ if (BLAS_FOUND)
# CBLAS # CBLAS
if (CBLAS_INCLUDE_DIRS) if (CBLAS_INCLUDE_DIRS)
set(REQUIRED_INCDIRS "${CBLAS_INCLUDE_DIRS}") set(REQUIRED_INCDIRS "${CBLAS_INCLUDE_DIRS}")
endif() endif()
if (CBLAS_LIBRARY_DIRS) if (CBLAS_LIBRARY_DIRS)
set(REQUIRED_LIBDIRS "${CBLAS_LIBRARY_DIRS}") set(REQUIRED_LIBDIRS "${CBLAS_LIBRARY_DIRS}")
endif() endif()
set(REQUIRED_LIBS "${CBLAS_LIBRARIES}") set(REQUIRED_LIBS "${CBLAS_LIBRARIES}")
# BLAS # BLAS
if (BLAS_INCLUDE_DIRS) if (BLAS_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${BLAS_INCLUDE_DIRS}") list(APPEND REQUIRED_INCDIRS "${BLAS_INCLUDE_DIRS}")
endif() endif()
if (BLAS_LIBRARY_DIRS) if (BLAS_LIBRARY_DIRS)
list(APPEND REQUIRED_LIBDIRS "${BLAS_LIBRARY_DIRS}") list(APPEND REQUIRED_LIBDIRS "${BLAS_LIBRARY_DIRS}")
endif() endif()
list(APPEND REQUIRED_LIBS "${BLAS_LIBRARIES}") list(APPEND REQUIRED_LIBS "${BLAS_LIBRARIES}")
if (BLAS_LINKER_FLAGS) if (BLAS_LINKER_FLAGS)
list(APPEND REQUIRED_LDFLAGS "${BLAS_LINKER_FLAGS}") list(APPEND REQUIRED_LDFLAGS "${BLAS_LINKER_FLAGS}")
endif() endif()
# set required libraries for link # set required libraries for link
...@@ -315,7 +317,7 @@ if (BLAS_FOUND) ...@@ -315,7 +317,7 @@ if (BLAS_FOUND)
set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_LIBRARIES)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LDFLAGS}") list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LDFLAGS}")
foreach(lib_dir ${REQUIRED_LIBDIRS}) foreach(lib_dir ${REQUIRED_LIBDIRS})
list(APPEND CMAKE_REQUIRED_LIBRARIES "-L${lib_dir}") list(APPEND CMAKE_REQUIRED_LIBRARIES "-L${lib_dir}")
endforeach() endforeach()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LIBS}") list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LIBS}")
string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
...@@ -328,28 +330,28 @@ if (BLAS_FOUND) ...@@ -328,28 +330,28 @@ if (BLAS_FOUND)
if(CBLAS_WORKS) if(CBLAS_WORKS)
# Check for faster complex GEMM routine # Check for faster complex GEMM routine
# (only C/Z, no S/D version) # (only C/Z, no S/D version)
check_function_exists(cblas_zgemm3m CBLAS_ZGEMM3M_FOUND) check_function_exists(cblas_zgemm3m CBLAS_ZGEMM3M_FOUND)
if ( CBLAS_ZGEMM3M_FOUND ) if ( CBLAS_ZGEMM3M_FOUND )
add_definitions(-DCBLAS_HAS_ZGEMM3M -DCBLAS_HAS_CGEMM3M) add_definitions(-DCBLAS_HAS_ZGEMM3M -DCBLAS_HAS_CGEMM3M)
endif() endif()
# save link with dependencies # save link with dependencies
set(CBLAS_LIBRARIES_DEP "${REQUIRED_LIBS}") set(CBLAS_LIBRARIES_DEP "${REQUIRED_LIBS}")
set(CBLAS_LIBRARY_DIRS_DEP "${REQUIRED_LIBDIRS}") set(CBLAS_LIBRARY_DIRS_DEP "${REQUIRED_LIBDIRS}")
set(CBLAS_INCLUDE_DIRS_DEP "${REQUIRED_INCDIRS}") set(CBLAS_INCLUDE_DIRS_DEP "${REQUIRED_INCDIRS}")
set(CBLAS_LINKER_FLAGS "${REQUIRED_LDFLAGS}") set(CBLAS_LINKER_FLAGS "${REQUIRED_LDFLAGS}")
list(REMOVE_DUPLICATES CBLAS_LIBRARY_DIRS_DEP) list(REMOVE_DUPLICATES CBLAS_LIBRARY_DIRS_DEP)
list(REMOVE_DUPLICATES CBLAS_INCLUDE_DIRS_DEP) list(REMOVE_DUPLICATES CBLAS_INCLUDE_DIRS_DEP)
list(REMOVE_DUPLICATES CBLAS_LINKER_FLAGS) list(REMOVE_DUPLICATES CBLAS_LINKER_FLAGS)
else() else()
if(NOT CBLAS_FIND_QUIETLY) if(NOT CBLAS_FIND_QUIETLY)
message(STATUS "Looking for cblas : test of cblas_dscal with cblas and blas libraries fails") message(STATUS "Looking for cblas : test of cblas_dscal with cblas and blas libraries fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}") message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}") message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails") message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif() endif()
endif() endif()
set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS) set(CMAKE_REQUIRED_FLAGS)
......
...@@ -74,18 +74,18 @@ macro(Print_Find_Library_Blas_Status _libname _lib_to_find) ...@@ -74,18 +74,18 @@ macro(Print_Find_Library_Blas_Status _libname _lib_to_find)
else() else()
if(${LIBNAME}_DIR) if(${LIBNAME}_DIR)
message("${Yellow}${LIBNAME}_DIR is defined but ${_lib_to_find}" message("${Yellow}${LIBNAME}_DIR is defined but ${_lib_to_find}"
"has not been found in ${ARGN}${ColourReset}") "has not been found in ${ARGN}${ColourReset}")
else() else()
message("${Yellow}${_lib_to_find} not found." message("${Yellow}${_lib_to_find} not found."
"Nor ${LIBNAME}_DIR neither ${LIBNAME}_LIBDIR" "Nor ${LIBNAME}_DIR neither ${LIBNAME}_LIBDIR"
"are defined so that we look for ${_lib_to_find} in" "are defined so that we look for ${_lib_to_find} in"
"system paths (Linux: LD_LIBRARY_PATH, Windows: LIB," "system paths (Linux: LD_LIBRARY_PATH, Windows: LIB,"
"Mac: DYLD_LIBRARY_PATH," "Mac: DYLD_LIBRARY_PATH,"
"CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES," "CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES,"
"CMAKE_C_IMPLICIT_LINK_DIRECTORIES)${ColourReset}") "CMAKE_C_IMPLICIT_LINK_DIRECTORIES)${ColourReset}")
if(_lib_env) if(_lib_env)
message("${Yellow}${_lib_to_find} has not been found in" message("${Yellow}${_lib_to_find} has not been found in"
"${_lib_env}${ColourReset}") "${_lib_env}${ColourReset}")
endif() endif()
endif() endif()
endif() endif()
...@@ -151,11 +151,11 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads ...@@ -151,11 +151,11 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads
list(APPEND _libdir "${BLAS_DIR}") list(APPEND _libdir "${BLAS_DIR}")
list(APPEND _libdir "${BLAS_DIR}/lib") list(APPEND _libdir "${BLAS_DIR}/lib")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
list(APPEND _libdir "${BLAS_DIR}/lib64") list(APPEND _libdir "${BLAS_DIR}/lib64")
list(APPEND _libdir "${BLAS_DIR}/lib/intel64") list(APPEND _libdir "${BLAS_DIR}/lib/intel64")
else() else()
list(APPEND _libdir "${BLAS_DIR}/lib32") list(APPEND _libdir "${BLAS_DIR}/lib32")
list(APPEND _libdir "${BLAS_DIR}/lib/ia32") list(APPEND _libdir "${BLAS_DIR}/lib/ia32")
endif() endif()
elseif(ENV_BLAS_LIBDIR) elseif(ENV_BLAS_LIBDIR)
list(APPEND _libdir "${ENV_BLAS_LIBDIR}") list(APPEND _libdir "${ENV_BLAS_LIBDIR}")
...@@ -163,11 +163,11 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads ...@@ -163,11 +163,11 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads
list(APPEND _libdir "${ENV_BLAS_DIR}") list(APPEND _libdir "${ENV_BLAS_DIR}")
list(APPEND _libdir "${ENV_BLAS_DIR}/lib") list(APPEND _libdir "${ENV_BLAS_DIR}/lib")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
list(APPEND _libdir "${ENV_BLAS_DIR}/lib64") list(APPEND _libdir "${ENV_BLAS_DIR}/lib64")
list(APPEND _libdir "${ENV_BLAS_DIR}/lib/intel64") list(APPEND _libdir "${ENV_BLAS_DIR}/lib/intel64")
else() else()
list(APPEND _libdir "${ENV_BLAS_DIR}/lib32") list(APPEND _libdir "${ENV_BLAS_DIR}/lib32")
list(APPEND _libdir "${ENV_BLAS_DIR}/lib/ia32") list(APPEND _libdir "${ENV_BLAS_DIR}/lib/ia32")
endif() endif()
endif() endif()
if (LAPACK_LIBDIR) if (LAPACK_LIBDIR)
...@@ -176,11 +176,11 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads ...@@ -176,11 +176,11 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads
list(APPEND _libdir "${LAPACK_DIR}") list(APPEND _libdir "${LAPACK_DIR}")
list(APPEND _libdir "${LAPACK_DIR}/lib") list(APPEND _libdir "${LAPACK_DIR}/lib")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
list(APPEND _libdir "${LAPACK_DIR}/lib64") list(APPEND _libdir "${LAPACK_DIR}/lib64")
list(APPEND _libdir "${LAPACK_DIR}/lib/intel64") list(APPEND _libdir "${LAPACK_DIR}/lib/intel64")
else() else()
list(APPEND _libdir "${LAPACK_DIR}/lib32") list(APPEND _libdir "${LAPACK_DIR}/lib32")
list(APPEND _libdir "${LAPACK_DIR}/lib/ia32") list(APPEND _libdir "${LAPACK_DIR}/lib/ia32")
endif() endif()
elseif(ENV_LAPACK_LIBDIR) elseif(ENV_LAPACK_LIBDIR)
list(APPEND _libdir "${ENV_LAPACK_LIBDIR}") list(APPEND _libdir "${ENV_LAPACK_LIBDIR}")
...@@ -188,29 +188,29 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads ...@@ -188,29 +188,29 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads
list(APPEND _libdir "${ENV_LAPACK_DIR}") list(APPEND _libdir "${ENV_LAPACK_DIR}")
list(APPEND _libdir "${ENV_LAPACK_DIR}/lib") list(APPEND _libdir "${ENV_LAPACK_DIR}/lib")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
list(APPEND _libdir "${ENV_LAPACK_DIR}/lib64") list(APPEND _libdir "${ENV_LAPACK_DIR}/lib64")
list(APPEND _libdir "${ENV_LAPACK_DIR}/lib/intel64") list(APPEND _libdir "${ENV_LAPACK_DIR}/lib/intel64")
else() else()
list(APPEND _libdir "${ENV_LAPACK_DIR}/lib32") list(APPEND _libdir "${ENV_LAPACK_DIR}/lib32")
list(APPEND _libdir "${ENV_LAPACK_DIR}/lib/ia32") list(APPEND _libdir "${ENV_LAPACK_DIR}/lib/ia32")
endif() endif()
else() else()
if (ENV_MKLROOT) if (ENV_MKLROOT)
list(APPEND _libdir "${ENV_MKLROOT}/lib") list(APPEND _libdir "${ENV_MKLROOT}/lib")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
list(APPEND _libdir "${ENV_MKLROOT}/lib64") list(APPEND _libdir "${ENV_MKLROOT}/lib64")
list(APPEND _libdir "${ENV_MKLROOT}/lib/intel64") list(APPEND _libdir "${ENV_MKLROOT}/lib/intel64")
else() else()
list(APPEND _libdir "${ENV_MKLROOT}/lib32") list(APPEND _libdir "${ENV_MKLROOT}/lib32")
list(APPEND _libdir "${ENV_MKLROOT}/lib/ia32") list(APPEND _libdir "${ENV_MKLROOT}/lib/ia32")
endif() endif()
endif() endif()
if (WIN32) if (WIN32)
string(REPLACE ":" ";" _libdir2 "$ENV{LIB}") string(REPLACE ":" ";" _libdir2 "$ENV{LIB}")
elseif (APPLE) elseif (APPLE)
string(REPLACE ":" ";" _libdir2 "$ENV{DYLD_LIBRARY_PATH}") string(REPLACE ":" ";" _libdir2 "$ENV{DYLD_LIBRARY_PATH}")
else () else ()
string(REPLACE ":" ";" _libdir2 "$ENV{LD_LIBRARY_PATH}") string(REPLACE ":" ";" _libdir2 "$ENV{LD_LIBRARY_PATH}")
endif () endif ()
list(APPEND _libdir "${_libdir2}") list(APPEND _libdir "${_libdir2}")
list(APPEND _libdir "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}") list(APPEND _libdir "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
...@@ -227,30 +227,30 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads ...@@ -227,30 +227,30 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads
if(_libraries_work) if(_libraries_work)
if (BLA_STATIC) if (BLA_STATIC)
if (WIN32) if (WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif ( WIN32 ) endif ( WIN32 )
if (APPLE) if (APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
else (APPLE) else (APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif (APPLE) endif (APPLE)
else (BLA_STATIC) else (BLA_STATIC)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux") if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# for ubuntu's libblas3gf and liblapack3gf packages # for ubuntu's libblas3gf and liblapack3gf packages
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf) set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
endif () endif ()
endif (BLA_STATIC) endif (BLA_STATIC)
find_library(${_prefix}_${_library}_LIBRARY find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library} NAMES ${_library}
HINTS ${_libdir} HINTS ${_libdir}
NO_DEFAULT_PATH NO_DEFAULT_PATH
) )
mark_as_advanced(${_prefix}_${_library}_LIBRARY) mark_as_advanced(${_prefix}_${_library}_LIBRARY)
# Print status if not found # Print status if not found
# ------------------------- # -------------------------
if (NOT ${_prefix}_${_library}_LIBRARY AND NOT LAPACK_FIND_QUIETLY AND LAPACK_VERBOSE) if (NOT ${_prefix}_${_library}_LIBRARY AND NOT LAPACK_FIND_QUIETLY AND LAPACK_VERBOSE)
Print_Find_Library_Blas_Status(lapack ${_library} ${_libdir}) Print_Find_Library_Blas_Status(lapack ${_library} ${_libdir})
endif () endif ()
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
set(_libraries_work ${${_prefix}_${_library}_LIBRARY}) set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
...@@ -270,7 +270,7 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads ...@@ -270,7 +270,7 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads
endif(UNIX AND BLA_STATIC) endif(UNIX AND BLA_STATIC)
if (LAPACK_VERBOSE) if (LAPACK_VERBOSE)
message("${Cyan}LAPACK libs found. Try to compile symbol ${_name} with" message("${Cyan}LAPACK libs found. Try to compile symbol ${_name} with"
"following libraries: ${CMAKE_REQUIRED_LIBRARIES}") "following libraries: ${CMAKE_REQUIRED_LIBRARIES}")
endif () endif ()
if(NOT LAPACK_FOUND) if(NOT LAPACK_FOUND)
unset(${_prefix}${_combined_name}_WORKS CACHE) unset(${_prefix}${_combined_name}_WORKS CACHE)
...@@ -345,18 +345,18 @@ if(BLAS_FOUND) ...@@ -345,18 +345,18 @@ if(BLAS_FOUND)
) )
if (LAPACK_LIBRARIES) if (LAPACK_LIBRARIES)
if(NOT LAPACK_FIND_QUIETLY) if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES) if(LAPACK_LIBRARIES)
message(STATUS "Looking for LAPACK in BLAS: found") message(STATUS "Looking for LAPACK in BLAS: found")
else() else()
message(STATUS "Looking for LAPACK in BLAS: not found") message(STATUS "Looking for LAPACK in BLAS: not found")
endif() endif()
endif() endif()
if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND) if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "${BLAS_VENDOR_FOUND}") set (LAPACK_VENDOR_FOUND "${BLAS_VENDOR_FOUND}")
endif() endif()
endif() endif()
endif(BLAS_LIBRARIES) endif(BLAS_LIBRARIES)
#intel lapack #intel lapack
if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
...@@ -364,82 +364,82 @@ if(BLAS_FOUND) ...@@ -364,82 +364,82 @@ if(BLAS_FOUND)
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() else()
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
endif() endif()
set(LAPACK_SEARCH_LIBS "") set(LAPACK_SEARCH_LIBS "")
set(additional_flags "") set(additional_flags "")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux") if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(additional_flags "-Wl,--no-as-needed") set(additional_flags "-Wl,--no-as-needed")
endif() endif()
if (BLA_F95) if (BLA_F95)
set(LAPACK_mkl_SEARCH_SYMBOL "CHEEV") set(LAPACK_mkl_SEARCH_SYMBOL "CHEEV")
set(_LIBRARIES LAPACK95_LIBRARIES) set(_LIBRARIES LAPACK95_LIBRARIES)
set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES}) set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES})
# old # old
list(APPEND LAPACK_SEARCH_LIBS list(APPEND LAPACK_SEARCH_LIBS
"mkl_lapack95") "mkl_lapack95")
# new >= 10.3 # new >= 10.3
list(APPEND LAPACK_SEARCH_LIBS list(APPEND LAPACK_SEARCH_LIBS
"mkl_intel_c") "mkl_intel_c")
list(APPEND LAPACK_SEARCH_LIBS list(APPEND LAPACK_SEARCH_LIBS
"mkl_intel_lp64") "mkl_intel_lp64")
else(BLA_F95) else(BLA_F95)
set(LAPACK_mkl_SEARCH_SYMBOL "cheev") set(LAPACK_mkl_SEARCH_SYMBOL "cheev")
set(_LIBRARIES LAPACK_LIBRARIES) set(_LIBRARIES LAPACK_LIBRARIES)
set(_BLAS_LIBRARIES ${BLAS_LIBRARIES}) set(_BLAS_LIBRARIES ${BLAS_LIBRARIES})
# old # old
list(APPEND LAPACK_SEARCH_LIBS list(APPEND LAPACK_SEARCH_LIBS
"mkl_lapack") "mkl_lapack")
# new >= 10.3 # new >= 10.3
list(APPEND LAPACK_SEARCH_LIBS list(APPEND LAPACK_SEARCH_LIBS
"mkl_gf_lp64") "mkl_gf_lp64")
endif(BLA_F95) endif(BLA_F95)
# First try empty lapack libs # First try empty lapack libs
if (NOT ${_LIBRARIES}) if (NOT ${_LIBRARIES})
check_lapack_libraries( check_lapack_libraries(
${_LIBRARIES} ${_LIBRARIES}
LAPACK LAPACK
${LAPACK_mkl_SEARCH_SYMBOL} ${LAPACK_mkl_SEARCH_SYMBOL}
"${additional_flags}" "${additional_flags}"
"" ""
"${_BLAS_LIBRARIES}" "${_BLAS_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT};${LM}" "${CMAKE_THREAD_LIBS_INIT};${LM}"
) )
if(_LIBRARIES) if(_LIBRARIES)
set(LAPACK_LINKER_FLAGS "${additional_flags}") set(LAPACK_LINKER_FLAGS "${additional_flags}")
endif() endif()
endif () endif ()
# Then try the search libs # Then try the search libs
foreach (IT ${LAPACK_SEARCH_LIBS}) foreach (IT ${LAPACK_SEARCH_LIBS})
if (NOT ${_LIBRARIES}) if (NOT ${_LIBRARIES})
check_lapack_libraries( check_lapack_libraries(
${_LIBRARIES} ${_LIBRARIES}
LAPACK LAPACK
${LAPACK_mkl_SEARCH_SYMBOL} ${LAPACK_mkl_SEARCH_SYMBOL}
"${additional_flags}" "${additional_flags}"
"${IT}" "${IT}"
"${_BLAS_LIBRARIES}" "${_BLAS_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT};${LM}" "${CMAKE_THREAD_LIBS_INIT};${LM}"
) )
if(_LIBRARIES) if(_LIBRARIES)
set(LAPACK_LINKER_FLAGS "${additional_flags}") set(LAPACK_LINKER_FLAGS "${additional_flags}")
endif() endif()
endif () endif ()
endforeach () endforeach ()
if(NOT LAPACK_FIND_QUIETLY) if(NOT LAPACK_FIND_QUIETLY)
if(${_LIBRARIES}) if(${_LIBRARIES})
message(STATUS "Looking for MKL LAPACK: found") message(STATUS "Looking for MKL LAPACK: found")
else() else()
message(STATUS "Looking for MKL LAPACK: not found") message(STATUS "Looking for MKL LAPACK: not found")
endif() endif()
endif(NOT LAPACK_FIND_QUIETLY) endif(NOT LAPACK_FIND_QUIETLY)
if (${_LIBRARIES} AND NOT LAPACK_VENDOR_FOUND) if (${_LIBRARIES} AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "Intel MKL") set (LAPACK_VENDOR_FOUND "Intel MKL")
...@@ -453,20 +453,20 @@ if(BLAS_FOUND) ...@@ -453,20 +453,20 @@ if(BLAS_FOUND)
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES) if(NOT LAPACK_LIBRARIES)
check_lapack_libraries( check_lapack_libraries(
LAPACK_LIBRARIES LAPACK_LIBRARIES
LAPACK LAPACK
cheev cheev
"" ""
"goto2" "goto2"
"${BLAS_LIBRARIES}" "${BLAS_LIBRARIES}"
"" ""
) )
if(NOT LAPACK_FIND_QUIETLY) if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES) if(LAPACK_LIBRARIES)
message(STATUS "Looking for Goto LAPACK: found") message(STATUS "Looking for Goto LAPACK: found")
else() else()
message(STATUS "Looking for Goto LAPACK: not found") message(STATUS "Looking for Goto LAPACK: not found")
endif() endif()
endif() endif()
if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND) if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "Goto") set (LAPACK_VENDOR_FOUND "Goto")
...@@ -478,20 +478,20 @@ if(BLAS_FOUND) ...@@ -478,20 +478,20 @@ if(BLAS_FOUND)
if (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES) if(NOT LAPACK_LIBRARIES)
check_lapack_libraries( check_lapack_libraries(
LAPACK_LIBRARIES LAPACK_LIBRARIES
LAPACK LAPACK
cheev cheev
"" ""
"openblas" "openblas"
"${BLAS_LIBRARIES}" "${BLAS_LIBRARIES}"
"" ""
) )
if(NOT LAPACK_FIND_QUIETLY) if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES) if(LAPACK_LIBRARIES)
message(STATUS "Looking for Open LAPACK: found") message(STATUS "Looking for Open LAPACK: found")
else() else()
message(STATUS "Looking for Open LAPACK: not found") message(STATUS "Looking for Open LAPACK: not found")
endif() endif()
endif() endif()
if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND) if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "Openblas") set (LAPACK_VENDOR_FOUND "Openblas")
...@@ -503,20 +503,20 @@ if(BLAS_FOUND) ...@@ -503,20 +503,20 @@ if(BLAS_FOUND)
if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES) if(NOT LAPACK_LIBRARIES)
check_lapack_libraries( check_lapack_libraries(
LAPACK_LIBRARIES LAPACK_LIBRARIES
LAPACK LAPACK
cheevd cheevd
"" ""
"essl;lapack" "essl;lapack"
"${BLAS_LIBRARIES}" "${BLAS_LIBRARIES}"
"" ""
) )
if(NOT LAPACK_FIND_QUIETLY) if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES) if(LAPACK_LIBRARIES)
message(STATUS "Looking for IBM ESSL LAPACK: found") message(STATUS "Looking for IBM ESSL LAPACK: found")
else() else()
message(STATUS "Looking for IBM ESSL LAPACK: not found") message(STATUS "Looking for IBM ESSL LAPACK: not found")
endif() endif()
endif() endif()
if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND) if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "IBM ESSL") set (LAPACK_VENDOR_FOUND "IBM ESSL")
...@@ -528,20 +528,20 @@ if(BLAS_FOUND) ...@@ -528,20 +528,20 @@ if(BLAS_FOUND)
if (BLA_VENDOR STREQUAL "IBMESSLMT" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "IBMESSLMT" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES) if(NOT LAPACK_LIBRARIES)
check_lapack_libraries( check_lapack_libraries(
LAPACK_LIBRARIES LAPACK_LIBRARIES
LAPACK LAPACK
cheevd cheevd
"" ""
"esslsmp;lapack" "esslsmp;lapack"
"${BLAS_PAR_LIBRARIES}" "${BLAS_PAR_LIBRARIES}"
"" ""
) )
if(NOT LAPACK_FIND_QUIETLY) if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES) if(LAPACK_LIBRARIES)
message(STATUS "Looking for IBM ESSL MT LAPACK: found") message(STATUS "Looking for IBM ESSL MT LAPACK: found")
else() else()
message(STATUS "Looking for IBM ESSL MT LAPACK: not found") message(STATUS "Looking for IBM ESSL MT LAPACK: not found")
endif() endif()
endif() endif()
if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND) if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "IBM ESSL MT") set (LAPACK_VENDOR_FOUND "IBM ESSL MT")
...@@ -554,11 +554,11 @@ if(BLAS_FOUND) ...@@ -554,11 +554,11 @@ if(BLAS_FOUND)
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(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES) if(LAPACK_LIBRARIES)
message(STATUS "Looking for ACML LAPACK: found") message(STATUS "Looking for ACML LAPACK: found")
else() else()
message(STATUS "Looking for ACML LAPACK: not found") message(STATUS "Looking for ACML LAPACK: not found")
endif() endif()
endif() endif()
if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND) if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "ACML") set (LAPACK_VENDOR_FOUND "ACML")
...@@ -570,20 +570,20 @@ if(BLAS_FOUND) ...@@ -570,20 +570,20 @@ if(BLAS_FOUND)
if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES) if(NOT LAPACK_LIBRARIES)
check_lapack_libraries( check_lapack_libraries(
LAPACK_LIBRARIES LAPACK_LIBRARIES
LAPACK LAPACK
cheev cheev
"" ""
"Accelerate" "Accelerate"
"${BLAS_LIBRARIES}" "${BLAS_LIBRARIES}"
"" ""
) )
if(NOT LAPACK_FIND_QUIETLY) if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES) if(LAPACK_LIBRARIES)
message(STATUS "Looking for Apple Accelerate LAPACK: found") message(STATUS "Looking for Apple Accelerate LAPACK: found")
else() else()
message(STATUS "Looking for Apple Accelerate LAPACK: not found") message(STATUS "Looking for Apple Accelerate LAPACK: not found")
endif() endif()
endif() endif()
if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND) if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "Apple Accelerate") set (LAPACK_VENDOR_FOUND "Apple Accelerate")
...@@ -594,20 +594,20 @@ if(BLAS_FOUND) ...@@ -594,20 +594,20 @@ if(BLAS_FOUND)
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(
LAPACK_LIBRARIES LAPACK_LIBRARIES
LAPACK LAPACK
cheev cheev
"" ""
"vecLib" "vecLib"
"${BLAS_LIBRARIES}" "${BLAS_LIBRARIES}"
"" ""
) )
if(NOT LAPACK_FIND_QUIETLY) if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES) if(LAPACK_LIBRARIES)
message(STATUS "Looking for NAS LAPACK: found") message(STATUS "Looking for NAS LAPACK: found")
else() else()
message(STATUS "Looking for NAS LAPACK: not found") message(STATUS "Looking for NAS LAPACK: not found")
endif() endif()
endif() endif()
if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND) if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "NAS") set (LAPACK_VENDOR_FOUND "NAS")
...@@ -621,20 +621,20 @@ if(BLAS_FOUND) ...@@ -621,20 +621,20 @@ if(BLAS_FOUND)
BLA_VENDOR STREQUAL "All") BLA_VENDOR STREQUAL "All")
if ( NOT LAPACK_LIBRARIES ) if ( NOT LAPACK_LIBRARIES )
check_lapack_libraries( check_lapack_libraries(
LAPACK_LIBRARIES LAPACK_LIBRARIES
LAPACK LAPACK
cheev cheev
"" ""
"lapack" "lapack"
"${BLAS_LIBRARIES};${LM}" "${BLAS_LIBRARIES};${LM}"
"" ""
) )
if(NOT LAPACK_FIND_QUIETLY) if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES) if(LAPACK_LIBRARIES)
message(STATUS "Looking for Generic LAPACK: found") message(STATUS "Looking for Generic LAPACK: found")
else() else()
message(STATUS "Looking for Generic LAPACK: not found") message(STATUS "Looking for Generic LAPACK: not found")
endif() endif()
endif() endif()
if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND) if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "Netlib or other Generic liblapack") set (LAPACK_VENDOR_FOUND "Netlib or other Generic liblapack")
...@@ -657,23 +657,23 @@ if(BLA_F95) ...@@ -657,23 +657,23 @@ if(BLA_F95)
message(STATUS "LAPACK_LIBRARIES ${LAPACK_LIBRARIES}") message(STATUS "LAPACK_LIBRARIES ${LAPACK_LIBRARIES}")
else(LAPACK95_FOUND) else(LAPACK95_FOUND)
message(WARNING "BLA_VENDOR has been set to ${BLA_VENDOR} but LAPACK 95 libraries could not be found or check of symbols failed." message(WARNING "BLA_VENDOR has been set to ${BLA_VENDOR} but LAPACK 95 libraries could not be found or check of symbols failed."
"\nPlease indicate where to find LAPACK libraries. You have three options:\n" "\nPlease indicate where to find LAPACK libraries. You have three options:\n"
"- Option 1: Provide the installation directory of LAPACK library with cmake option: -DLAPACK_DIR=your/path/to/lapack\n" "- Option 1: Provide the installation directory of LAPACK library with cmake option: -DLAPACK_DIR=your/path/to/lapack\n"
"- Option 2: Provide the directory where to find BLAS libraries with cmake option: -DBLAS_LIBDIR=your/path/to/blas/libs\n" "- Option 2: Provide the directory where to find BLAS libraries with cmake option: -DBLAS_LIBDIR=your/path/to/blas/libs\n"
"- Option 3: Update your environment variable (Linux: LD_LIBRARY_PATH, Windows: LIB, Mac: DYLD_LIBRARY_PATH)\n" "- Option 3: Update your environment variable (Linux: LD_LIBRARY_PATH, Windows: LIB, Mac: DYLD_LIBRARY_PATH)\n"
"\nTo follow libraries detection more precisely you can activate a verbose mode with -DLAPACK_VERBOSE=ON at cmake configure." "\nTo follow libraries detection more precisely you can activate a verbose mode with -DLAPACK_VERBOSE=ON at cmake configure."
"\nYou could also specify a BLAS vendor to look for by setting -DBLA_VENDOR=blas_vendor_name." "\nYou could also specify a BLAS vendor to look for by setting -DBLA_VENDOR=blas_vendor_name."
"\nList of possible BLAS vendor: Goto, ATLAS PhiPACK, CXML, DXML, SunPerf, SCSL, SGIMATH, IBMESSL, Intel10_32 (intel mkl v10 32 bit)," "\nList 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)," "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")
if(LAPACK_FIND_REQUIRED) if(LAPACK_FIND_REQUIRED)
message(FATAL_ERROR message(FATAL_ERROR
"A required library with LAPACK95 API not found. Please specify library location." "A required library with LAPACK95 API not found. Please specify library location."
) )
else(LAPACK_FIND_REQUIRED) else(LAPACK_FIND_REQUIRED)
message(STATUS message(STATUS
"A library with LAPACK95 API not found. Please specify library location." "A library with LAPACK95 API not found. Please specify library location."
) )
endif(LAPACK_FIND_REQUIRED) endif(LAPACK_FIND_REQUIRED)
endif(LAPACK95_FOUND) endif(LAPACK95_FOUND)
endif(NOT LAPACK_FIND_QUIETLY) endif(NOT LAPACK_FIND_QUIETLY)
...@@ -692,23 +692,23 @@ else(BLA_F95) ...@@ -692,23 +692,23 @@ else(BLA_F95)
message(STATUS "LAPACK_LIBRARIES ${LAPACK_LIBRARIES}") message(STATUS "LAPACK_LIBRARIES ${LAPACK_LIBRARIES}")
else(LAPACK_FOUND) else(LAPACK_FOUND)
message(WARNING "BLA_VENDOR has been set to ${BLA_VENDOR} but LAPACK libraries could not be found or check of symbols failed." message(WARNING "BLA_VENDOR has been set to ${BLA_VENDOR} but LAPACK libraries could not be found or check of symbols failed."
"\nPlease indicate where to find LAPACK libraries. You have three options:\n" "\nPlease indicate where to find LAPACK libraries. You have three options:\n"
"- Option 1: Provide the installation directory of LAPACK library with cmake option: -DLAPACK_DIR=your/path/to/lapack\n" "- Option 1: Provide the installation directory of LAPACK library with cmake option: -DLAPACK_DIR=your/path/to/lapack\n"
"- Option 2: Provide the directory where to find BLAS libraries with cmake option: -DBLAS_LIBDIR=your/path/to/blas/libs\n" "- Option 2: Provide the directory where to find BLAS libraries with cmake option: -DBLAS_LIBDIR=your/path/to/blas/libs\n"
"- Option 3: Update your environment variable (Linux: LD_LIBRARY_PATH, Windows: LIB, Mac: DYLD_LIBRARY_PATH)\n" "- Option 3: Update your environment variable (Linux: LD_LIBRARY_PATH, Windows: LIB, Mac: DYLD_LIBRARY_PATH)\n"
"\nTo follow libraries detection more precisely you can activate a verbose mode with -DLAPACK_VERBOSE=ON at cmake configure." "\nTo follow libraries detection more precisely you can activate a verbose mode with -DLAPACK_VERBOSE=ON at cmake configure."
"\nYou could also specify a BLAS vendor to look for by setting -DBLA_VENDOR=blas_vendor_name." "\nYou could also specify a BLAS vendor to look for by setting -DBLA_VENDOR=blas_vendor_name."
"\nList of possible BLAS vendor: Goto, ATLAS PhiPACK, CXML, DXML, SunPerf, SCSL, SGIMATH, IBMESSL, Intel10_32 (intel mkl v10 32 bit)," "\nList 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)," "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")
if(LAPACK_FIND_REQUIRED) if(LAPACK_FIND_REQUIRED)
message(FATAL_ERROR message(FATAL_ERROR
"A required library with LAPACK API not found. Please specify library location." "A required library with LAPACK API not found. Please specify library location."
) )
else(LAPACK_FIND_REQUIRED) else(LAPACK_FIND_REQUIRED)
message(STATUS message(STATUS
"A library with LAPACK API not found. Please specify library location." "A library with LAPACK API not found. Please specify library location."
) )
endif(LAPACK_FIND_REQUIRED) endif(LAPACK_FIND_REQUIRED)
endif(LAPACK_FOUND) endif(LAPACK_FOUND)
endif(NOT LAPACK_FIND_QUIETLY) endif(NOT LAPACK_FIND_QUIETLY)
......
...@@ -91,18 +91,20 @@ if (LAPACK_FOUND) ...@@ -91,18 +91,20 @@ if (LAPACK_FOUND)
if(LAPACKE_WORKS) if(LAPACKE_WORKS)
if(NOT LAPACKE_FIND_QUIETLY) if(NOT LAPACKE_FIND_QUIETLY)
message(STATUS "Looking for lapacke: test with lapack succeeds") message(STATUS "Looking for lapacke: test with lapack succeeds")
endif() endif()
# test succeeds: LAPACKE is in LAPACK # test succeeds: LAPACKE is in LAPACK
set(LAPACKE_LIBRARIES "${LAPACK_LIBRARIES}") set(LAPACKE_LIBRARIES "${LAPACK_LIBRARIES}")
set(LAPACKE_LIBRARIES_DEP "${LAPACK_LIBRARIES}")
if (LAPACK_LIBRARY_DIRS) if (LAPACK_LIBRARY_DIRS)
set(LAPACKE_LIBRARY_DIRS "${LAPACK_LIBRARY_DIRS}") set(LAPACKE_LIBRARY_DIRS "${LAPACK_LIBRARY_DIRS}")
endif() endif()
if(LAPACK_INCLUDE_DIRS) if(LAPACK_INCLUDE_DIRS)
set(LAPACKE_INCLUDE_DIRS "${LAPACK_INCLUDE_DIRS}") set(LAPACKE_INCLUDE_DIRS "${LAPACK_INCLUDE_DIRS}")
set(LAPACKE_INCLUDE_DIRS_DEP "${LAPACK_INCLUDE_DIRS}")
endif() endif()
if (LAPACK_LINKER_FLAGS) if (LAPACK_LINKER_FLAGS)
set(LAPACKE_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}") set(LAPACKE_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}")
endif() endif()
endif() endif()
endif (NOT LAPACKE_STANDALONE) endif (NOT LAPACKE_STANDALONE)
...@@ -133,16 +135,16 @@ if (LAPACK_FOUND) ...@@ -133,16 +135,16 @@ if (LAPACK_FOUND)
list(APPEND _inc_env "${ENV_LAPACKE_DIR}/include/lapacke") list(APPEND _inc_env "${ENV_LAPACKE_DIR}/include/lapacke")
else() else()
if(WIN32) if(WIN32)
string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}") string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}")
else() else()
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}") string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}")
list(APPEND _inc_env "${_path_env}") list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{C_INCLUDE_PATH}") string(REPLACE ":" ";" _path_env "$ENV{C_INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}") list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{CPATH}") string(REPLACE ":" ";" _path_env "$ENV{CPATH}")
list(APPEND _inc_env "${_path_env}") list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE_PATH}") string(REPLACE ":" ";" _path_env "$ENV{INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}") list(APPEND _inc_env "${_path_env}")
endif() endif()
endif() endif()
list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}") list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}")
...@@ -156,20 +158,20 @@ if (LAPACK_FOUND) ...@@ -156,20 +158,20 @@ if (LAPACK_FOUND)
if(LAPACKE_INCDIR) if(LAPACKE_INCDIR)
set(LAPACKE_lapacke.h_DIRS "LAPACKE_lapacke.h_DIRS-NOTFOUND") set(LAPACKE_lapacke.h_DIRS "LAPACKE_lapacke.h_DIRS-NOTFOUND")
find_path(LAPACKE_lapacke.h_DIRS find_path(LAPACKE_lapacke.h_DIRS
NAMES lapacke.h NAMES lapacke.h
HINTS ${LAPACKE_INCDIR}) HINTS ${LAPACKE_INCDIR})
else() else()
if(LAPACKE_DIR) if(LAPACKE_DIR)
set(LAPACKE_lapacke.h_DIRS "LAPACKE_lapacke.h_DIRS-NOTFOUND") set(LAPACKE_lapacke.h_DIRS "LAPACKE_lapacke.h_DIRS-NOTFOUND")
find_path(LAPACKE_lapacke.h_DIRS find_path(LAPACKE_lapacke.h_DIRS
NAMES lapacke.h NAMES lapacke.h
HINTS ${LAPACKE_DIR} HINTS ${LAPACKE_DIR}
PATH_SUFFIXES "include" "include/lapacke") PATH_SUFFIXES "include" "include/lapacke")
else() else()
set(LAPACKE_lapacke.h_DIRS "LAPACKE_lapacke.h_DIRS-NOTFOUND") set(LAPACKE_lapacke.h_DIRS "LAPACKE_lapacke.h_DIRS-NOTFOUND")
find_path(LAPACKE_lapacke.h_DIRS find_path(LAPACKE_lapacke.h_DIRS
NAMES lapacke.h NAMES lapacke.h
HINTS ${_inc_env}) HINTS ${_inc_env})
endif() endif()
endif() endif()
mark_as_advanced(LAPACKE_lapacke.h_DIRS) mark_as_advanced(LAPACKE_lapacke.h_DIRS)
...@@ -181,7 +183,7 @@ if (LAPACK_FOUND) ...@@ -181,7 +183,7 @@ if (LAPACK_FOUND)
else () else ()
set(LAPACKE_INCLUDE_DIRS "LAPACKE_INCLUDE_DIRS-NOTFOUND") set(LAPACKE_INCLUDE_DIRS "LAPACKE_INCLUDE_DIRS-NOTFOUND")
if(NOT LAPACKE_FIND_QUIETLY) if(NOT LAPACKE_FIND_QUIETLY)
message(STATUS "Looking for lapacke -- lapacke.h not found") message(STATUS "Looking for lapacke -- lapacke.h not found")
endif() endif()
endif() endif()
...@@ -200,15 +202,15 @@ if (LAPACK_FOUND) ...@@ -200,15 +202,15 @@ if (LAPACK_FOUND)
list(APPEND _lib_env "${ENV_LAPACKE_DIR}/lib") list(APPEND _lib_env "${ENV_LAPACKE_DIR}/lib")
else() else()
if(WIN32) if(WIN32)
string(REPLACE ":" ";" _lib_env "$ENV{LIB}") string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else() else()
if(APPLE) if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}") string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else() else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}") string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif() endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}") list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}") list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
endif() endif()
endif() endif()
list(REMOVE_DUPLICATES _lib_env) list(REMOVE_DUPLICATES _lib_env)
...@@ -220,20 +222,20 @@ if (LAPACK_FOUND) ...@@ -220,20 +222,20 @@ if (LAPACK_FOUND)
if(LAPACKE_LIBDIR) if(LAPACKE_LIBDIR)
set(LAPACKE_lapacke_LIBRARY "LAPACKE_lapacke_LIBRARY-NOTFOUND") set(LAPACKE_lapacke_LIBRARY "LAPACKE_lapacke_LIBRARY-NOTFOUND")
find_library(LAPACKE_lapacke_LIBRARY find_library(LAPACKE_lapacke_LIBRARY
NAMES lapacke NAMES lapacke
HINTS ${LAPACKE_LIBDIR}) HINTS ${LAPACKE_LIBDIR})
else() else()
if(LAPACKE_DIR) if(LAPACKE_DIR)
set(LAPACKE_lapacke_LIBRARY "LAPACKE_lapacke_LIBRARY-NOTFOUND") set(LAPACKE_lapacke_LIBRARY "LAPACKE_lapacke_LIBRARY-NOTFOUND")
find_library(LAPACKE_lapacke_LIBRARY find_library(LAPACKE_lapacke_LIBRARY
NAMES lapacke NAMES lapacke
HINTS ${LAPACKE_DIR} HINTS ${LAPACKE_DIR}
PATH_SUFFIXES lib lib32 lib64) PATH_SUFFIXES lib lib32 lib64)
else() else()
set(LAPACKE_lapacke_LIBRARY "LAPACKE_lapacke_LIBRARY-NOTFOUND") set(LAPACKE_lapacke_LIBRARY "LAPACKE_lapacke_LIBRARY-NOTFOUND")
find_library(LAPACKE_lapacke_LIBRARY find_library(LAPACKE_lapacke_LIBRARY
NAMES lapacke NAMES lapacke
HINTS ${_lib_env}) HINTS ${_lib_env})
endif() endif()
endif() endif()
mark_as_advanced(LAPACKE_lapacke_LIBRARY) mark_as_advanced(LAPACKE_lapacke_LIBRARY)
...@@ -249,7 +251,7 @@ if (LAPACK_FOUND) ...@@ -249,7 +251,7 @@ if (LAPACK_FOUND)
set(LAPACKE_LIBRARIES "LAPACKE_LIBRARIES-NOTFOUND") set(LAPACKE_LIBRARIES "LAPACKE_LIBRARIES-NOTFOUND")
set(LAPACKE_LIBRARY_DIRS "LAPACKE_LIBRARY_DIRS-NOTFOUND") set(LAPACKE_LIBRARY_DIRS "LAPACKE_LIBRARY_DIRS-NOTFOUND")
if (NOT LAPACKE_FIND_QUIETLY) if (NOT LAPACKE_FIND_QUIETLY)
message(STATUS "Looking for lapacke -- lib lapacke not found") message(STATUS "Looking for lapacke -- lib lapacke not found")
endif() endif()
endif () endif ()
...@@ -263,57 +265,57 @@ if (LAPACK_FOUND) ...@@ -263,57 +265,57 @@ if (LAPACK_FOUND)
# LAPACKE # LAPACKE
if (LAPACKE_INCLUDE_DIRS) if (LAPACKE_INCLUDE_DIRS)
set(REQUIRED_INCDIRS "${LAPACKE_INCLUDE_DIRS}") set(REQUIRED_INCDIRS "${LAPACKE_INCLUDE_DIRS}")
endif() endif()
if (LAPACKE_LIBRARY_DIRS) if (LAPACKE_LIBRARY_DIRS)
set(REQUIRED_LIBDIRS "${LAPACKE_LIBRARY_DIRS}") set(REQUIRED_LIBDIRS "${LAPACKE_LIBRARY_DIRS}")
endif() endif()
set(REQUIRED_LIBS "${LAPACKE_LIBRARIES}") set(REQUIRED_LIBS "${LAPACKE_LIBRARIES}")
# LAPACK # LAPACK
if (LAPACK_INCLUDE_DIRS) if (LAPACK_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${LAPACK_INCLUDE_DIRS}") list(APPEND REQUIRED_INCDIRS "${LAPACK_INCLUDE_DIRS}")
endif() endif()
if (LAPACK_LIBRARY_DIRS) if (LAPACK_LIBRARY_DIRS)
list(APPEND REQUIRED_LIBDIRS "${LAPACK_LIBRARY_DIRS}") list(APPEND REQUIRED_LIBDIRS "${LAPACK_LIBRARY_DIRS}")
endif() endif()
list(APPEND REQUIRED_LIBS "${LAPACK_LIBRARIES}") list(APPEND REQUIRED_LIBS "${LAPACK_LIBRARIES}")
if (LAPACK_LINKER_FLAGS) if (LAPACK_LINKER_FLAGS)
list(APPEND REQUIRED_LDFLAGS "${LAPACK_LINKER_FLAGS}") list(APPEND REQUIRED_LDFLAGS "${LAPACK_LINKER_FLAGS}")
endif() endif()
# Fortran # Fortran
if (CMAKE_C_COMPILER_ID MATCHES "GNU") if (CMAKE_C_COMPILER_ID MATCHES "GNU")
find_library( find_library(
FORTRAN_gfortran_LIBRARY FORTRAN_gfortran_LIBRARY
NAMES gfortran NAMES gfortran
HINTS ${_lib_env} HINTS ${_lib_env}
) )
mark_as_advanced(FORTRAN_gfortran_LIBRARY) mark_as_advanced(FORTRAN_gfortran_LIBRARY)
if (FORTRAN_gfortran_LIBRARY) if (FORTRAN_gfortran_LIBRARY)
list(APPEND REQUIRED_LIBS "${FORTRAN_gfortran_LIBRARY}") list(APPEND REQUIRED_LIBS "${FORTRAN_gfortran_LIBRARY}")
endif() endif()
elseif (CMAKE_C_COMPILER_ID MATCHES "Intel") elseif (CMAKE_C_COMPILER_ID MATCHES "Intel")
find_library( find_library(
FORTRAN_ifcore_LIBRARY FORTRAN_ifcore_LIBRARY
NAMES ifcore NAMES ifcore
HINTS ${_lib_env} HINTS ${_lib_env}
) )
mark_as_advanced(FORTRAN_ifcore_LIBRARY) mark_as_advanced(FORTRAN_ifcore_LIBRARY)
if (FORTRAN_ifcore_LIBRARY) if (FORTRAN_ifcore_LIBRARY)
list(APPEND REQUIRED_LIBS "${FORTRAN_ifcore_LIBRARY}") list(APPEND REQUIRED_LIBS "${FORTRAN_ifcore_LIBRARY}")
endif() endif()
endif() endif()
# m # m
find_library(M_LIBRARY NAMES m HINTS ${_lib_env}) find_library(M_LIBRARY NAMES m HINTS ${_lib_env})
mark_as_advanced(M_LIBRARY) mark_as_advanced(M_LIBRARY)
if(M_LIBRARY) if(M_LIBRARY)
list(APPEND REQUIRED_LIBS "-lm") list(APPEND REQUIRED_LIBS "-lm")
endif() endif()
# set required libraries for link # set required libraries for link
set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}") set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}")
set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_LIBRARIES)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LDFLAGS}") list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LDFLAGS}")
foreach(lib_dir ${REQUIRED_LIBDIRS}) foreach(lib_dir ${REQUIRED_LIBDIRS})
list(APPEND CMAKE_REQUIRED_LIBRARIES "-L${lib_dir}") list(APPEND CMAKE_REQUIRED_LIBRARIES "-L${lib_dir}")
endforeach() endforeach()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LIBS}") list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LIBS}")
string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
...@@ -325,21 +327,21 @@ if (LAPACK_FOUND) ...@@ -325,21 +327,21 @@ if (LAPACK_FOUND)
mark_as_advanced(LAPACKE_WORKS) mark_as_advanced(LAPACKE_WORKS)
if(LAPACKE_WORKS) if(LAPACKE_WORKS)
# save link with dependencies # save link with dependencies
set(LAPACKE_LIBRARIES_DEP "${REQUIRED_LIBS}") set(LAPACKE_LIBRARIES_DEP "${REQUIRED_LIBS}")
set(LAPACKE_LIBRARY_DIRS_DEP "${REQUIRED_LIBDIRS}") set(LAPACKE_LIBRARY_DIRS_DEP "${REQUIRED_LIBDIRS}")
set(LAPACKE_INCLUDE_DIRS_DEP "${REQUIRED_INCDIRS}") set(LAPACKE_INCLUDE_DIRS_DEP "${REQUIRED_INCDIRS}")
set(LAPACKE_LINKER_FLAGS "${REQUIRED_LDFLAGS}") set(LAPACKE_LINKER_FLAGS "${REQUIRED_LDFLAGS}")
list(REMOVE_DUPLICATES LAPACKE_LIBRARY_DIRS_DEP) list(REMOVE_DUPLICATES LAPACKE_LIBRARY_DIRS_DEP)
list(REMOVE_DUPLICATES LAPACKE_INCLUDE_DIRS_DEP) list(REMOVE_DUPLICATES LAPACKE_INCLUDE_DIRS_DEP)
list(REMOVE_DUPLICATES LAPACKE_LINKER_FLAGS) list(REMOVE_DUPLICATES LAPACKE_LINKER_FLAGS)
else() else()
if(NOT LAPACKE_FIND_QUIETLY) if(NOT LAPACKE_FIND_QUIETLY)
message(STATUS "Looking for lapacke: test of LAPACKE_dgeqrf with lapacke and lapack libraries fails") message(STATUS "Looking for lapacke: test of LAPACKE_dgeqrf with lapacke and lapack libraries fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}") message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}") message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails") message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif() endif()
endif() endif()
set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS) set(CMAKE_REQUIRED_FLAGS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment