Commit 99cb6095 authored by PRUVOST Florent's avatar PRUVOST Florent

add a MORSE_VERBOSE mode to activate or not hints during the detection -...

add a MORSE_VERBOSE mode to activate or not hints during the detection - remove specific print functions inside Finds (should remain generic) - upgrade FindBLAS
parent 35a3a1f8
This diff is collapsed.
......@@ -36,9 +36,15 @@ include(ColorizeMessage)
# To find headers and libs
include(FindHeadersAndLibs)
# Some macros to print status when search for headers and libs
# PrintFindStatus.cmake is in cmake_modules/morse/find directory
include(PrintFindStatus)
# Add the path where we handle our FindFOO.cmake to seek for liraries
list(APPEND CMAKE_MODULE_PATH ${MORSE_CMAKE_MODULE_PATH}/find)
option(MORSE_VERBOSE "CMake configure is verbose" OFF)
##
## @end file MorseInit.cmake
##
This diff is collapsed.
......@@ -41,10 +41,6 @@
# License text for the above reference.)
# Some macros to print status when search for headers and libs
# PrintFindStatus.cmake is in cmake_modules/morse/find directory
include(PrintFindStatus)
# add a cache variable to let the user specify the BLAS vendor
set(BLA_VENDOR "" CACHE STRING "list of possible BLAS vendor:
Goto, ATLAS PhiPACK, CXML, DXML, SunPerf, SCSL, SGIMATH, IBMESSL,
......@@ -77,16 +73,26 @@ if(BLA_VENDOR STREQUAL "All" AND
if(BLAS_mkl_intel_lp64_LIBRARY)
set(BLA_VENDOR "Intel10_64lp")
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")
endif()
set(BLAS_FOUND "")
elseif(BLA_VENDOR STREQUAL "All" AND BLAS_acml_LIBRARY)
set(BLA_VENDOR "ACML")
endif()
# Intel case
if(BLA_VENDOR MATCHES "Intel*")
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."
"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"
......@@ -98,6 +104,12 @@ if(BLA_VENDOR MATCHES "Intel*")
"Intel( older versions of mkl 32 and 64 bit),"
"ACML, ACML_MP, ACML_GPU, Apple, NAS, Generic")
endif()
set(BLAS_FOUND "")
endif()
# Intel case
if(BLA_VENDOR MATCHES "Intel*")
###
# look for include path if the BLAS vendor is Intel
###
......@@ -123,27 +135,30 @@ if(BLA_VENDOR MATCHES "Intel*")
# find mkl.h inside known include paths
set(BLAS_mkl.h_INCLUDE_DIRS "BLAS_mkl.h_INCLUDE_DIRS-NOTFOUND")
if(BLAS_INCDIR)
set(BLAS_mkl.h_INCLUDE_DIRS "BLAS_mkl.h_INCLUDE_DIRS-NOTFOUND")
find_path(BLAS_mkl.h_INCLUDE_DIRS
NAMES mkl.h
HINTS ${BLAS_INCDIR})
else()
if(BLAS_DIR)
set(BLAS_mkl.h_INCLUDE_DIRS "BLAS_mkl.h_INCLUDE_DIRS-NOTFOUND")
find_path(BLAS_mkl.h_INCLUDE_DIRS
NAMES mkl.h
HINTS ${BLAS_DIR}
PATH_SUFFIXES include)
else()
set(BLAS_mkl.h_INCLUDE_DIRS "BLAS_mkl.h_INCLUDE_DIRS-NOTFOUND")
find_path(BLAS_mkl.h_INCLUDE_DIRS
NAMES mkl.h
HINTS ${_inc_env})
endif()
endif()
mark_as_advanced(BLAS_mkl.h_INCLUDE_DIRS)
# Print status if not found
# -------------------------
if (NOT BLAS_mkl.h_INCLUDE_DIRS)
Print_Find_Header_Status(blas mkl.h)
endif ()
## Print status if not found
## -------------------------
#if (NOT BLAS_mkl.h_INCLUDE_DIRS AND MORSE_VERBOSE)
# Print_Find_Header_Status(blas mkl.h)
#endif ()
set(BLAS_INCLUDE_DIRS "")
if(BLAS_mkl.h_INCLUDE_DIRS)
list(APPEND BLAS_INCLUDE_DIRS "${BLAS_mkl.h_INCLUDE_DIRS}" )
......@@ -157,6 +172,9 @@ if(BLA_VENDOR MATCHES "Intel*")
## look for the sequential version
set(BLA_VENDOR "Intel10_64lp_seq")
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "Look for the sequential version Intel10_64lp_seq")
endif()
# if(NOT BLAS_FOUND AND BLASEXT_FIND_REQUIRED)
if(BLASEXT_FIND_REQUIRED)
find_package(BLAS REQUIRED)
......@@ -171,6 +189,9 @@ if(BLA_VENDOR MATCHES "Intel*")
## look for the multithreaded version
set(BLA_VENDOR "Intel10_64lp")
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "Look for the multithreaded version Intel10_64lp")
endif()
find_package(BLAS)
if(BLAS_FOUND)
set(BLAS_PAR_LIBRARIES "${BLAS_LIBRARIES}")
......@@ -191,21 +212,6 @@ if(BLA_VENDOR MATCHES "Intel*")
# ACML case
elseif(BLA_VENDOR MATCHES "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")
endif()
## look for the sequential version
set(BLA_VENDOR "ACML")
if(BLASEXT_FIND_REQUIRED)
......
......@@ -14,21 +14,21 @@
# [REQUIRED] # Fail with error if cblas is not found
# [COMPONENTS <libs>...] # required dependencies
# )
# This module finds headers and cblas library.
# This module finds headers and cblas library.
# Results are reported in variables:
# CBLAS_FOUND - True if headers and requested libraries were found
# CBLAS_INCLUDE_DIRS - cblas include directories
# CBLAS_LIBRARY_DIRS - Link directories for cblas libraries
# CBLAS_LIBRARIES - cblas component libraries to be linked
# The user can give specific paths where to find the libraries adding cmake
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DCBLAS_DIR=path/to/cblas):
# CBLAS_DIR - Where to find the base directory of cblas
# CBLAS_INCDIR - Where to find the header files
# CBLAS_LIBDIR - Where to find the library files
# CBLAS could be directly embedded in BLAS library (ex: Intel MKL) so that
# we test a cblas function with the blas libraries found and set CBLAS
# variables to BLAS ones if test is successful. To skip this feature and
# look for a stand alone cblas, please add the following in your
# CBLAS could be directly embedded in BLAS library (ex: Intel MKL) so that
# we test a cblas function with the blas libraries found and set CBLAS
# variables to BLAS ones if test is successful. To skip this feature and
# look for a stand alone cblas, please add the following in your
# CMakeLists.txt before to call find_package(CBLAS):
# set(CBLAS_STANDALONE TRUE)
......@@ -50,10 +50,6 @@
# License text for the above reference.)
# Some macros to print status when search for headers and libs
# PrintFindStatus.cmake is in cmake_modules/morse/find directory
include(PrintFindStatus)
# CBLAS depends on BLAS
# try to find it specified as COMPONENTS during the call
if (CBLAS_FIND_COMPONENTS)
......@@ -83,7 +79,7 @@ if (BLAS_FOUND)
check_function_exists(cblas_dscal CBLAS_WORKS)
mark_as_advanced(CBLAS_WORKS)
set(CMAKE_REQUIRED_LIBRARIES)
if(CBLAS_WORKS)
if(NOT CBLAS_FIND_QUIETLY)
message(STATUS "Looking for cblas: test with blas succeeds")
......@@ -96,17 +92,17 @@ if (BLAS_FOUND)
endif()
endif()
endif (NOT CBLAS_STANDALONE)
if (CBLAS_STANDALONE OR NOT CBLAS_WORKS)
if(NOT CBLAS_WORKS AND NOT CBLAS_FIND_QUIETLY)
message(STATUS "Looking for cblas : test with blas fails")
endif()
# test fails: try to find CBLAS lib exterior to BLAS
# Try to find CBLAS lib
#######################
# Looking for include
# -------------------
......@@ -153,12 +149,6 @@ if (BLAS_FOUND)
endif()
endif()
mark_as_advanced(CBLAS_cblas.h_DIRS)
# Print status if not found
# -------------------------
if (NOT CBLAS_cblas.h_DIRS)
Print_Find_Header_Status(cblas cblas.h)
endif ()
# If found, add path to cmake variable
# ------------------------------------
......@@ -215,12 +205,6 @@ if (BLAS_FOUND)
endif()
endif()
mark_as_advanced(CBLAS_cblas_LIBRARY)
# Print status if not found
# -------------------------
if (NOT CBLAS_cblas_LIBRARY AND NOT CBLAS_FIND_QUIETLY)
Print_Find_Library_Status(cblas libcblas)
endif ()
# If found, add path to cmake variable
# ------------------------------------
......@@ -236,16 +220,16 @@ if (BLAS_FOUND)
message(STATUS "Looking for cblas -- lib cblas not found")
endif()
endif ()
endif (CBLAS_STANDALONE OR NOT CBLAS_WORKS)
else(BLAS_FOUND)
if (NOT CBLAS_FIND_QUIETLY)
if (NOT CBLAS_FIND_QUIETLY OR NOT MORSE_VERBOSE)
message(STATUS "CBLAS requires BLAS but BLAS has not been found."
"Please look for BLAS first.")
endif()
endif(BLAS_FOUND)
......
......@@ -12,13 +12,13 @@
# Use this module by invoking find_package with the form:
# find_package(FXT
# [REQUIRED]) # Fail with error if fxt is not found
# This module finds headers and fxt library.
# This module finds headers and fxt library.
# Results are reported in variables:
# FXT_FOUND - True if headers and requested libraries were found
# FXT_INCLUDE_DIRS - fxt include directories
# FXT_LIBRARY_DIRS - Link directories for fxt libraries
# FXT_LIBRARIES - fxt component libraries to be linked
# The user can give specific paths where to find the libraries adding cmake
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DFXT_DIR=path/to/fxt):
# FXT_DIR - Where to find the base directory of fxt
# FXT_INCDIR - Where to find the header files
......@@ -42,10 +42,6 @@
# License text for the above reference.)
# Some macros to print status when search for headers and libs
# PrintFindStatus.cmake is in cmake_modules/morse/find directory
include(PrintFindStatus)
# Optionally use pkg-config to detect include/library dirs (if pkg-config is available)
# -------------------------------------------------------------------------------------
include(FindPkgConfig)
......@@ -56,11 +52,11 @@ if(PKG_CONFIG_EXECUTABLE)
if (NOT FXT_FIND_QUIETLY)
if (FXT_FOUND AND FXT_LIBRARIES)
message(STATUS "Looking for FXT - found using PkgConfig")
if(NOT FXT_INCLUDE_DIRS)
message("${Magenta}FXT_INCLUDE_DIRS is empty using PkgConfig."
"Perhaps the path to fxt headers is already present in your"
"C(PLUS)_INCLUDE_PATH environment variable.${ColourReset}")
endif()
#if(NOT FXT_INCLUDE_DIRS)
# message("${Magenta}FXT_INCLUDE_DIRS is empty using PkgConfig."
# "Perhaps the path to fxt headers is already present in your"
# "C(PLUS)_INCLUDE_PATH environment variable.${ColourReset}")
#endif()
else()
message("${Magenta}Looking for FXT - not found using PkgConfig."
"Perhaps you should add the directory containing fxt.pc to the"
......@@ -78,7 +74,7 @@ if(NOT FXT_FOUND OR NOT FXT_LIBRARIES)
# Looking for include
# -------------------
# Add system include paths to search include
# ------------------------------------------
unset(_inc_env)
......@@ -97,7 +93,7 @@ if(NOT FXT_FOUND OR NOT FXT_LIBRARIES)
list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}")
list(APPEND _inc_env "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}")
list(REMOVE_DUPLICATES _inc_env)
# Try to find the fxt header in the given paths
# -------------------------------------------------
# call cmake macro to find the header path
......@@ -121,13 +117,7 @@ if(NOT FXT_FOUND OR NOT FXT_LIBRARIES)
endif()
endif()
mark_as_advanced(FXT_fxt.h_DIRS)
# Print status if not found
# -------------------------
if (NOT FXT_fxt.h_DIRS AND NOT FXT_FIND_QUIETLY)
Print_Find_Header_Status(fxt fxt.h)
endif ()
# Add path to cmake variable
# ------------------------------------
if (FXT_fxt.h_DIRS)
......@@ -138,15 +128,15 @@ if(NOT FXT_FOUND OR NOT FXT_LIBRARIES)
message(STATUS "Looking for fxt -- fxt.h not found")
endif()
endif ()
if (FXT_INCLUDE_DIRS)
list(REMOVE_DUPLICATES FXT_INCLUDE_DIRS)
endif ()
# Looking for lib
# ---------------
# Add system library paths to search lib
# --------------------------------------
unset(_lib_env)
......@@ -162,10 +152,10 @@ if(NOT FXT_FOUND OR NOT FXT_LIBRARIES)
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
endif()
list(REMOVE_DUPLICATES _lib_env)
# Try to find the fxt lib in the given paths
# ----------------------------------------------
# call cmake macro to find the lib path
if(FXT_LIBDIR)
set(FXT_fxt_LIBRARY "FXT_fxt_LIBRARY-NOTFOUND")
......@@ -187,13 +177,7 @@ if(NOT FXT_FOUND OR NOT FXT_LIBRARIES)
endif()
endif()
mark_as_advanced(FXT_fxt_LIBRARY)
# Print status if not found
# -------------------------
if (NOT FXT_fxt_LIBRARY AND NOT FXT_FIND_QUIETLY)
Print_Find_Library_Status(fxt libfxt)
endif ()
# If found, add path to cmake variable
# ------------------------------------
if (FXT_fxt_LIBRARY)
......@@ -208,7 +192,7 @@ if(NOT FXT_FOUND OR NOT FXT_LIBRARIES)
message(STATUS "Looking for fxt -- lib fxt not found")
endif()
endif ()
if (FXT_LIBRARY_DIRS)
list(REMOVE_DUPLICATES FXT_LIBRARY_DIRS)
endif ()
......
......@@ -12,13 +12,13 @@
# Use this module by invoking find_package with the form:
# find_package(HWLOC
# [REQUIRED]) # Fail with error if hwloc is not found
# This module finds headers and hwloc library.
# This module finds headers and hwloc library.
# Results are reported in variables:
# HWLOC_FOUND - True if headers and requested libraries were found
# HWLOC_INCLUDE_DIRS - hwloc include directories
# HWLOC_LIBRARY_DIRS - Link directories for hwloc libraries
# HWLOC_LIBRARIES - hwloc component libraries to be linked
# The user can give specific paths where to find the libraries adding cmake
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DHWLOC_DIR=path/to/hwloc):
# HWLOC_DIR - Where to find the base directory of hwloc
# HWLOC_INCDIR - Where to find the header files
......@@ -42,10 +42,6 @@
# License text for the above reference.)
# Some macros to print status when search for headers and libs
# PrintFindStatus.cmake is in cmake_modules/morse/find directory
include(PrintFindStatus)
# Optionally use pkg-config to detect include/library dirs (if pkg-config is available)
# -------------------------------------------------------------------------------------
include(FindPkgConfig)
......@@ -56,11 +52,11 @@ if(PKG_CONFIG_EXECUTABLE)
if (NOT HWLOC_FIND_QUIETLY)
if (HWLOC_FOUND AND HWLOC_LIBRARIES)
message(STATUS "Looking for HWLOC - found using PkgConfig")
if(NOT HWLOC_INCLUDE_DIRS)
message("${Magenta}HWLOC_INCLUDE_DIRS is empty using PkgConfig."
"Perhaps the path to hwloc headers is already present in your"
"C(PLUS)_INCLUDE_PATH environment variable.${ColourReset}")
endif()
#if(NOT HWLOC_INCLUDE_DIRS)
# message("${Magenta}HWLOC_INCLUDE_DIRS is empty using PkgConfig."
# "Perhaps the path to hwloc headers is already present in your"
# "C(PLUS)_INCLUDE_PATH environment variable.${ColourReset}")
#endif()
else()
message("${Magenta}Looking for HWLOC - not found using PkgConfig."
"Perhaps you should add the directory containing hwloc.pc to"
......@@ -78,7 +74,7 @@ if(NOT HWLOC_FOUND OR NOT HWLOC_LIBRARIES)
# Looking for include
# -------------------
# Add system include paths to search include
# ------------------------------------------
unset(_inc_env)
......@@ -97,10 +93,10 @@ if(NOT HWLOC_FOUND OR NOT HWLOC_LIBRARIES)
list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}")
list(APPEND _inc_env "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}")
list(REMOVE_DUPLICATES _inc_env)
# set paths where to look for
set(PATH_TO_LOOK_FOR "${_inc_env}")
# Try to find the hwloc header in the given paths
# -------------------------------------------------
# call cmake macro to find the header path
......@@ -124,13 +120,7 @@ if(NOT HWLOC_FOUND OR NOT HWLOC_LIBRARIES)
endif()
endif()
mark_as_advanced(HWLOC_hwloc.h_DIRS)
# Print status if not found
# -------------------------
if (NOT HWLOC_hwloc.h_DIRS AND NOT HWLOC_FIND_QUIETLY)
Print_Find_Header_Status(hwloc hwloc.h)
endif ()
# Add path to cmake variable
# ------------------------------------
if (HWLOC_hwloc.h_DIRS)
......@@ -141,15 +131,15 @@ if(NOT HWLOC_FOUND OR NOT HWLOC_LIBRARIES)
message(STATUS "Looking for hwloc -- hwloc.h not found")
endif()
endif ()
if (HWLOC_INCLUDE_DIRS)
list(REMOVE_DUPLICATES HWLOC_INCLUDE_DIRS)
endif ()
# Looking for lib
# ---------------
# Add system library paths to search lib
# --------------------------------------
unset(_lib_env)
......@@ -165,13 +155,13 @@ if(NOT HWLOC_FOUND OR NOT HWLOC_LIBRARIES)
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
endif()
list(REMOVE_DUPLICATES _lib_env)
# set paths where to look for
set(PATH_TO_LOOK_FOR "${_lib_env}")
# Try to find the hwloc lib in the given paths
# ----------------------------------------------
# call cmake macro to find the lib path
if(HWLOC_LIBDIR)
set(HWLOC_hwloc_LIBRARY "HWLOC_hwloc_LIBRARY-NOTFOUND")
......@@ -186,20 +176,14 @@ if(NOT HWLOC_FOUND OR NOT HWLOC_LIBRARIES)
HINTS ${HWLOC_DIR}
PATH_SUFFIXES lib lib32 lib64)
else()
set(HWLOC_hwloc_LIBRARY "HWLOC_hwloc_LIBRARY-NOTFOUND")
set(HWLOC_hwloc_LIBRARY "HWLOC_hwloc_LIBRARY-NOTFOUND")
find_library(HWLOC_hwloc_LIBRARY
NAMES hwloc
HINTS ${PATH_TO_LOOK_FOR})
endif()
endif()
mark_as_advanced(HWLOC_hwloc_LIBRARY)
# Print status if not found
# -------------------------
if (NOT HWLOC_hwloc_LIBRARY AND NOT HWLOC_FIND_QUIETLY)
Print_Find_Library_Status(hwloc libhwloc)
endif ()
# If found, add path to cmake variable
# ------------------------------------
if (HWLOC_hwloc_LIBRARY)
......@@ -214,7 +198,7 @@ if(NOT HWLOC_FOUND OR NOT HWLOC_LIBRARIES)
message(STATUS "Looking for hwloc -- lib hwloc not found")
endif()
endif ()
if (HWLOC_LIBRARY_DIRS)
list(REMOVE_DUPLICATES HWLOC_LIBRARY_DIRS)
endif ()
......
This diff is collapsed.
......@@ -14,21 +14,21 @@
# [REQUIRED] # Fail with error if lapacke is not found
# [COMPONENTS <libs>...] # required dependencies
# )
# This module finds headers and lapacke library.
# This module finds headers and lapacke library.
# Results are reported in variables:
# LAPACKE_FOUND - True if headers and requested libraries were found
# LAPACKE_INCLUDE_DIRS - lapacke include directories
# LAPACKE_LIBRARY_DIRS - Link directories for lapacke libraries
# LAPACKE_LIBRARIES - lapacke component libraries to be linked
# The user can give specific paths where to find the libraries adding cmake
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DLAPACKE_DIR=path/to/lapacke):
# LAPACKE_DIR - Where to find the base directory of lapacke
# LAPACKE_INCDIR - Where to find the header files
# LAPACKE_LIBDIR - Where to find the library files
# LAPACKE could be directly embedded in LAPACK library (ex: Intel MKL) so that
# we test a lapacke function with the lapack libraries found and set LAPACKE
# variables to LAPACK ones if test is successful. To skip this feature and
# look for a stand alone lapacke, please add the following in your
# LAPACKE could be directly embedded in LAPACK library (ex: Intel MKL) so that
# we test a lapacke function with the lapack libraries found and set LAPACKE
# variables to LAPACK ones if test is successful. To skip this feature and
# look for a stand alone lapacke, please add the following in your
# CMakeLists.txt before to call find_package(LAPACKE):
# set(LAPACKE_STANDALONE TRUE)
......@@ -50,10 +50,6 @@
# License text for the above reference.)
# Some macros to print status when search for headers and libs
# PrintFindStatus.cmake is in cmake_modules/morse/find directory
include(PrintFindStatus)
# LAPACKE depends on LAPACK
# try to find it specified as COMPONENTS during the call
if (LAPACKE_FIND_COMPONENTS)
......@@ -83,7 +79,7 @@ if (LAPACK_FOUND)
check_function_exists(LAPACKE_dgeqrf LAPACKE_WORKS)
mark_as_advanced(LAPACKE_WORKS)
set(CMAKE_REQUIRED_LIBRARIES)
if(LAPACKE_WORKS)
if(NOT LAPACKE_FIND_QUIETLY)
message(STATUS "Looking for lapacke: test with lapack succeeds")
......@@ -96,17 +92,17 @@ if (LAPACK_FOUND)
endif()
endif()
endif (NOT LAPACKE_STANDALONE)
if (LAPACKE_STANDALONE OR NOT LAPACKE_WORKS)
if(NOT LAPACKE_WORKS AND NOT LAPACKE_FIND_QUIETLY)
message(STATUS "Looking for lapacke : test with lapack fails")
endif()
# test fails: try to find LAPACKE lib exterior to LAPACK
# Try to find LAPACKE lib
#######################
# Looking for include
# -------------------
......@@ -153,12 +149,6 @@ if (LAPACK_FOUND)
endif()
endif()
mark_as_advanced(LAPACKE_lapacke.h_DIRS)
# Print status if not found
# -------------------------
if (NOT LAPACKE_lapacke.h_DIRS)
Print_Find_Header_Status(lapacke lapacke.h)
endif ()
# If found, add path to cmake variable
# ------------------------------------
......@@ -215,12 +205,6 @@ if (LAPACK_FOUND)
endif()
endif()
mark_as_advanced(LAPACKE_lapacke_LIBRARY)
# Print status if not found
# -------------------------
if (NOT LAPACKE_lapacke_LIBRARY AND NOT LAPACKE_FIND_QUIETLY)
Print_Find_Library_Status(lapacke liblapacke)
endif ()
# If found, add path to cmake variable
# ------------------------------------
......@@ -236,16 +220,16 @@ if (LAPACK_FOUND)
message(STATUS "Looking for lapacke -- lib lapacke not found")
endif()
endif ()
endif (LAPACKE_STANDALONE OR NOT LAPACKE_WORKS)
else(LAPACK_FOUND)
if (NOT LAPACKE_FIND_QUIETLY)
message(STATUS "LAPACKE requires LAPACK but LAPACK has not been found."
"Please look for LAPACK first.")
endif()
endif(LAPACK_FOUND)
......
......@@ -11,14 +11,14 @@
# - Find LAPACK EXTENDED for MORSE projects: find include dirs and libraries
#
# 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
# 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_LIBRARIES does not exists anymore.
#
# The following variables have been added to manage links with sequential or multithreaded
# The following variables have been added to manage links with sequential or multithreaded
# versions:
# LAPACK_INCLUDE_DIRS - LAPACK include directories
# LAPACK_LIBRARY_DIRS - Link directories for LAPACK libraries
......@@ -43,10 +43,6 @@
# License text for the above reference.)
# Some macros to print status when search for headers and libs
# PrintFindStatus.cmake is in cmake_modules/morse/find directory
include(PrintFindStatus)
# LAPACKEXT depends on BLASEXT
# call our extended module for BLAS
#----------------------------------
......@@ -64,7 +60,7 @@ if(BLA_VENDOR MATCHES "Intel*")
###
# look for include path if the LAPACK vendor is Intel
###
# gather system include paths
unset(_inc_env)
if(WIN32)
......@@ -82,13 +78,13 @@ if(BLA_VENDOR MATCHES "Intel*")
list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}")
list(APPEND _inc_env "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}")
list(REMOVE_DUPLICATES _inc_env)
if (BLAS_DIR)
set(LAPACK_DIR ${BLAS_DIR})
endif ()
if (BLAS_INCDIR)
set(LAPACK_INCDIR ${BLAS_INCDIR})
endif ()
endif ()
# find mkl.h inside known include paths
set(LAPACK_mkl_lapack.h_INCLUDE_DIRS "LAPACK_mkl_lapack.h_INCLUDE_DIRS-NOTFOUND")
if(LAPACK_INCDIR)
......@@ -106,50 +102,50 @@ if(BLA_VENDOR MATCHES "Intel*")
NAMES mkl_lapack.h
HINTS ${_inc_env})
endif()
endif()
endif()
mark_as_advanced(LAPACK_mkl_lapack.h_INCLUDE_DIRS)
# Print status if not found
# -------------------------
if (NOT LAPACK_mkl_lapack.h_INCLUDE_DIRS)
Print_Find_Header_Status(lapack mkl_lapack.h)
endif ()
## Print status if not found
## -------------------------
#if (NOT LAPACK_mkl_lapack.h_INCLUDE_DIRS)
# Print_Find_Header_Status(lapack mkl_lapack.h)
#endif ()
set(LAPACK_INCLUDE_DIRS "")
if(LAPACK_mkl_lapack.h_INCLUDE_DIRS)
list(APPEND LAPACK_INCLUDE_DIRS "${LAPACK_mkl_lapack.h_INCLUDE_DIRS}" )
endif()
###
# look for libs
###
if (BLA_VENDOR MATCHES "Intel10_64lp*")
## look for the sequential version
set(BLA_VENDOR "Intel10_64lp_seq")
endif()
if(LAPACKEXT_FIND_REQUIRED)
find_package(LAPACK REQUIRED)
else()
find_package(LAPACK)
endif()
if (LAPACK_FOUND)