...
 
Commits (27)
This diff is collapsed.
......@@ -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"
......
......@@ -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-2014 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.
#
###
......@@ -18,7 +18,7 @@
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @version 1.0.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
......@@ -28,28 +28,27 @@
###
# Set some colors
#if(NOT WIN32)
# string(ASCII 27 Esc)
# set(ColourReset "${Esc}[m")
# set(ColourBold "${Esc}[1m")
# set(Red "${Esc}[31m")
# set(Green "${Esc}[32m")
# set(Yellow "${Esc}[33m")
# set(Blue "${Esc}[34m")
# set(Magenta "${Esc}[35m")
# set(Cyan "${Esc}[36m")
# set(White "${Esc}[37m")
# set(BoldRed "${Esc}[1;31m")
# set(BoldGreen "${Esc}[1;32m")
# set(BoldYellow "${Esc}[1;33m")
# set(BoldBlue "${Esc}[1;34m")
# set(BoldMagenta "${Esc}[1;35m")
# set(BoldCyan "${Esc}[1;36m")
# set(BoldWhite "${Esc}[1;37m")
#endif()
if(NOT WIN32)
string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(ColourBold "${Esc}[1m")
set(Red "${Esc}[31m")
set(Green "${Esc}[32m")
set(Yellow "${Esc}[33m")
set(Blue "${Esc}[34m")
set(Magenta "${Esc}[35m")
set(Cyan "${Esc}[36m")
set(White "${Esc}[37m")
set(BoldRed "${Esc}[1;31m")
set(BoldGreen "${Esc}[1;32m")
set(BoldYellow "${Esc}[1;33m")
set(BoldBlue "${Esc}[1;34m")
set(BoldMagenta "${Esc}[1;35m")
set(BoldCyan "${Esc}[1;36m")
set(BoldWhite "${Esc}[1;37m")
# Colorize cmake messages during configure
function(message)
# Colorize cmake messages during configure
function(message)
list(GET ARGV 0 MessageType)
if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
list(REMOVE_AT ARGV 0)
......@@ -72,7 +71,8 @@ function(message)
string (REPLACE "${Esc}[1 " "${Esc}[1;" ARGV_STR "${ARGV_STR}")
_message("${ARGV_STR}")
endif()
endfunction()
endfunction()
endif()
##
## @end file ColorizeMessage.cmake
......
......@@ -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.
#
###
......@@ -18,7 +18,7 @@
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 0.9.0
# @version 1.0.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
......@@ -27,11 +27,25 @@
#
###
# Global Morse options
option(MORSE_ENABLE_WARNING "Enable warning messages" OFF)
option(MORSE_ENABLE_COVERAGE "Enable flags for coverage test" OFF)
option(MORSE_ENABLE_COLOR_MESSAGE "Enable colors in messages" OFF)
#option(MORSE_VERBOSE_FIND_PACKAGE "Add additional messages concerning packages not found" OFF)
#message(STATUS "MORSE_VERBOSE_FIND_PACKAGE is set to OFF, turn it ON to get"
# " information about packages not found")
# This include is required to check symbols of libs in the main CMakeLists.txt
include(CheckFunctionExists)
# To colorize messages
#include(ColorizeMessage)
# This include is required to check defines in headers
include(CheckIncludeFiles)
if (MORSE_ENABLE_COLOR_MESSAGE)
# colorize messages
include(ColorizeMessage)
endif()
# To find headers and libs
include(FindHeadersAndLibs)
......@@ -49,12 +63,6 @@ include(Ressources)
# 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_ENABLE_WARNING "Enable warning messages" OFF)
option(MORSE_ENABLE_COVERAGE "Enable flags for coverage test" OFF)
#option(MORSE_VERBOSE_FIND_PACKAGE "Add additional messages concerning packages not found" OFF)
#message(STATUS "MORSE_VERBOSE_FIND_PACKAGE is set to OFF, turn it ON to get"
# " information about packages not found")
##
## @end file MorseInit.cmake
##
......@@ -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,6 +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
# 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):
......@@ -259,7 +260,6 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
HINTS ${_libdir}
NO_DEFAULT_PATH
)
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
# Print status if not found
......@@ -479,11 +479,13 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
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")
if(BLAS_FIND_REQUIRED)
find_package(OpenMP REQUIRED)
else()
find_package(OpenMP)
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
list(APPEND BLAS_COMPILER_FLAGS "-fopenmp")
if(OPENMP_C_FLAGS)
list(APPEND BLAS_COMPILER_FLAGS "${OPENMP_C_FLAGS}")
endif()
endif()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
......@@ -687,10 +689,6 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endforeach ()
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
endif(NOT BLAS_LIBRARIES OR BLA_VENDOR MATCHES "Intel*")
if(NOT BLAS_FIND_QUIETLY)
if(${_LIBRARIES})
message(STATUS "Looking for MKL BLAS: found")
......@@ -698,7 +696,11 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
message(STATUS "Looking for MKL BLAS: not found")
endif()
endif()
if (${_LIBRARIES} AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Intel MKL")
endif()
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
endif(NOT BLAS_LIBRARIES OR BLA_VENDOR MATCHES "Intel*")
endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
......@@ -722,6 +724,9 @@ if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Goto")
endif()
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
......@@ -747,6 +752,9 @@ if (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Openblas")
endif()
endif (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
......@@ -765,7 +773,7 @@ if (BLA_VENDOR STREQUAL "Eigen" OR BLA_VENDOR STREQUAL "All")
""
)
if(NOT BLAS_FIND_QUIETLY)
if(BLAS_LIBRARIES)
if(BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
message(STATUS "Looking for Eigen BLAS: found")
else()
message(STATUS "Looking for Eigen BLAS: not found")
......@@ -791,6 +799,9 @@ if (BLA_VENDOR STREQUAL "Eigen" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Eigen")
endif()
endif (BLA_VENDOR STREQUAL "Eigen" OR BLA_VENDOR STREQUAL "All")
......@@ -816,6 +827,10 @@ if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Atlas")
endif()
endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All")
......@@ -840,6 +855,10 @@ if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "PhiPACK")
endif()
endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All")
......@@ -864,6 +883,10 @@ if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "CXML")
endif()
endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All")
......@@ -888,6 +911,10 @@ if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "DXML")
endif()
endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All")
......@@ -915,6 +942,10 @@ if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "SunPerf")
endif()
endif ()
......@@ -939,6 +970,10 @@ if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "SunPerf")
endif()
endif ()
......@@ -963,6 +998,10 @@ if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "SGIMATH")
endif()
endif ()
......@@ -975,7 +1014,7 @@ if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
BLAS
sgemm
""
"essl;xlfmath;xlf90_r;blas"
"essl"
""
)
if(NOT BLAS_FIND_QUIETLY)
......@@ -987,6 +1026,10 @@ if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "IBM ESSL")
endif()
endif ()
# BLAS in IBM ESSL_MT library (requires generic BLAS lib, too)
......@@ -998,7 +1041,7 @@ if (BLA_VENDOR STREQUAL "IBMESSLMT" OR BLA_VENDOR STREQUAL "All")
BLAS
sgemm
""
"esslsmp;xlsmp;xlfmath;xlf90_r;blas"
"esslsmp"
""
)
if(NOT BLAS_FIND_QUIETLY)
......@@ -1010,6 +1053,10 @@ if (BLA_VENDOR STREQUAL "IBMESSLMT" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "IBM ESSL MT")
endif()
endif ()
......@@ -1179,6 +1226,10 @@ if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "ACML")
endif()
endif (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") # ACML
......@@ -1203,6 +1254,10 @@ if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
endif()
endif()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Apple Accelerate")
endif()
endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All")
......@@ -1226,6 +1281,9 @@ if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
endif()
endif ()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "NAS")
endif()
endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All")
......@@ -1255,6 +1313,10 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
endif()
endforeach ()
if (BLAS_LIBRARIES AND NOT BLAS_VENDOR_FOUND)
set (BLAS_VENDOR_FOUND "Netlib or other Generic libblas")
endif()
endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
......@@ -1301,6 +1363,9 @@ else(BLA_F95)
if(BLAS_LIBRARIES)
set(BLAS_FOUND TRUE)
if (NOT BLAS_LIBRARIES_DEP)
set(BLAS_LIBRARIES_DEP "${BLAS_LIBRARIES}")
endif()
else()
set(BLAS_FOUND FALSE)
endif()
......@@ -1337,6 +1402,9 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
if (BLAS_FOUND)
list(GET BLAS_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
if (NOT BLAS_LIBRARY_DIRS)
set(BLAS_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)")
string(REGEX REPLACE "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)" "" not_cached_dir "${first_lib_path}")
set(BLAS_DIR_FOUND "${not_cached_dir}" CACHE PATH "Installation directory of BLAS library" FORCE)
......
......@@ -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-2017 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -21,14 +21,24 @@
# BLAS_INCLUDE_DIRS - BLAS include directories
# BLAS_LIBRARY_DIRS - Link directories for BLAS libraries
# BLAS_SEQ_LIBRARIES - BLAS component libraries to be linked (sequential)
# BLAS_SEQ_COMPILER_FLAGS - uncached list of required compiler flags (including -I for mkl headers).
# BLAS_SEQ_LINKER_FLAGS - uncached list of required linker flags (excluding -l
# and -L)
# BLAS_PAR_LIBRARIES - BLAS component libraries to be linked (multithreaded)
# BLAS_PAR_COMPILER_FLAGS - uncached list of required compiler flags (including -I for mkl headers)
# BLAS_PAR_LINKER_FLAGS - uncached list of required linker flags (excluding -l
# and -L)
# BLASEXT_FOUND - if a BLAS has been found
# BLASEXT_LIBRARIES - Idem BLAS_LIBRARIES
# BLASEXT_INCLUDE_DIRS - Idem BLAS_INCLUDE_DIRS
# BLASEXT_LIBRARY_DIRS - Idem BLAS_LIBRARY_DIRS
#=============================================================================
# Copyright 2012-2013 Inria
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013-2016 Florent Pruvost
# Copyright 2013-2017 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -40,9 +50,10 @@
# (To distribute this file outside of Morse, substitute the full
# License text for the above reference.)
# macro to factorize this call
macro(find_package_blas)
if(BLASEXT_FIND_REQUIRED)
# Macro to factorize this call. required arguments allows to decide if
# the REQUIRED option must be given to find_package calls
macro(find_package_blas required)
if(BLASEXT_FIND_REQUIRED AND required)
if(BLASEXT_FIND_QUIETLY)
find_package(BLAS REQUIRED QUIET)
else()
......@@ -80,10 +91,9 @@ if(NOT BLASEXT_FIND_QUIETLY)
endif()
if (NOT BLAS_FOUND)
# First try to detect two cases:
# 1: only SEQ libs are handled
# 2: both SEQ and PAR libs are handled
find_package_blas()
# First blas detection in order to decide if we should look for a
# multitheaded version
find_package_blas(0)
endif ()
# detect the cases where SEQ and PAR libs are handled
......@@ -193,9 +203,15 @@ if(BLA_VENDOR MATCHES "Intel*")
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "Look for the sequential version Intel10_64lp_seq")
endif()
find_package_blas()
find_package_blas(0)
if(BLAS_FOUND)
set(BLAS_SEQ_LIBRARIES "${BLAS_LIBRARIES}")
if (BLAS_COMPILER_FLAGS)
set (BLAS_SEQ_COMPILER_FLAGS "${BLAS_COMPILER_FLAGS}")
endif()
if (BLAS_LINKER_FLAGS)
set (BLAS_SEQ_LINKER_FLAGS "${BLAS_LINKER_FLAGS}")
endif()
else()
set(BLAS_SEQ_LIBRARIES "${BLAS_SEQ_LIBRARIES-NOTFOUND}")
endif()
......@@ -205,9 +221,15 @@ if(BLA_VENDOR MATCHES "Intel*")
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "Look for the multithreaded version Intel10_64lp")
endif()
find_package_blas()
find_package_blas(0)
if(BLAS_FOUND)
set(BLAS_PAR_LIBRARIES "${BLAS_LIBRARIES}")
if (BLAS_COMPILER_FLAGS)
set (BLAS_PAR_COMPILER_FLAGS "${BLAS_COMPILER_FLAGS}")
endif()
if (BLAS_LINKER_FLAGS)
set (BLAS_PAR_LINKER_FLAGS "${BLAS_LINKER_FLAGS}")
endif()
else()
set(BLAS_PAR_LIBRARIES "${BLAS_PAR_LIBRARIES-NOTFOUND}")
endif()
......@@ -227,7 +249,7 @@ elseif(BLA_VENDOR MATCHES "ACML*")
## look for the sequential version
set(BLA_VENDOR "ACML")
find_package_blas()
find_package_blas(0)
if(BLAS_FOUND)
set(BLAS_SEQ_LIBRARIES "${BLAS_LIBRARIES}")
else()
......@@ -236,7 +258,7 @@ elseif(BLA_VENDOR MATCHES "ACML*")
## look for the multithreaded version
set(BLA_VENDOR "ACML_MP")
find_package_blas()
find_package_blas(0)
if(BLAS_FOUND)
set(BLAS_PAR_LIBRARIES "${BLAS_LIBRARIES}")
else()
......@@ -248,7 +270,7 @@ elseif(BLA_VENDOR MATCHES "IBMESSL*")
## look for the sequential version
set(BLA_VENDOR "IBMESSL")
find_package_blas()
find_package_blas(0)
if(BLAS_FOUND)
set(BLAS_SEQ_LIBRARIES "${BLAS_LIBRARIES}")
else()
......@@ -257,7 +279,7 @@ elseif(BLA_VENDOR MATCHES "IBMESSL*")
## look for the multithreaded version
set(BLA_VENDOR "IBMESSLMT")
find_package_blas()
find_package_blas(0)
if(BLAS_FOUND)
set(BLAS_PAR_LIBRARIES "${BLAS_LIBRARIES}")
else()
......@@ -276,9 +298,11 @@ else()
endif()
# Reset pure BLAS cmake variables to the sequential case (arbitrary default)
if(BLAS_SEQ_LIBRARIES)
set(BLAS_LIBRARIES "${BLAS_SEQ_LIBRARIES}")
set(BLAS_COMPILER_FLAGS "${BLAS_SEQ_COMPILER_FLAGS}")
set(BLAS_LINKER_FLAGS "${BLAS_SEQ_LINKER_FLAGS}")
endif()
# extract libs paths
......@@ -305,76 +329,70 @@ if (BLAS_LIBRARY_DIRS)
list(REMOVE_DUPLICATES BLAS_LIBRARY_DIRS)
endif ()
# check that BLAS has been found
# check that BLASEXT has been found
# ---------------------------------
include(FindPackageHandleStandardArgs)
if(BLA_VENDOR MATCHES "Intel*")
if(BLA_VENDOR MATCHES "Intel10_64lp*")
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS found is Intel MKL:"
"\n we manage two lists of libs, one sequential and one parallel if found"
"\n (see BLAS_SEQ_LIBRARIES and BLAS_PAR_LIBRARIES)")
message(STATUS "BLAS found is Intel MKL")
message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES")
endif()
find_package_handle_standard_args(BLAS DEFAULT_MSG
find_package_handle_standard_args(BLASEXT DEFAULT_MSG
BLAS_SEQ_LIBRARIES
BLAS_LIBRARY_DIRS
BLAS_INCLUDE_DIRS)
if(BLAS_PAR_LIBRARIES)
if(BLA_VENDOR MATCHES "Intel10_64lp*" AND BLAS_PAR_LIBRARIES)
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES")
endif()
find_package_handle_standard_args(BLAS DEFAULT_MSG
find_package_handle_standard_args(BLASEXT DEFAULT_MSG
BLAS_PAR_LIBRARIES)
endif()
else()
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES")
endif()
find_package_handle_standard_args(BLAS DEFAULT_MSG
BLAS_SEQ_LIBRARIES
BLAS_LIBRARY_DIRS
BLAS_INCLUDE_DIRS)
endif()
elseif(BLA_VENDOR MATCHES "ACML*")
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS found is ACML:"
"\n we manage two lists of libs, one sequential and one parallel if found"
"\n (see BLAS_SEQ_LIBRARIES and BLAS_PAR_LIBRARIES)")
message(STATUS "BLAS found is ACML")
message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES")
endif()
find_package_handle_standard_args(BLAS DEFAULT_MSG
find_package_handle_standard_args(BLASEXT DEFAULT_MSG
BLAS_SEQ_LIBRARIES
BLAS_LIBRARY_DIRS)
if(BLAS_PAR_LIBRARIES)
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES")
endif()
find_package_handle_standard_args(BLAS DEFAULT_MSG
find_package_handle_standard_args(BLASEXT DEFAULT_MSG
BLAS_PAR_LIBRARIES)
endif()
elseif(BLA_VENDOR MATCHES "IBMESSL*")
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS found is ESSL:"
"\n we manage two lists of libs, one sequential and one parallel if found"
"\n (see BLAS_SEQ_LIBRARIES and BLAS_PAR_LIBRARIES)")
message(STATUS "BLAS found is ESSL")
message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES")
endif()
find_package_handle_standard_args(BLAS DEFAULT_MSG
find_package_handle_standard_args(BLASEXT DEFAULT_MSG
BLAS_SEQ_LIBRARIES
BLAS_LIBRARY_DIRS)
if(BLAS_PAR_LIBRARIES)
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES")
endif()
find_package_handle_standard_args(BLAS DEFAULT_MSG
find_package_handle_standard_args(BLASEXT DEFAULT_MSG
BLAS_PAR_LIBRARIES)
endif()
else()
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES")
endif()
find_package_handle_standard_args(BLAS DEFAULT_MSG
find_package_handle_standard_args(BLASEXT DEFAULT_MSG
BLAS_SEQ_LIBRARIES
BLAS_LIBRARY_DIRS)
endif()
if (BLAS_LIBRARIES)
set(BLASEXT_LIBRARIES ${BLAS_LIBRARIES})
endif()
if (BLAS_INCLUDE_DIRS)
set(BLASEXT_INCLUDE_DIRS ${BLAS_INCLUDE_DIRS})
endif()
if (BLAS_LIBRARY_DIRS)
set(BLASEXT_LIBRARY_DIRS ${BLAS_LIBRARY_DIRS})
endif()
......@@ -122,11 +122,13 @@ if (BLAS_FOUND)
endif()
# test succeeds: CBLAS is in BLAS
set(CBLAS_LIBRARIES "${BLAS_LIBRARIES}")
set(CBLAS_LIBRARIES_DEP "${BLAS_LIBRARIES}")
if (BLAS_LIBRARY_DIRS)
set(CBLAS_LIBRARY_DIRS "${BLAS_LIBRARY_DIRS}")
endif()
if(BLAS_INCLUDE_DIRS)
set(CBLAS_INCLUDE_DIRS "${BLAS_INCLUDE_DIRS}")
set(CBLAS_INCLUDE_DIRS_DEP "${BLAS_INCLUDE_DIRS_DEP}")
endif()
if (BLAS_LINKER_FLAGS)
set(CBLAS_LINKER_FLAGS "${BLAS_LINKER_FLAGS}")
......@@ -370,6 +372,9 @@ endif(BLAS_FOUND)
if (CBLAS_LIBRARIES)
list(GET CBLAS_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
if (NOT CBLAS_LIBRARY_DIRS)
set(CBLAS_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)")
string(REGEX REPLACE "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)" "" not_cached_dir "${first_lib_path}")
set(CBLAS_DIR_FOUND "${not_cached_dir}" CACHE PATH "Installation directory of CBLAS library" FORCE)
......
......@@ -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.
#
###
......@@ -37,12 +37,14 @@
# This module finds headers and chameleon library.
# Results are reported in variables:
# CHAMELEON_FOUND - True if headers and requested libraries were found
# CHAMELEON_C_FLAGS - list of required compilation flags (excluding -I)
# CHAMELEON_LINKER_FLAGS - list of required linker flags (excluding -l and -L)
# CHAMELEON_INCLUDE_DIRS - chameleon include directories
# CHAMELEON_LIBRARY_DIRS - Link directories for chameleon libraries
# CHAMELEON_INCLUDE_DIRS_DEP - chameleon + dependencies include directories
# CHAMELEON_LIBRARY_DIRS_DEP - chameleon + dependencies link directories
# CHAMELEON_LIBRARIES_DEP - chameleon libraries + dependencies
# CHAMELEON_FOUND_WITH_PKGCONFIG - True if found with pkg-config
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DCHAMELEON_DIR=path/to/chameleon):
# CHAMELEON_DIR - Where to find the base directory of chameleon
......@@ -52,11 +54,11 @@
# are not given as cmake variable: CHAMELEON_DIR, CHAMELEON_INCDIR, CHAMELEON_LIBDIR
#=============================================================================
# Copyright 2012-2013 Inria
# Copyright 2012-2018 Inria
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013-2016 Florent Pruvost
# Copyright 2013-2018 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -133,11 +135,6 @@ if(PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_GIVEN_BY_USER)
if (NOT CHAMELEON_FIND_QUIETLY)
if (CHAMELEON_FOUND AND CHAMELEON_LIBRARIES)
message(STATUS "Looking for CHAMELEON - found using PkgConfig")
#if(NOT CHAMELEON_INCLUDE_DIRS)
# message("${Magenta}CHAMELEON_INCLUDE_DIRS is empty using PkgConfig."
# "Perhaps the path to chameleon headers is already present in your"
# "C(PLUS)_INCLUDE_PATH environment variable.${ColourReset}")
#endif()
else()
message(STATUS "${Magenta}Looking for CHAMELEON - not found using PkgConfig."
"\n Perhaps you should add the directory containing chameleon.pc"
......@@ -166,9 +163,16 @@ if(PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_GIVEN_BY_USER)
endif()
endif()
set(CHAMELEON_INCLUDE_DIRS_DEP "${CHAMELEON_INCLUDE_DIRS}")
set(CHAMELEON_LIBRARY_DIRS_DEP "${CHAMELEON_LIBRARY_DIRS}")
set(CHAMELEON_LIBRARIES_DEP "${CHAMELEON_LIBRARIES}")
set(CHAMELEON_C_FLAGS "${CHAMELEON_CFLAGS_OTHER}")
set(CHAMELEON_INCLUDE_DIRS_DEP "${CHAMELEON_STATIC_INCLUDE_DIRS}")
set(CHAMELEON_LIBRARY_DIRS_DEP "${CHAMELEON_STATIC_LIBRARY_DIRS}")
set(CHAMELEON_LIBRARIES_DEP "${CHAMELEON_STATIC_LIBRARIES}")
if (CHAMELEON_FOUND AND CHAMELEON_LIBRARIES)
set(CHAMELEON_FOUND_WITH_PKGCONFIG "TRUE")
else()
set(CHAMELEON_FOUND_WITH_PKGCONFIG "FALSE")
endif()
endif(PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_GIVEN_BY_USER)
......@@ -776,6 +780,7 @@ if (CHAMELEON_LIBRARIES)
else()
list(GET CHAMELEON_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
set(CHAMELEON_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "/lib(32|64)?$")
string(REGEX REPLACE "/lib(32|64)?$" "" not_cached_dir "${first_lib_path}")
......
###
#
# @copyright (c) 2017 Inria. All rights reserved.
#
###
#
# - Find CPPCHECK bin directory
# Use this module by invoking find_package with the form:
# find_package(CPPCHECK
# [REQUIRED]) # Fail with error if cppcheck is not found
#
# This module finds headers and cppcheck library.
# Results are reported in variables:
# CPPCHECK_FOUND - True if cppcheck executable is found
# CPPCHECK_EXECUTABLE - cppcheck executable directory found
#
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DCPPCHECK_DIR=path/to/cppcheck):
# CPPCHECK_DIR - Where to find the base directory of cppcheck
# CPPCHECK_BINDIR - Where to find the executable cppcheck
# The module can also look for the following environment variables if paths
# are not given as cmake variable: CPPCHECK_DIR, CPPCHECK_BINDIR
if (NOT CPPCHECK_FOUND)
set(CPPCHECK_DIR "" CACHE PATH "Installation directory of CPPCHECK library")
mark_as_advanced(CPPCHECK_DIR)
if (NOT CPPCHECK_FIND_QUIETLY)
message(STATUS "A cache variable, namely CPPCHECK_DIR, has been set to specify the install directory of CPPCHECK")
endif()
endif()
set(ENV_CPPCHECK_DIR "$ENV{CPPCHECK_DIR}")
set(ENV_CPPCHECK_BINDIR "$ENV{CPPCHECK_BINDIR}")
set(CPPCHECK_GIVEN_BY_USER "FALSE")
if ( CPPCHECK_DIR OR CPPCHECK_BINDIR OR ENV_CPPCHECK_DIR OR ENV_CPPCHECK_BINDIR )
set(CPPCHECK_GIVEN_BY_USER "TRUE")
endif()
if (NOT CPPCHECK_FIND_QUIETLY)
message(STATUS "Looking for CPPCHECK")
endif()
# Looking for executable
# ----------------------
# Add system include paths to search include
# ------------------------------------------
unset(where_to_look)
if(CPPCHECK_BINDIR)
list(APPEND where_to_look "${CPPCHECK_BINDIR}")
elseif(CPPCHECK_DIR)
list(APPEND where_to_look "${CPPCHECK_DIR}")
elseif(ENV_CPPCHECK_BINDIR)
list(APPEND where_to_look "${ENV_CPPCHECK_BINDIR}")
elseif(ENV_CPPCHECK_DIR)
list(APPEND where_to_look "${ENV_CPPCHECK_DIR}/bin")
else()
string(REPLACE ":" ";" _path_env "$ENV{PATH}")
list(APPEND where_to_look "${_path_env}")
endif()
list(APPEND where_to_look "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}")
list(APPEND where_to_look "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}")
list(REMOVE_DUPLICATES where_to_look)
find_program(CPPCHECK_EXECUTABLE
NAMES cppcheck
HINTS ${where_to_look}
)
mark_as_advanced(CPPCHECK_EXECUTABLE)
if(CPPCHECK_EXECUTABLE)
execute_process(COMMAND ${CPPCHECK_EXECUTABLE} "--version" OUTPUT_VARIABLE CPPCHECK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "Cppcheck " "" CPPCHECK_VERSION "${CPPCHECK_VERSION}")
endif()
# check that CPPCHECK has been found
# ----------------------------------
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CPPCHECK DEFAULT_MSG
CPPCHECK_EXECUTABLE
CPPCHECK_VERSION)
......@@ -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-2014 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.
#
###
......@@ -20,9 +20,11 @@
# This module finds headers and eztrace library.
# Results are reported in variables:
# EZTRACE_FOUND - True if headers and requested libraries were found
# EZTRACE_C_FLAGS - list of required compilation flags (excluding -I)
# EZTRACE_INCLUDE_DIRS - eztrace include directories
# EZTRACE_LIBRARY_DIRS - Link directories for eztrace libraries
# EZTRACE_LIBRARIES - eztrace component libraries to be linked
# EZTRACE_FOUND_WITH_PKGCONFIG - True if found with pkg-config
#
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DEZTRACE_DIR=path/to/eztrace):
......@@ -33,11 +35,11 @@
# are not given as cmake variable: EZTRACE_DIR, EZTRACE_INCDIR, EZTRACE_LIBDIR
#=============================================================================
# Copyright 2012-2013 Inria
# Copyright 2012-2018 Inria
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013 Florent Pruvost
# Copyright 2013-2018 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -84,7 +86,14 @@ if( PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_GIVEN_BY_USER )
"\n Perhaps you should add the directory containing eztrace.pc to"
"\n the PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
if (EZTRACE_FOUND AND EZTRACE_LIBRARIES)
set(EZTRACE_FOUND_WITH_PKGCONFIG "TRUE")
else()
set(EZTRACE_FOUND_WITH_PKGCONFIG "FALSE")
endif()
endif()
set(EZTRACE_C_FLAGS "${EZTRACE_CFLAGS_OTHER}")
endif( PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_GIVEN_BY_USER )
......@@ -331,6 +340,7 @@ if (EZTRACE_LIBRARIES)
else()
list(GET EZTRACE_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
set(EZTRACE_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "/lib(32|64)?$")
string(REGEX REPLACE "/lib(32|64)?$" "" not_cached_dir "${first_lib_path}")
......
# - Try to find fabulous (C-api)
#
# If this script have difficulties to find fabulous, you can try to help
# it by setting the variable FABULOUS_DIR to the prefix path where fabulous
# was installed
#
# Once done this will define
# FABULOUS_FOUND - System has fabulous
# FABULOUS_INCLUDE_DIRS - The fabulous include directories
# FABULOUS_MODULE_DIRS - The fabulous module directories for Fortran API
# FABULOUS_LIBRARIES - The libraries needed to use fabulous
# FABULOUS_DEFINITIONS - Compiler switches required for using fabulous
#
include(FindPackageHandleStandardArgs)
macro(FABULOUS_FIND_LIBRARIES_FROM_PKGCONFIG_RESULTS _prefix _pc_xprefix)
foreach(_library ${${_pc_xprefix}_LIBRARIES})
get_filename_component(_library ${_library} NAME_WE)
unset(_library_path)
unset(_library_path CACHE)
find_library(_library_path NAMES ${_library}
HINTS ${${_pc_xprefix}_LIBDIR} ${${_pc_xprefix}_LIBRARY_DIRS} )
if (_library_path)
list(APPEND ${_prefix}_LIBRARIES ${_library_path})
else()
message(FATAL_ERROR "Dependency of ${_prefix} '${_library}' NOT FOUND")
endif()
unset(_library_path CACHE)
endforeach()
endmacro()
macro(FABULOUS_CHECK_FUNCTION_EXISTS _prefix _function)
include(CheckFunctionExists)
unset(${_prefix}_WORKS)
unset(${_prefix}_WORKS CACHE)
set(CMAKE_REQUIRED_LIBRARIES ${${_prefix}_LIBRARIES})
set(CMAKE_REQUIRED_INCLUDES ${${_prefix}_INCLUDE_DIRS})
set(CMAKE_REQUIRED_DEFINITIONS ${${_prefix}_DEFINITIONS})
check_function_exists(${_function} ${_prefix}_WORKS)
set(CMAKE_REQUIRED_LIBRARIES "")
set(CMAKE_REQUIRED_INCLUDES "")
set(CMAKE_REQUIRED_DEFINITIONS "")
mark_as_advanced(${_prefix}_WORKS)
endmacro()
find_package(PkgConfig QUIET)
set(ENV_FABULOUS_DIR "$ENV{FABULOUS_DIR}")
set(ENV_FABULOUS_INCDIR "$ENV{FABULOUS_INCDIR}")
set(ENV_FABULOUS_LIBDIR "$ENV{FABULOUS_LIBDIR}")
set(FABULOUS_GIVEN_BY_USER "FALSE")
if ( FABULOUS_DIR OR ENV_FABULOUS_DIR
OR ( FABULOUS_INCDIR AND FABULOUS_LIBDIR )
OR ( ENV_FABULOUS_INCDIR AND ENV_FABULOUS_LIBDIR ) )
set(FABULOUS_GIVEN_BY_USER "TRUE")
endif()
set(FABULOUS_STATIC_FIND_QUIETLY "TRUE")
set(FABULOUS_SHARED_FIND_QUIETLY "TRUE")
if ((NOT FABULOUS_FOUND) AND (NOT FABULOUS_GIVEN_BY_USER) AND PKG_CONFIG_FOUND)
pkg_check_modules(PC_FABULOUS QUIET fabulous)
find_path(FABULOUS_STATIC_INCLUDE_DIR NAMES fabulous.h
HINTS ${PC_FABULOUS_STATIC_INCLUDEDIR} ${PC_FABULOUS_STATIC_INCLUDE_DIRS} )
find_library(FABULOUS_STATIC_LIBRARY NAMES libfabulous.a
HINTS ${PC_FABULOUS_STATIC_LIBDIR} ${PC_FABULOUS_STATIC_LIBRARY_DIRS} )
find_path(FABULOUS_SHARED_INCLUDE_DIR NAMES fabulous.h
HINTS ${PC_FABULOUS_INCLUDEDIR} ${PC_FABULOUS_INCLUDE_DIRS} )
find_library(FABULOUS_SHARED_LIBRARY NAMES libfabulous.so
HINTS ${PC_FABULOUS_LIBDIR} ${PC_FABULOUS_LIBRARY_DIRS} )
# handle the QUIETLY and REQUIRED arguments and set FABULOUS_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(
FABULOUS_STATIC DEFAULT_MSG
FABULOUS_STATIC_LIBRARY FABULOUS_STATIC_INCLUDE_DIR)
mark_as_advanced(FABULOUS_STATIC_INCLUDE_DIR FABULOUS_STATIC_LIBRARY)
find_package_handle_standard_args(
FABULOUS_SHARED DEFAULT_MSG
FABULOUS_SHARED_LIBRARY FABULOUS_SHARED_INCLUDE_DIR)
mark_as_advanced(FABULOUS_SHARED_INCLUDE_DIR FABULOUS_SHARED_LIBRARY)
if (FABULOUS_STATIC_FOUND AND NOT FABULOUS_SHARED_FOUND)
set(FABULOUS_INCLUDE_DIRS ${FABULOUS_STATIC_INCLUDE_DIR} )
set(FABULOUS_DEFINITIONS ${PC_FABULOUS_STATIC_CFLAGS_OTHER} )
set(FABULOUS_LIBRARIES "")
fabulous_find_libraries_from_pkgconfig_results(FABULOUS PC_FABULOUS_STATIC)
elseif(FABULOUS_SHARED_FOUND)
set(FABULOUS_INCLUDE_DIRS ${FABULOUS_INCLUDE_DIR} )
set(FABULOUS_DEFINITIONS ${PC_FABULOUS_CFLAGS_OTHER} )
set(FABULOUS_LIBRARIES "")
fabulous_find_libraries_from_pkgconfig_results(FABULOUS PC_FABULOUS)
endif()
fabulous_check_function_exists(FABULOUS fabulous_create)
find_package_handle_standard_args(
FABULOUS DEFAULT_MSG
FABULOUS_LIBRARIES FABULOUS_INCLUDE_DIRS FABULOUS_WORKS)
endif()
if ((NOT FABULOUS_FOUND) AND (FABULOUS_GIVEN_BY_USER OR (NOT PKG_CONFIG_FOUND)))
# Currently the C-api (compiled version) does not depent on chameleon
# so the library only depends on CBLAS AND LAPACKE
set(FABULOUS_DEFINITIONS "")
if ( ( FABULOUS_INCDIR AND FABULOUS_LIBDIR ) OR ( ENV_FABULOUS_INCDIR AND ENV_FABULOUS_LIBDIR ) )
if ((NOT FABULOUS_LIBDIR) AND (NOT FABULOUS_INCDIR)
AND (ENV_FABULOUS_INCDIR AND ENV_FABULOUS_LIBDIR) )
set(FABULOUS_LIBDIR ${ENV_FABULOUS_LIBDIR})
set(FABULOUS_INCDIR ${ENV_FABULOUS_INCDIR})
endif()
find_path(FABULOUS_INCLUDE_DIRS NAMES fabulous.h HINTS ${FABULOUS_INCDIR})
find_path(FABULOUS_MODULE_DIRS NAMES fabulous_mod.mod HINTS ${FABULOUS_INCDIR}
PATH_SUFFIXES fabulous)
find_library(FABULOUS_STATIC_LIBRARY NAMES libfabulous.a HINTS ${FABULOUS_LIBDIR})
find_library(FABULOUS_SHARED_LIBRARY NAMES libfabulous.so HINTS ${FABULOUS_LIBDIR})
else()
if (ENV_FABULOUS_DIR AND NOT FABULOUS_DIR)
set(FABULOUS_DIR "${ENV_FABULOUS_DIR}" CACHE PATH "Installation prefix where fabulous is installed")
else()
set(FABULOUS_DIR "${FABULOUS_DIR}" CACHE PATH "Installation prefix where fabulous is installed")
endif()
find_path(FABULOUS_INCLUDE_DIRS NAMES fabulous.h
HINTS ${FABULOUS_DIR}
PATH_SUFFIXES include include/fabulous)
find_path(FABULOUS_MODULE_DIRS NAMES fabulous_mod.mod
HINTS ${FABULOUS_DIR}
PATH_SUFFIXES include include/fabulous)
find_library(FABULOUS_STATIC_LIBRARY NAMES libfabulous.a
HINTS ${FABULOUS_DIR}
PATH_SUFFIXES lib lib32 lib64 lib/fabulous lib32/fabulous lib64/fabulous)
find_library(FABULOUS_SHARED_LIBRARY NAMES libfabulous.so
HINTS ${FABULOUS_DIR}
PATH_SUFFIXES lib lib32 lib64 lib/fabulous lib32/fabulous lib64/fabulous)
endif()
find_package_handle_standard_args(FABULOUS_STATIC DEFAULT_MSG FABULOUS_STATIC_LIBRARY)
find_package_handle_standard_args(FABULOUS_SHARED DEFAULT_MSG FABULOUS_SHARED_LIBRARY)
mark_as_advanced(FABULOUS_STATIC_LIBRARY FABULOUS_SHARED_LIBRARY)
if (FABULOUS_FIND_REQUIRED)
find_package(CBLAS REQUIRED)
find_package(LAPACKE REQUIRED)
else()
find_package(CBLAS)
find_package(LAPACKE)
endif()
if (FABULOUS_STATIC_FOUND AND NOT FABULOUS_SHARED_FOUND)
set(FABULOUS_LIBRARIES ${FABULOUS_STATIC_LIBRARY} ${CBLAS_LIBRARIES} ${LAPACKE_LIBRARIES} "-lstdc++" "-lm")
elseif(FABULOUS_SHARED_FOUND)
set(FABULOUS_LIBRARIES ${FABULOUS_SHARED_LIBRARY} ${CBLAS_LIBRARIES} ${LAPACKE_LIBRARIES})
endif()
fabulous_check_function_exists(FABULOUS fabulous_create)
find_package_handle_standard_args(
FABULOUS DEFAULT_MSG
FABULOUS_LIBRARIES FABULOUS_INCLUDE_DIRS FABULOUS_WORKS)
endif()
......@@ -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-2015 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.
#
###
......@@ -36,6 +36,7 @@
# FFTW_INCLUDE_DIRS_DEP - fftw + dependencies include directories
# FFTW_LIBRARY_DIRS_DEP - fftw + dependencies link directories
# FFTW_LIBRARIES_DEP - fftw libraries + dependencies
# FFTW_FOUND_WITH_PKGCONFIG - True if found with pkg-config
#
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DFFTW_DIR=path/to/fftw):
......@@ -48,11 +49,11 @@
# environment variable
#=============================================================================
# Copyright 2012-2013 Inria
# Copyright 2012-2018 Inria
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013-2016 Florent Pruvost
# Copyright 2013-2018 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -230,6 +231,7 @@ if (NOT FFTW_LOOK_FOR_MKL AND NOT FFTW_LOOK_FOR_ESSL)
pkg_search_module(FFTW3F fftw3f)
pkg_search_module(FFTW3 fftw3)
if (FFTW3F_FOUND)
set(FFTW_C_FLAGS "${FFTW3F_CFLAGS_OTHER}")
if (NOT FFTW_FIND_QUIETLY)
message(STATUS "Looking for FFTW3F - found using PkgConfig")
endif()
......@@ -259,6 +261,7 @@ if (NOT FFTW_LOOK_FOR_MKL AND NOT FFTW_LOOK_FOR_ESSL)
pkg_search_module(FFTW3L fftw3l)
pkg_search_module(FFTW3 fftw3)
if (FFTW3L_FOUND)
set(FFTW_C_FLAGS "${FFTW3L_CFLAGS_OTHER}")
if (NOT FFTW_FIND_QUIETLY)
message(STATUS "Looking for FFTW3L - found using PkgConfig")
endif()
......@@ -288,6 +291,7 @@ if (NOT FFTW_LOOK_FOR_MKL AND NOT FFTW_LOOK_FOR_ESSL)
pkg_search_module(FFTW3Q fftw3q)
pkg_search_module(FFTW3 fftw3)
if (FFTW3Q_FOUND)
set(FFTW_C_FLAGS "${FFTW3Q_CFLAGS_OTHER}")
if (NOT FFTW_FIND_QUIETLY)
message(STATUS "Looking for FFTW3Q - found using PkgConfig")
endif()
......@@ -317,6 +321,7 @@ if (NOT FFTW_LOOK_FOR_MKL AND NOT FFTW_LOOK_FOR_ESSL)
pkg_search_module(FFTW3 fftw3)
endif()
if (FFTW3_FOUND)
set(FFTW_C_FLAGS "${FFTW3_CFLAGS_OTHER}")
if (NOT FFTW_FIND_QUIETLY)
message(STATUS "Looking for FFTW3 - found using PkgConfig")
endif()
......@@ -343,14 +348,20 @@ if (NOT FFTW_LOOK_FOR_MKL AND NOT FFTW_LOOK_FOR_ESSL)
endif()
endif(FFTW3_FOUND)
set(FFTW_INCLUDE_DIRS_DEP "${FFTW_INCLUDE_DIRS}")
set(FFTW_LIBRARY_DIRS_DEP "${FFTW_LIBRARY_DIRS}")
set(FFTW_LIBRARIES_DEP "${FFTW_LIBRARIES}" )
set(FFTW_INCLUDE_DIRS_DEP "${FFTW_STATIC_INCLUDE_DIRS}")
set(FFTW_LIBRARY_DIRS_DEP "${FFTW_STATIC_LIBRARY_DIRS}")
set(FFTW_LIBRARIES_DEP "${FFTW_STATIC_LIBRARIES}" )
if (FFTW_LIBRARIES)
set(FFTW_WORKS TRUE)
endif()
if (FFTW_FOUND AND FFTW_LIBRARIES)
set(FFTW_FOUND_WITH_PKGCONFIG "TRUE")
else()
set(FFTW_FOUND_WITH_PKGCONFIG "FALSE")
endif()
endif( PKG_CONFIG_EXECUTABLE AND NOT FFTW_GIVEN_BY_USER )
endif(NOT FFTW_LOOK_FOR_MKL AND NOT FFTW_LOOK_FOR_ESSL)
......@@ -700,7 +711,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR
endif()
# OMP
if(FFTW_LOOK_FOR_OMP)
set(REQUIRED_FLAGS "-fopenmp")
list(APPEND REQUIRED_FLAGS "${OPENMP_C_FLAGS}")
#if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
# # either gomp ...
# list(APPEND REQUIRED_LIBS "-lgomp")
......@@ -763,8 +774,6 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR
message(STATUS "CMAKE_REQUIRED_FLAGS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif()
else()
set(FFTW_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
......@@ -781,6 +790,9 @@ endif( (NOT PKG_CONFIG_EXECUTABLE) OR
if (FFTW_LIBRARIES)
list(GET FFTW_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
if (NOT FFTW_LIBRARY_DIRS)
set(FFTW_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)")
string(REGEX REPLACE "(/lib(32|64)?$)|(/lib/intel64$|/lib/ia32$)" "" not_cached_dir "${first_lib_path}")
set(FFTW_DIR_FOUND "${not_cached_dir}" CACHE PATH "Installation directory of FFTW library" FORCE)
......
......@@ -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-2014 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.
#
###
......@@ -16,9 +16,11 @@
# This module finds headers and fxt library.
# Results are reported in variables:
# FXT_FOUND - True if headers and requested libraries were found
# FXT_C_FLAGS - list of required compilation flags (excluding -I)
# FXT_INCLUDE_DIRS - fxt include directories
# FXT_LIBRARY_DIRS - Link directories for fxt libraries
# FXT_LIBRARIES - fxt component libraries to be linked
# FXT_FOUND_WITH_PKGCONFIG - True if found with pkg-config
#
# 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):
......@@ -29,11 +31,11 @@
# are not given as cmake variable: FXT_DIR, FXT_INCDIR, FXT_LIBDIR
#=============================================================================
# Copyright 2012-2013 Inria
# Copyright 2012-2018 Inria
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013 Florent Pruvost
# Copyright 2013-2018 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -82,6 +84,14 @@ if(PKG_CONFIG_EXECUTABLE AND NOT FXT_GIVEN_BY_USER)
endif()
endif()
set(FXT_C_FLAGS "${FXT_CFLAGS_OTHER}")
if (FXT_FOUND AND FXT_LIBRARIES)
set(FXT_FOUND_WITH_PKGCONFIG "TRUE")
else()
set(FXT_FOUND_WITH_PKGCONFIG "FALSE")
endif()
endif(PKG_CONFIG_EXECUTABLE AND NOT FXT_GIVEN_BY_USER)
if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR (FXT_GIVEN_BY_USER) )
......@@ -286,6 +296,7 @@ if (FXT_LIBRARIES)
else()
list(GET FXT_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
set(FXT_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "/lib(32|64)?$")
string(REGEX REPLACE "/lib(32|64)?$" "" not_cached_dir "${first_lib_path}")
......
This diff is collapsed.
This diff is collapsed.
......@@ -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-2014 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.
#
###
......@@ -16,9 +16,11 @@
# This module finds headers and hwloc library.
# Results are reported in variables:
# HWLOC_FOUND - True if headers and requested libraries were found
# HWLOC_C_FLAGS - list of required compilation flags (excluding -I)
# HWLOC_INCLUDE_DIRS - hwloc include directories
# HWLOC_LIBRARY_DIRS - Link directories for hwloc libraries
# HWLOC_LIBRARIES - hwloc component libraries to be linked
# HWLOC_FOUND_WITH_PKGCONFIG - True if found with pkg-config
#
# 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):
......@@ -29,11 +31,11 @@
# are not given as cmake variable: HWLOC_DIR, HWLOC_INCDIR, HWLOC_LIBDIR
#=============================================================================
# Copyright 2012-2013 Inria
# Copyright 2012-2018 Inria
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013 Florent Pruvost
# Copyright 2013-2018 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
......@@ -73,11 +75,6 @@ if( PKG_CONFIG_EXECUTABLE AND NOT HWLOC_GIVEN_BY_USER )
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()
else()
message(STATUS "${Magenta}Looking for HWLOC - not found using PkgConfig."
"\n Perhaps you should add the directory containing hwloc.pc to"
......@@ -85,6 +82,14 @@ if( PKG_CONFIG_EXECUTABLE AND NOT HWLOC_GIVEN_BY_USER )
endif()
endif()
set(HWLOC_C_FLAGS "${HWLOC_CFLAGS_OTHER}")
if (HWLOC_FOUND AND HWLOC_LIBRARIES)
set(HWLOC_FOUND_WITH_PKGCONFIG "TRUE")
else()
set(HWLOC_FOUND_WITH_PKGCONFIG "FALSE")
endif()
endif( PKG_CONFIG_EXECUTABLE AND NOT HWLOC_GIVEN_BY_USER )
if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) OR (HWLOC_GIVEN_BY_USER) )
......@@ -292,6 +297,7 @@ if (HWLOC_LIBRARIES)
else()
list(GET HWLOC_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
set(HWLOC_LIBRARY_DIRS "${first_lib_path}")
endif()
if (${first_lib_path} MATCHES "/lib(32|64)?$")
string(REGEX REPLACE "/lib(32|64)?$" "" not_cached_dir "${first_lib_path}")
......@@ -318,6 +324,18 @@ endif()
if (HWLOC_FOUND)
set(HWLOC_SAVE_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
list(APPEND CMAKE_REQUIRED_INCLUDES ${HWLOC_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES)
if (HWLOC_LIBRARY_DIRS)
set (LIBDIR ${HWLOC_LIBRARY_DIRS})
elseif(HWLOC_LIBDIR)
set (LIBDIR ${HWLOC_LIBDIR})
endif()
if (LIBDIR)
foreach(lib_dir ${LIBDIR})
list(APPEND CMAKE_REQUIRED_LIBRARIES "-L${lib_dir}")
endforeach()
endif()
string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
# test headers to guess the version
check_struct_has_member( "struct hwloc_obj" parent hwloc.h HAVE_HWLOC_PARENT_MEMBER )
......
###
# WARNING: only HYPRE lib is searched for now
# it is surely too simple, must be completed
###
#
# @copyright (c) 2009-2014 The University of Tennessee and The University
# of Tennessee Research Foundation.
......
......@@ -29,6 +29,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
# LAPACK_VENDOR_FOUND stores the LAPACK 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 -DLAPACK_DIR=path/to/lapack):
......@@ -243,7 +244,6 @@ macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads
find_library(${_prefix}_${_library}_LIBRARY
NAMES ${_library}
HINTS ${_libdir}
NO_DEFAULT_PATH
)
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
# Print status if not found
......@@ -326,10 +326,42 @@ if(BLAS_FOUND)
endif()
endif()
# check if blas lib contains lapack symbols
if (BLAS_LIBRARIES)
if (BLAS_LIBRARIES_DEP)
set(LIBRARIES ${BLAS_LIBRARIES_DEP})
else()
set(LIBRARIES ${BLAS_LIBRARIES})
endif()
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
"CHEEV"
""
""
"${LIBRARIES}"
""
)
if (LAPACK_LIBRARIES)
if(NOT LAPACK_FIND_QUIETLY)
if(LAPACK_LIBRARIES)
message(STATUS "Looking for LAPACK in BLAS: found")
else()
message(STATUS "Looking for LAPACK in BLAS: not found")
endif()
endif()
if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "${BLAS_VENDOR_FOUND}")
endif()
endif()
endif(BLAS_LIBRARIES)
#intel lapack
if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES)
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_PACKAGE(Threads)
else()
......@@ -356,7 +388,7 @@ if(BLAS_FOUND)
"mkl_intel_c")
list(APPEND LAPACK_SEARCH_LIBS
"mkl_intel_lp64")
else()
else(BLA_F95)
set(LAPACK_mkl_SEARCH_SYMBOL "cheev")
set(_LIBRARIES LAPACK_LIBRARIES)
set(_BLAS_LIBRARIES ${BLAS_LIBRARIES})
......@@ -367,7 +399,7 @@ if(BLAS_FOUND)
# new >= 10.3
list(APPEND LAPACK_SEARCH_LIBS
"mkl_gf_lp64")
endif()
endif(BLA_F95)
# First try empty lapack libs
if (NOT ${_LIBRARIES})
......@@ -407,9 +439,14 @@ if(BLAS_FOUND)
else()
message(STATUS "Looking for MKL LAPACK: not found")
endif()
endif(NOT LAPACK_FIND_QUIETLY)
if (${_LIBRARIES} AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "Intel MKL")
endif()
endif ()
endif()
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
endif(NOT LAPACK_LIBRARIES)
endif(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
#goto lapack
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
......@@ -430,6 +467,9 @@ if(BLAS_FOUND)
message(STATUS "Looking for Goto LAPACK: not found")
endif()
endif()
if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "Goto")
endif()
endif(NOT LAPACK_LIBRARIES)
endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
......@@ -452,6 +492,9 @@ if(BLAS_FOUND)
message(STATUS "Looking for Open LAPACK: not found")
endif()
endif()
if (LAPACK_LIBRARIES AND NOT LAPACK_VENDOR_FOUND)
set (LAPACK_VENDOR_FOUND "Openblas")
endif()
endif(NOT LAPACK_LIBRARIES)
endif (BLA_VENDOR STREQUAL "Open" OR BLA_VENDOR STREQUAL "All")
......@@ -463,7 +506,7 @@ if(BLAS_FOUND)
LAPACK