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})
......
This diff is collapsed.
This diff is collapsed.
......@@ -372,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)
......
This diff is collapsed.
......@@ -82,8 +82,8 @@ if( PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_GIVEN_BY_USER )
#endif()
else()
message(STATUS "${Magenta}Looking for EZTRACE - not found using PkgConfig."
"\n Perhaps you should add the directory containing eztrace.pc to"
"\n the PKG_CONFIG_PATH environment variable.${ColourReset}")
"\n Perhaps you should add the directory containing eztrace.pc to"
"\n the PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
endif()
......@@ -180,15 +180,15 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND)
if(EZTRACE_DIR)
set(EZTRACE_eztrace.h_DIRS "EZTRACE_eztrace.h_DIRS-NOTFOUND")
find_path(EZTRACE_eztrace.h_DIRS
NAMES eztrace.h
HINTS ${EZTRACE_DIR}
PATH_SUFFIXES "include" "include/eztrace")
NAMES eztrace.h
HINTS ${EZTRACE_DIR}
PATH_SUFFIXES "include" "include/eztrace")
else()
set(EZTRACE_eztrace.h_DIRS "EZTRACE_eztrace.h_DIRS-NOTFOUND")
find_path(EZTRACE_eztrace.h_DIRS
NAMES eztrace.h
HINTS ${PATH_TO_LOOK_FOR}
PATH_SUFFIXES "eztrace")
NAMES eztrace.h
HINTS ${PATH_TO_LOOK_FOR}
PATH_SUFFIXES "eztrace")
endif()
endif()
mark_as_advanced(EZTRACE_eztrace.h_DIRS)
......@@ -225,9 +225,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND)
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
......@@ -251,14 +251,14 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND)
if(EZTRACE_DIR)
set(EZTRACE_eztrace_LIBRARY "EZTRACE_eztrace_LIBRARY-NOTFOUND")
find_library(EZTRACE_eztrace_LIBRARY
NAMES eztrace
HINTS ${EZTRACE_DIR}
PATH_SUFFIXES lib lib32 lib64)
NAMES eztrace
HINTS ${EZTRACE_DIR}
PATH_SUFFIXES lib lib32 lib64)
else()
set(EZTRACE_eztrace_LIBRARY "EZTRACE_eztrace_LIBRARY-NOTFOUND")
find_library(EZTRACE_eztrace_LIBRARY
NAMES eztrace
HINTS ${PATH_TO_LOOK_FOR})
NAMES eztrace
HINTS ${PATH_TO_LOOK_FOR})
endif()
endif()
mark_as_advanced(EZTRACE_eztrace_LIBRARY)
......@@ -315,10 +315,10 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND)
if(NOT EZTRACE_WORKS)
if(NOT EZTRACE_FIND_QUIETLY)
message(STATUS "Looking for eztrace : test of eztrace_topology_init with eztrace library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for eztrace : test of eztrace_topology_init with eztrace library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif()
endif()
set(CMAKE_REQUIRED_INCLUDES)
......@@ -334,6 +334,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}")
......
......@@ -7,9 +7,10 @@
# 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)
......@@ -115,6 +116,8 @@ if ((NOT FABULOUS_FOUND) AND (FABULOUS_GIVEN_BY_USER OR (NOT PKG_CONFIG_FOUND)))
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()
......@@ -127,6 +130,9 @@ if ((NOT FABULOUS_FOUND) AND (FABULOUS_GIVEN_BY_USER OR (NOT PKG_CONFIG_FOUND)))
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)
......@@ -139,17 +145,18 @@ if ((NOT FABULOUS_FOUND) AND (FABULOUS_GIVEN_BY_USER OR (NOT PKG_CONFIG_FOUND)))
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)
if (FABULOUS_FIND_REQUIRED)
find_package(CBLAS REQUIRED)
find_package(LAPACKE REQUIRED)
else()
find_package(CBLAS)
find_package(LAPACKE)
endif()
set(FABULOUS_LIBRARIES ${FABULOUS_STATIC_LIBRARY} ${CBLAS_LIBRARIES} ${LAPACKE_LIBRARIES})
set(FABULOUS_LIBRARIES ${FABULOUS_STATIC_LIBRARY} ${CBLAS_LIBRARIES} ${LAPACKE_LIBRARIES} "-lstdc++" "-lm")
elseif(FABULOUS_SHARED_FOUND)
set(FABULOUS_LIBRARIES ${FABULOUS_SHARED_LIBRARY})
set(FABULOUS_LIBRARIES ${FABULOUS_SHARED_LIBRARY} ${CBLAS_LIBRARIES} ${LAPACKE_LIBRARIES})
endif()
fabulous_check_function_exists(FABULOUS fabulous_create)
find_package_handle_standard_args(
......
This diff is collapsed.
......@@ -78,8 +78,8 @@ if(PKG_CONFIG_EXECUTABLE AND NOT FXT_GIVEN_BY_USER)
#endif()
else()
message(STATUS "${Magenta}Looking for FXT - not found using PkgConfig."
"\n Perhaps you should add the directory containing fxt.pc to the"
"\n PKG_CONFIG_PATH environment variable.${ColourReset}")
"\n Perhaps you should add the directory containing fxt.pc to the"
"\n PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
endif()
......@@ -137,15 +137,15 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR
if(FXT_DIR)
set(FXT_fxt.h_DIRS "FXT_fxt.h_DIRS-NOTFOUND")
find_path(FXT_fxt.h_DIRS
NAMES fxt.h
HINTS ${FXT_DIR}
PATH_SUFFIXES "include" "include/fxt")
NAMES fxt.h
HINTS ${FXT_DIR}
PATH_SUFFIXES "include" "include/fxt")
else()
set(FXT_fxt.h_DIRS "FXT_fxt.h_DIRS-NOTFOUND")
find_path(FXT_fxt.h_DIRS
NAMES fxt.h
HINTS ${_inc_env}
PATH_SUFFIXES "fxt")
NAMES fxt.h
HINTS ${_inc_env}
PATH_SUFFIXES "fxt")
endif()
endif()
mark_as_advanced(FXT_fxt.h_DIRS)
......@@ -183,9 +183,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
......@@ -206,14 +206,14 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR
if(FXT_DIR)
set(FXT_fxt_LIBRARY "FXT_fxt_LIBRARY-NOTFOUND")
find_library(FXT_fxt_LIBRARY
NAMES fxt
HINTS ${FXT_DIR}
PATH_SUFFIXES lib lib32 lib64)
NAMES fxt
HINTS ${FXT_DIR}
PATH_SUFFIXES lib lib32 lib64)
else()
set(FXT_fxt_LIBRARY "FXT_fxt_LIBRARY-NOTFOUND")
find_library(FXT_fxt_LIBRARY
NAMES fxt
HINTS ${_lib_env})
NAMES fxt
HINTS ${_lib_env})
endif()
endif()
mark_as_advanced(FXT_fxt_LIBRARY)
......@@ -270,10 +270,10 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR
if(NOT FXT_WORKS)
if(NOT FXT_FIND_QUIETLY)
message(STATUS "Looking for fxt : test of fut_keychange with fxt library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for fxt : test of fut_keychange with fxt library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif()
endif()
set(CMAKE_REQUIRED_INCLUDES)
......@@ -289,6 +289,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}")
......
......@@ -78,8 +78,8 @@ if(PKG_CONFIG_EXECUTABLE AND NOT GTG_GIVEN_BY_USER)
#endif()
else()
message(STATUS "${Magenta}Looking for GTG - not found using PkgConfig."
"\n Perhaps you should add the directory containing gtg.pc to the"
"\n PKG_CONFIG_PATH environment variable.${ColourReset}")
"\n Perhaps you should add the directory containing gtg.pc to the"
"\n PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
endif()
......@@ -137,15 +137,15 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT GTG_FOUND) OR
if(GTG_DIR)
set(GTG_GTG.h_DIRS "GTG_GTG.h_DIRS-NOTFOUND")
find_path(GTG_GTG.h_DIRS
NAMES GTG.h
HINTS ${GTG_DIR}
PATH_SUFFIXES "include" "include/gtg")
NAMES GTG.h
HINTS ${GTG_DIR}
PATH_SUFFIXES "include" "include/gtg")
else()
set(GTG_GTG.h_DIRS "GTG_GTG.h_DIRS-NOTFOUND")
find_path(GTG_GTG.h_DIRS
NAMES GTG.h
HINTS ${_inc_env}
PATH_SUFFIXES "gtg")
NAMES GTG.h
HINTS ${_inc_env}
PATH_SUFFIXES "gtg")
endif()
endif()
mark_as_advanced(GTG_GTG.h_DIRS)
......@@ -183,9 +183,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT GTG_FOUND) OR
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
......@@ -206,14 +206,14 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT GTG_FOUND) OR
if(GTG_DIR)
set(GTG_gtg_LIBRARY "GTG_gtg_LIBRARY-NOTFOUND")
find_library(GTG_gtg_LIBRARY
NAMES gtg
HINTS ${GTG_DIR}
PATH_SUFFIXES lib lib32 lib64)
NAMES gtg
HINTS ${GTG_DIR}
PATH_SUFFIXES lib lib32 lib64)
else()
set(GTG_gtg_LIBRARY "GTG_gtg_LIBRARY-NOTFOUND")
find_library(GTG_gtg_LIBRARY
NAMES gtg
HINTS ${_lib_env})
NAMES gtg
HINTS ${_lib_env})
endif()
endif()
mark_as_advanced(GTG_gtg_LIBRARY)
......@@ -270,10 +270,10 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT GTG_FOUND) OR
if(NOT GTG_WORKS)
if(NOT GTG_FIND_QUIETLY)
message(STATUS "Looking for gtg : test of GTG_start with gtg library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for gtg : test of GTG_start with gtg library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif()
endif()
set(CMAKE_REQUIRED_INCLUDES)
......@@ -289,6 +289,7 @@ if (GTG_LIBRARIES)
else()
list(GET GTG_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
set(GTG_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}")
......
......@@ -77,8 +77,8 @@ if(PKG_CONFIG_EXECUTABLE AND NOT HQR_GIVEN_BY_USER)
#endif()
else()
message(STATUS "${Magenta}Looking for HQR - not found using PkgConfig."
"\n Perhaps you should add the directory containing hqr.pc to the"
"\n PKG_CONFIG_PATH environment variable.${ColourReset}")
"\n Perhaps you should add the directory containing hqr.pc to the"
"\n PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
endif()
......@@ -133,14 +133,14 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HQR_FOUND) OR
if(HQR_DIR)
set(HQR_libhqr.h_DIRS "HQR_libhqr.h_DIRS-NOTFOUND")
find_path(HQR_libhqr.h_DIRS
NAMES libhqr.h
HINTS ${HQR_DIR}
NAMES libhqr.h
HINTS ${HQR_DIR})
else()
set(HQR_libhqr.h_DIRS "HQR_libhqr.h_DIRS-NOTFOUND")
find_path(HQR_libhqr.h_DIRS
NAMES libhqr.h
HINTS ${_inc_env}
PATH_SUFFIXES "hqr")
NAMES libhqr.h
HINTS ${_inc_env}
PATH_SUFFIXES "hqr")
endif()
endif()
mark_as_advanced(HQR_libhqr.h_DIRS)
......@@ -177,9 +177,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HQR_FOUND) OR
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
......@@ -200,14 +200,14 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HQR_FOUND) OR
if(HQR_DIR)
set(HQR_hqr_LIBRARY "HQR_hqr_LIBRARY-NOTFOUND")
find_library(HQR_hqr_LIBRARY
NAMES hqr
HINTS ${HQR_DIR}
PATH_SUFFIXES lib lib32 lib64)
NAMES hqr
HINTS ${HQR_DIR}
PATH_SUFFIXES lib lib32 lib64)
else()
set(HQR_hqr_LIBRARY "HQR_hqr_LIBRARY-NOTFOUND")
find_library(HQR_hqr_LIBRARY
NAMES hqr
HINTS ${_lib_env})
NAMES hqr
HINTS ${_lib_env})
endif()
endif()
mark_as_advanced(HQR_hqr_LIBRARY)
......@@ -259,15 +259,15 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HQR_FOUND) OR
# test link
unset(HQR_WORKS CACHE)
include(CheckFunctionExists)
check_function_exists(libhqr_hqr_init HQR_WORKS)
check_function_exists(libhqr_init_hqr HQR_WORKS)
mark_as_advanced(HQR_WORKS)
if(NOT HQR_WORKS)
if(NOT HQR_FIND_QUIETLY)
message(STATUS "Looking for hqr : test of libhqr_hqr_init with hqr library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for hqr : test of libhqr_hqr_init with hqr library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif()
endif()
set(CMAKE_REQUIRED_INCLUDES)
......@@ -283,6 +283,7 @@ if (HQR_LIBRARIES)
else()
list(GET HQR_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
set(HQR_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}")
......
......@@ -81,8 +81,8 @@ if( PKG_CONFIG_EXECUTABLE AND NOT HWLOC_GIVEN_BY_USER )
#endif()
else()
message(STATUS "${Magenta}Looking for HWLOC - not found using PkgConfig."
"\n Perhaps you should add the directory containing hwloc.pc to"
"\n the PKG_CONFIG_PATH environment variable.${ColourReset}")
"\n Perhaps you should add the directory containing hwloc.pc to"
"\n the PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
endif()
......@@ -141,15 +141,15 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) O
if(HWLOC_DIR)
set(HWLOC_hwloc.h_DIRS "HWLOC_hwloc.h_DIRS-NOTFOUND")
find_path(HWLOC_hwloc.h_DIRS
NAMES hwloc.h
HINTS ${HWLOC_DIR}
PATH_SUFFIXES "include" "include/hwloc")
NAMES hwloc.h
HINTS ${HWLOC_DIR}
PATH_SUFFIXES "include" "include/hwloc")
else()
set(HWLOC_hwloc.h_DIRS "HWLOC_hwloc.h_DIRS-NOTFOUND")
find_path(HWLOC_hwloc.h_DIRS
NAMES hwloc.h
HINTS ${PATH_TO_LOOK_FOR}
PATH_SUFFIXES "hwloc")
NAMES hwloc.h
HINTS ${PATH_TO_LOOK_FOR}
PATH_SUFFIXES "hwloc")
endif()
endif()
mark_as_advanced(HWLOC_hwloc.h_DIRS)
......@@ -186,9 +186,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) O
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
string(REPLACE ":" ";" _lib_env "$ENV{LD_LIBRARY_PATH}")
endif()
list(APPEND _lib_env "${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}")
list(APPEND _lib_env "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
......@@ -212,14 +212,14 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) O
if(HWLOC_DIR)
set(HWLOC_hwloc_LIBRARY "HWLOC_hwloc_LIBRARY-NOTFOUND")
find_library(HWLOC_hwloc_LIBRARY
NAMES hwloc
HINTS ${HWLOC_DIR}
PATH_SUFFIXES lib lib32 lib64)
NAMES hwloc
HINTS ${HWLOC_DIR}
PATH_SUFFIXES lib lib32 lib64)
else()
set(HWLOC_hwloc_LIBRARY "HWLOC_hwloc_LIBRARY-NOTFOUND")
find_library(HWLOC_hwloc_LIBRARY
NAMES hwloc
HINTS ${PATH_TO_LOOK_FOR})
NAMES hwloc
HINTS ${PATH_TO_LOOK_FOR})
endif()
endif()
mark_as_advanced(HWLOC_hwloc_LIBRARY)
......@@ -276,10 +276,10 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT HWLOC_FOUND) O
if(NOT HWLOC_WORKS)
if(NOT HWLOC_FIND_QUIETLY)
message(STATUS "Looking for hwloc : test of hwloc_topology_init with hwloc library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Looking for hwloc : test of hwloc_topology_init with hwloc library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif()
endif()
set(CMAKE_REQUIRED_INCLUDES)
......@@ -295,6 +295,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}")
......@@ -338,7 +339,7 @@ if (HWLOC_FOUND)
check_struct_has_member( "struct hwloc_obj" parent hwloc.h HAVE_HWLOC_PARENT_MEMBER )
check_struct_has_member( "struct hwloc_cache_attr_s" size hwloc.h HAVE_HWLOC_CACHE_ATTR )
check_c_source_compiles( "#include <hwloc.h>
int main(void) { hwloc_obj_t o; o->type = HWLOC_OBJ_PU; return 0;}" HAVE_HWLOC_OBJ_PU)
int main(void) { hwloc_obj_t o; o->type = HWLOC_OBJ_PU; return 0;}" HAVE_HWLOC_OBJ_PU)
include(CheckLibraryExists)
check_library_exists(${HWLOC_LIBRARIES} hwloc_bitmap_free "" HAVE_HWLOC_BITMAP)
......
###
# 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.
......
......@@ -244,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
......@@ -719,6 +718,9 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
if (LAPACK_FOUND)
list(GET LAPACK_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
if (NOT LAPACK_LIBRARY_DIRS)
set(LAPACK_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(LAPACK_DIR_FOUND "${not_cached_dir}" CACHE PATH "Installation directory of LAPACK 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.
#
###
......@@ -18,6 +18,11 @@
# LAPACKE depends on the following libraries:
# - LAPACK
#
# COMPONENTS are optional libraries CHAMELEON could be linked with,
# Use it to drive detection of a specific compilation chain
# COMPONENTS can be some of the following:
# - TMG: to check that LAPACKE provides the tmglib interface
#
# This module finds headers and lapacke library.
# Results are reported in variables:
# LAPACKE_FOUND - True if headers and requested libraries were found
......@@ -49,7 +54,7 @@
# 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.
......@@ -68,6 +73,16 @@ if (NOT LAPACKE_FOUND)
endif()
endif()
# to check that LAPACKE provides the tmglib interface
set(LAPACKE_WITH_TMG OFF)
if( LAPACKE_FIND_COMPONENTS )
foreach( component ${LAPACKE_FIND_COMPONENTS} )
if (${component} STREQUAL "TMG")
set(LAPACKE_WITH_TMG ON)
endif()
endforeach()
endif()
# LAPACKE depends on LAPACK anyway, try to find it
if (NOT LAPACK_FOUND)
if(LAPACKE_FIND_REQUIRED)
......@@ -324,6 +339,10 @@ if (LAPACK_FOUND)
unset(LAPACKE_WORKS CACHE)
include(CheckFunctionExists)
check_function_exists(LAPACKE_dgeqrf LAPACKE_WORKS)
if (LAPACKE_WORKS AND LAPACKE_WITH_TMG)
unset(LAPACKE_WORKS CACHE)
check_function_exists(LAPACKE_dlatms_work LAPACKE_WORKS)
endif()
mark_as_advanced(LAPACKE_WORKS)
if(LAPACKE_WORKS)
......@@ -362,6 +381,9 @@ endif(LAPACK_FOUND)
if (LAPACKE_LIBRARIES)
list(GET LAPACKE_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
if (NOT LAPACKE_LIBRARY_DIRS)
set(LAPACKE_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(LAPACKE_DIR_FOUND "${not_cached_dir}" CACHE PATH "Installation directory of LAPACKE 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-2017 Inria. All rights reserved.
# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
......@@ -18,17 +18,21 @@
#
# The following variables have been added to manage links with sequential or multithreaded
# versions:
# LAPACK_INCLUDE_DIRS - LAPACK include directories