Commit 5551c038 authored by COULAUD Olivier's avatar COULAUD Olivier

Update de morse (February 14th, 2018)

parent 63309ad0
......@@ -34,19 +34,19 @@
if (MORSE_ENABLE_WARNING)
if(CMAKE_C_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fdiagnostics-show-option")
elseif(CMAKE_C_COMPILER_ID MATCHES Intel)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w3 -diag-disable:remark")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fdiagnostics-show-option")
elseif(CMAKE_CXX_COMPILER_ID MATCHES Intel)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w3 -diag-disable:remark")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall -fdiagnostics-show-option")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -warn all -diag-disable:remark")
endif()
......@@ -56,21 +56,21 @@ endif(MORSE_ENABLE_WARNING)
if (MORSE_ENABLE_COVERAGE)
if(CMAKE_C_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -fno-inline --coverage")
else()
message(FATAL_ERROR "Code coverage is only available with the GNU C (gcc)"
"\n compiler, please turn MORSE_ENABLE_COVERAGE OFF\n.")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fno-inline --coverage")
else()
message(FATAL_ERROR "Code coverage is only available with the GNU CXX"
"\n (g++) compiler, please turn MORSE_ENABLE_COVERAGE OFF\n.")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} --coverage")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fPIC -fno-inline --coverage")
else()
message(FATAL_ERROR "Code coverage is only available with the GNU"
"\n Fortran (gfortran) compiler, please turn MORSE_ENABLE_COVERAGE"
......
......@@ -30,6 +30,9 @@
# This include is required to check symbols of libs in the main CMakeLists.txt
include(CheckFunctionExists)
# This include is required to check defines in headers
include(CheckIncludeFiles)
# To colorize messages
#include(ColorizeMessage)
......
......@@ -3,8 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
# @copyright (c) 2012-2016 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
#
......@@ -158,6 +157,10 @@ endif()
# the target receives a -DPRECISION_p in its cflags.
#
include(ParseArguments)
# Add a hint to help Cmake to find the correct python version:
# (see https://cmake.org/cmake/help/v3.0/module/FindPythonInterp.html)
set(Python_ADDITIONAL_VERSIONS 2)
find_package(PythonInterp REQUIRED)
MACRO(precisions_rules_py)
......@@ -237,10 +240,9 @@ MACRO(precisions_rules_py)
COMMAND ${CMAKE_COMMAND} -E remove -f ${_dependency_OUTPUT} && ${pythoncmd} && chmod a-w ${_dependency_OUTPUT}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_dependency_INPUT} ${RP_CODEGEN} ${RP_${CMAKE_PROJECT_NAME}_DICTIONNARY})
set_SOURCE_FILES_PROPERTIES(${_dependency_OUTPUT} PROPERTIES COMPILE_FLAGS "-DPRECISION_${_dependency_PREC}" GENERATED 1 IS_IN_BINARY_DIR 1 )
set_source_files_properties(${_dependency_OUTPUT} PROPERTIES COMPILE_FLAGS "-DPRECISION_${_dependency_PREC}" GENERATED 1 IS_IN_BINARY_DIR 1 )
else( generate_out )
set_SOURCE_FILES_PROPERTIES(${_dependency_OUTPUT} PROPERTIES COMPILE_FLAGS "-DPRECISION_${_dependency_PREC}" GENERATED 0 )
set_source_files_properties(${_dependency_OUTPUT} PROPERTIES COMPILE_FLAGS "-DPRECISION_${_dependency_PREC}" GENERATED 0 )
endif( generate_out )
list(APPEND ${OUTPUTLIST} ${_dependency_OUTPUT})
......
......@@ -3,7 +3,7 @@
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
# All rights reserved.
# @copyright (c) 2012-2016 Inria. All rights reserved.
# @copyright (c) 2012-2018 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -30,7 +30,7 @@
# BLA_STATIC if set on this determines what kind of linkage we do (static)
# BLA_VENDOR if set checks only the specified vendor, if not set checks
# all the possibilities
# BLAS_VENDOR_FOUND stores the BLAS vendor found
# BLAS_VENDOR_FOUND stores the BLAS vendor found
# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DBLAS_DIR=path/to/blas):
......@@ -95,18 +95,18 @@ macro(Print_Find_Library_Blas_Status _libname _lib_to_find)
else()
if(${LIBNAME}_DIR)
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()
message("${Yellow}${_lib_to_find} not found."
"Nor ${LIBNAME}_DIR neither ${LIBNAME}_LIBDIR"
"are defined so that we look for ${_lib_to_find} in"
"system paths (Linux: LD_LIBRARY_PATH, Windows: LIB,"
"Mac: DYLD_LIBRARY_PATH,"
"CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES,"
"CMAKE_C_IMPLICIT_LINK_DIRECTORIES)${ColourReset}")
"Nor ${LIBNAME}_DIR neither ${LIBNAME}_LIBDIR"
"are defined so that we look for ${_lib_to_find} in"
"system paths (Linux: LD_LIBRARY_PATH, Windows: LIB,"
"Mac: DYLD_LIBRARY_PATH,"
"CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES,"
"CMAKE_C_IMPLICIT_LINK_DIRECTORIES)${ColourReset}")
if(_lib_env)
message("${Yellow}${_lib_to_find} has not been found in"
"${_lib_env}${ColourReset}")
message("${Yellow}${_lib_to_find} has not been found in"
"${_lib_env}${ColourReset}")
endif()
endif()
endif()
......@@ -192,11 +192,11 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
list(APPEND _libdir "${BLAS_DIR}")
list(APPEND _libdir "${BLAS_DIR}/lib")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
list(APPEND _libdir "${BLAS_DIR}/lib64")
list(APPEND _libdir "${BLAS_DIR}/lib/intel64")
list(APPEND _libdir "${BLAS_DIR}/lib64")
list(APPEND _libdir "${BLAS_DIR}/lib/intel64")
else()
list(APPEND _libdir "${BLAS_DIR}/lib32")
list(APPEND _libdir "${BLAS_DIR}/lib/ia32")
list(APPEND _libdir "${BLAS_DIR}/lib32")
list(APPEND _libdir "${BLAS_DIR}/lib/ia32")
endif()
elseif(ENV_BLAS_LIBDIR)
list(APPEND _libdir "${ENV_BLAS_LIBDIR}")
......@@ -204,29 +204,29 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
list(APPEND _libdir "${ENV_BLAS_DIR}")
list(APPEND _libdir "${ENV_BLAS_DIR}/lib")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
list(APPEND _libdir "${ENV_BLAS_DIR}/lib64")
list(APPEND _libdir "${ENV_BLAS_DIR}/lib/intel64")
list(APPEND _libdir "${ENV_BLAS_DIR}/lib64")
list(APPEND _libdir "${ENV_BLAS_DIR}/lib/intel64")
else()
list(APPEND _libdir "${ENV_BLAS_DIR}/lib32")
list(APPEND _libdir "${ENV_BLAS_DIR}/lib/ia32")
list(APPEND _libdir "${ENV_BLAS_DIR}/lib32")
list(APPEND _libdir "${ENV_BLAS_DIR}/lib/ia32")
endif()
else()
if (ENV_MKLROOT)
list(APPEND _libdir "${ENV_MKLROOT}/lib")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
list(APPEND _libdir "${ENV_MKLROOT}/lib64")
list(APPEND _libdir "${ENV_MKLROOT}/lib/intel64")
else()
list(APPEND _libdir "${ENV_MKLROOT}/lib32")
list(APPEND _libdir "${ENV_MKLROOT}/lib/ia32")
endif()
list(APPEND _libdir "${ENV_MKLROOT}/lib")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
list(APPEND _libdir "${ENV_MKLROOT}/lib64")
list(APPEND _libdir "${ENV_MKLROOT}/lib/intel64")
else()
list(APPEND _libdir "${ENV_MKLROOT}/lib32")
list(APPEND _libdir "${ENV_MKLROOT}/lib/ia32")
endif()
endif()
if (WIN32)
string(REPLACE ":" ";" _libdir2 "$ENV{LIB}")
string(REPLACE ":" ";" _libdir2 "$ENV{LIB}")
elseif (APPLE)
string(REPLACE ":" ";" _libdir2 "$ENV{DYLD_LIBRARY_PATH}")
string(REPLACE ":" ";" _libdir2 "$ENV{DYLD_LIBRARY_PATH}")
else ()
string(REPLACE ":" ";" _libdir2 "$ENV{LD_LIBRARY_PATH}")
string(REPLACE ":" ";" _libdir2 "$ENV{LD_LIBRARY_PATH}")
endif ()
list(APPEND _libdir "${_libdir2}")
list(APPEND _libdir "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
......@@ -243,30 +243,29 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
if(_libraries_work)
if (BLA_STATIC)
if (WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif ()
if (APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
else ()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif ()
if (WIN32)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif ()
if (APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES})
else ()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif ()
else ()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# for ubuntu's libblas3gf and liblapack3gf packages
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# for ubuntu's libblas3gf and liblapack3gf packages
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
endif ()
endif ()
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
HINTS ${_libdir}
NO_DEFAULT_PATH
)
NAMES ${_library}
HINTS ${_libdir}
)
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
# Print status if not found
# -------------------------
if (NOT ${_prefix}_${_library}_LIBRARY AND NOT BLAS_FIND_QUIETLY AND BLAS_VERBOSE)
Print_Find_Library_Blas_Status(blas ${_library} ${_libdir})
Print_Find_Library_Blas_Status(blas ${_library} ${_libdir})
endif ()
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
set(_libraries_work ${${_prefix}_${_library}_LIBRARY})
......@@ -283,16 +282,16 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
set(CMAKE_REQUIRED_FLAGS "${BLAS_COMPILER_FLAGS}")
if (BLAS_VERBOSE)
message("${Cyan}BLAS libs found for BLA_VENDOR ${BLA_VENDOR}."
"Try to compile symbol ${_name} with following libraries:"
"${CMAKE_REQUIRED_LIBRARIES}")
"Try to compile symbol ${_name} with following libraries:"
"${CMAKE_REQUIRED_LIBRARIES}")
endif ()
if(NOT BLAS_FOUND)
unset(${_prefix}${_combined_name}_WORKS CACHE)
endif()
if (_CHECK_FORTRAN)
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
string(REPLACE "mkl_intel_lp64" "mkl_gf_lp64" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
string(REPLACE "mkl_intel_ilp64" "mkl_gf_ilp64" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
string(REPLACE "mkl_intel_lp64" "mkl_gf_lp64" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
string(REPLACE "mkl_intel_ilp64" "mkl_gf_ilp64" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
endif()
check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
else()
......@@ -348,21 +347,21 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
list(APPEND _inc_env "${ENV_BLAS_DIR}/include")
else()
if (ENV_MKLROOT)
list(APPEND _inc_env "${ENV_MKLROOT}/include")
list(APPEND _inc_env "${ENV_MKLROOT}/include")
endif()
# system variables
if(WIN32)
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}")
list(APPEND _inc_env "${_path_env}")
else()
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{C_INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{CPATH}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{C_INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{CPATH}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}")
endif()
endif()
list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}")
......@@ -378,20 +377,20 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
if(BLAS_INCDIR)
set(BLAS_mkl.h_DIRS "BLAS_mkl.h_DIRS-NOTFOUND")
find_path(BLAS_mkl.h_DIRS
NAMES mkl.h
HINTS ${BLAS_INCDIR})
NAMES mkl.h
HINTS ${BLAS_INCDIR})
else()
if(BLAS_DIR)
set(BLAS_mkl.h_DIRS "BLAS_mkl.h_DIRS-NOTFOUND")
find_path(BLAS_mkl.h_DIRS
NAMES mkl.h
HINTS ${BLAS_DIR}
PATH_SUFFIXES "include")
set(BLAS_mkl.h_DIRS "BLAS_mkl.h_DIRS-NOTFOUND")
find_path(BLAS_mkl.h_DIRS
NAMES mkl.h
HINTS ${BLAS_DIR}
PATH_SUFFIXES "include")
else()
set(BLAS_mkl.h_DIRS "BLAS_mkl.h_DIRS-NOTFOUND")
find_path(BLAS_mkl.h_DIRS
NAMES mkl.h
HINTS ${PATH_TO_LOOK_FOR})
set(BLAS_mkl.h_DIRS "BLAS_mkl.h_DIRS-NOTFOUND")
find_path(BLAS_mkl.h_DIRS
NAMES mkl.h
HINTS ${PATH_TO_LOOK_FOR})
endif()
endif()
mark_as_advanced(BLAS_mkl.h_DIRS)
......@@ -403,7 +402,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
else ()
set(BLAS_INCLUDE_DIRS "BLAS_INCLUDE_DIRS-NOTFOUND")
if(NOT BLAS_FIND_QUIETLY)
message(STATUS "Looking for BLAS -- mkl.h not found")
message(STATUS "Looking for BLAS -- mkl.h not found")
endif()
endif()
......@@ -436,257 +435,259 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
# choose one or another depending on the compilo
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
if (OMP_gomp_LIBRARY)
set(OMP_LIB "${OMP_gomp_LIBRARY}")
set(OMP_LIB "${OMP_gomp_LIBRARY}")
endif()
else(CMAKE_C_COMPILER_ID STREQUAL "Intel")
if (OMP_iomp5_LIBRARY)
set(OMP_LIB "${OMP_iomp5_LIBRARY}")
set(OMP_LIB "${OMP_iomp5_LIBRARY}")
endif()
endif()
if (UNIX AND NOT WIN32)
# m
find_library(M_LIBRARY
NAMES m
HINTS ${_libdir})
NAMES m
HINTS ${_libdir})
mark_as_advanced(M_LIBRARY)
if(M_LIBRARY)
set(LM "-lm")
set(LM "-lm")
else()
set(LM "")
set(LM "")
endif()
# Fortran
set(LGFORTRAN "")
if (CMAKE_C_COMPILER_ID MATCHES "GNU")
find_library(
FORTRAN_gfortran_LIBRARY
NAMES gfortran
HINTS ${_libdir}
)
mark_as_advanced(FORTRAN_gfortran_LIBRARY)
if (FORTRAN_gfortran_LIBRARY)
set(LGFORTRAN "${FORTRAN_gfortran_LIBRARY}")
endif()
find_library(
FORTRAN_gfortran_LIBRARY
NAMES gfortran
HINTS ${_libdir}
)
mark_as_advanced(FORTRAN_gfortran_LIBRARY)
if (FORTRAN_gfortran_LIBRARY)
set(LGFORTRAN "${FORTRAN_gfortran_LIBRARY}")
endif()
elseif (CMAKE_C_COMPILER_ID MATCHES "Intel")
find_library(
FORTRAN_ifcore_LIBRARY
NAMES ifcore
HINTS ${_libdir}
)
mark_as_advanced(FORTRAN_ifcore_LIBRARY)
if (FORTRAN_ifcore_LIBRARY)
set(LGFORTRAN "{FORTRAN_ifcore_LIBRARY}")
endif()
find_library(
FORTRAN_ifcore_LIBRARY
NAMES ifcore
HINTS ${_libdir}
)
mark_as_advanced(FORTRAN_ifcore_LIBRARY)
if (FORTRAN_ifcore_LIBRARY)
set(LGFORTRAN "{FORTRAN_ifcore_LIBRARY}")
endif()
endif()
set(BLAS_COMPILER_FLAGS "")
if (NOT BLA_VENDOR STREQUAL "Intel10_64lp_seq")
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
list(APPEND BLAS_COMPILER_FLAGS "-openmp")
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND BLAS_COMPILER_FLAGS "-fopenmp")
endif()
if(BLAS_FIND_REQUIRED)
find_package(OpenMP REQUIRED)
else()
find_package(OpenMP)
endif()
if(OPENMP_C_FLAGS)
list(APPEND BLAS_COMPILER_FLAGS "${OPENMP_C_FLAGS}")
endif()
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
if (BLA_VENDOR STREQUAL "Intel10_32")
list(APPEND BLAS_COMPILER_FLAGS "-m32")
else()
list(APPEND BLAS_COMPILER_FLAGS "-m64")
endif()
if (NOT BLA_VENDOR STREQUAL "Intel10_64lp_seq")
list(APPEND OMP_LIB "-ldl")
endif()
if (ENV_MKLROOT)
list(APPEND BLAS_COMPILER_FLAGS "-I${ENV_MKLROOT}/include")
endif()
if (BLA_VENDOR STREQUAL "Intel10_32")
list(APPEND BLAS_COMPILER_FLAGS "-m32")
else()
list(APPEND BLAS_COMPILER_FLAGS "-m64")
endif()
if (NOT BLA_VENDOR STREQUAL "Intel10_64lp_seq")
list(APPEND OMP_LIB "-ldl")
endif()
if (ENV_MKLROOT)
list(APPEND BLAS_COMPILER_FLAGS "-I${ENV_MKLROOT}/include")
endif()
endif()
set(additional_flags "")
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 (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
find_package(Threads)
find_package(Threads)
else()
find_package(Threads REQUIRED)
find_package(Threads REQUIRED)
endif()
set(BLAS_SEARCH_LIBS "")
if(BLA_F95)
set(BLAS_mkl_SEARCH_SYMBOL SGEMM)
set(_LIBRARIES BLAS95_LIBRARIES)
if (WIN32)
if (BLA_STATIC)
set(BLAS_mkl_DLL_SUFFIX "")
else()
set(BLAS_mkl_DLL_SUFFIX "_dll")
endif()
# Find the main file (32-bit or 64-bit)
set(BLAS_SEARCH_LIBS_WIN_MAIN "")
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_blas95${BLAS_mkl_DLL_SUFFIX} mkl_intel_c${BLAS_mkl_DLL_SUFFIX}")
endif()
if (BLA_VENDOR STREQUAL "Intel10_64lp*" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_blas95_lp64${BLAS_mkl_DLL_SUFFIX} mkl_intel_lp64${BLAS_mkl_DLL_SUFFIX}")
endif ()
# Add threading/sequential libs
set(BLAS_SEARCH_LIBS_WIN_THREAD "")
if (BLA_VENDOR STREQUAL "*_seq" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"mkl_sequential${BLAS_mkl_DLL_SUFFIX}")
endif()
if (NOT BLA_VENDOR STREQUAL "*_seq" OR BLA_VENDOR STREQUAL "All")
# old version
list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libguide40 mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}")
# mkl >= 10.3
list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libiomp5md mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}")
endif()
# Cartesian product of the above
foreach (MAIN ${BLAS_SEARCH_LIBS_WIN_MAIN})
foreach (THREAD ${BLAS_SEARCH_LIBS_WIN_THREAD})
list(APPEND BLAS_SEARCH_LIBS
"${MAIN} ${THREAD} mkl_core${BLAS_mkl_DLL_SUFFIX}")
endforeach()
endforeach()
else (WIN32)
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 ()
if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
# old version
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95 mkl_intel_lp64 mkl_intel_thread mkl_core guide")
# mkl >= 10.3
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core")
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_intel_lp64 mkl_gnu_thread mkl_core")
endif()
endif ()
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_sequential mkl_core")
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq")
set(OMP_LIB "")
endif()
endif ()
endif (WIN32)
set(BLAS_mkl_SEARCH_SYMBOL SGEMM)
set(_LIBRARIES BLAS95_LIBRARIES)
if (WIN32)
if (BLA_STATIC)
set(BLAS_mkl_DLL_SUFFIX "")
else()
set(BLAS_mkl_DLL_SUFFIX "_dll")
endif()
# Find the main file (32-bit or 64-bit)
set(BLAS_SEARCH_LIBS_WIN_MAIN "")
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_blas95${BLAS_mkl_DLL_SUFFIX} mkl_intel_c${BLAS_mkl_DLL_SUFFIX}")
endif()
if (BLA_VENDOR STREQUAL "Intel10_64lp*" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS_WIN_MAIN
"mkl_blas95_lp64${BLAS_mkl_DLL_SUFFIX} mkl_intel_lp64${BLAS_mkl_DLL_SUFFIX}")
endif ()
# Add threading/sequential libs
set(BLAS_SEARCH_LIBS_WIN_THREAD "")
if (BLA_VENDOR STREQUAL "*_seq" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"mkl_sequential${BLAS_mkl_DLL_SUFFIX}")
endif()
if (NOT BLA_VENDOR STREQUAL "*_seq" OR BLA_VENDOR STREQUAL "All")
# old version
list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libguide40 mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}")
# mkl >= 10.3
list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD
"libiomp5md mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}")
endif()
# Cartesian product of the above
foreach (MAIN ${BLAS_SEARCH_LIBS_WIN_MAIN})
foreach (THREAD ${BLAS_SEARCH_LIBS_WIN_THREAD})
list(APPEND BLAS_SEARCH_LIBS
"${MAIN} ${THREAD} mkl_core${BLAS_mkl_DLL_SUFFIX}")
endforeach()
endforeach()
else (WIN32)
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 ()
if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
# old version
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95 mkl_intel_lp64 mkl_intel_thread mkl_core guide")
# mkl >= 10.3
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core")
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_intel_lp64 mkl_gnu_thread mkl_core")
endif()
endif ()
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_sequential mkl_core")
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq")
set(OMP_LIB "")
endif()
endif ()
endif (WIN32)
else (BLA_F95)
set(BLAS_mkl_SEARCH_SYMBOL sgemm)
set(_LIBRARIES BLAS_LIBRARIES)
if (WIN32)
if (BLA_STATIC)