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

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.
......@@ -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,17 +18,27 @@
#
# The following variables have been added to manage links with sequential or multithreaded
# versions:
# 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_PAR_LIBRARIES - BLAS component libraries to be linked (multithreaded)
# 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
......@@ -161,14 +171,14 @@ if(BLA_VENDOR MATCHES "Intel*")
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)
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})
NAMES mkl.h
HINTS ${_inc_env})
endif()
endif()
mark_as_advanced(BLAS_mkl.h_INCLUDE_DIRS)
......@@ -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
......@@ -296,7 +320,7 @@ foreach(blas_lib ${BLAS_LIBRARIES})
else()
get_filename_component(a_blas_lib_dir "${blas_lib}" PATH)
if (EXISTS "${a_blas_lib_dir}")
list(APPEND BLAS_LIBRARY_DIRS "${a_blas_lib_dir}" )
list(APPEND BLAS_LIBRARY_DIRS "${a_blas_lib_dir}" )
endif()
endif()
endif()
......@@ -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 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)
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
BLAS_PAR_LIBRARIES)
endif()
else()
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS found is Intel MKL")
message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES")
endif()
find_package_handle_standard_args(BLASEXT DEFAULT_MSG
BLAS_SEQ_LIBRARIES
BLAS_LIBRARY_DIRS
BLAS_INCLUDE_DIRS)
if(BLA_VENDOR MATCHES "Intel10_64lp*" AND BLAS_PAR_LIBRARIES)
if(NOT BLASEXT_FIND_QUIETLY)
message(STATUS "BLAS sequential libraries stored in BLAS_SEQ_LIBRARIES")
message(STATUS "BLAS parallel libraries stored in BLAS_PAR_LIBRARIES")
endif()
find_package_handle_standard_args(BLAS DEFAULT_MSG
BLAS_SEQ_LIBRARIES
BLAS_LIBRARY_DIRS
BLAS_INCLUDE_DIRS)
find_package_handle_standard_args(BLASEXT DEFAULT_MSG
BLAS_PAR_LIBRARIES)
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()
......@@ -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)
......
......@@ -141,28 +141,28 @@ if(PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_GIVEN_BY_USER)
#endif()
else()
message(STATUS "${Magenta}Looking for CHAMELEON - not found using PkgConfig."
"\n Perhaps you should add the directory containing chameleon.pc"
"\n to the PKG_CONFIG_PATH environment variable.${ColourReset}")
"\n Perhaps you should add the directory containing chameleon.pc"
"\n to the PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
endif()
if (CHAMELEON_FIND_VERSION_EXACT)
if( NOT (CHAMELEON_FIND_VERSION_MAJOR STREQUAL CHAMELEON_VERSION_MAJOR) OR
NOT (CHAMELEON_FIND_VERSION_MINOR STREQUAL CHAMELEON_VERSION_MINOR) )
NOT (CHAMELEON_FIND_VERSION_MINOR STREQUAL CHAMELEON_VERSION_MINOR) )
if(NOT CHAMELEON_FIND_QUIETLY)
message(FATAL_ERROR
"CHAMELEON version found is ${CHAMELEON_VERSION_STRING}"
"when required is ${CHAMELEON_FIND_VERSION}")
message(FATAL_ERROR
"CHAMELEON version found is ${CHAMELEON_VERSION_STRING}"
"when required is ${CHAMELEON_FIND_VERSION}")
endif()
endif()
else()
# if the version found is older than the required then error
if( (CHAMELEON_FIND_VERSION_MAJOR STRGREATER CHAMELEON_VERSION_MAJOR) OR
(CHAMELEON_FIND_VERSION_MINOR STRGREATER CHAMELEON_VERSION_MINOR) )
(CHAMELEON_FIND_VERSION_MINOR STRGREATER CHAMELEON_VERSION_MINOR) )
if(NOT CHAMELEON_FIND_QUIETLY)
message(FATAL_ERROR
"CHAMELEON version found is ${CHAMELEON_VERSION_STRING}"
"when required is ${CHAMELEON_FIND_VERSION} or newer")
message(FATAL_ERROR
"CHAMELEON version found is ${CHAMELEON_VERSION_STRING}"
"when required is ${CHAMELEON_FIND_VERSION} or newer")
endif()
endif()
endif()
......@@ -213,8 +213,8 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
list(APPEND CHAMELEON_EXTRA_LIBRARIES "${CHAMELEON_M_m_LIBRARY}")
else()
if (CHAMELEON_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find libm on your system."
"Are you sure to a have a C compiler installed?")
message(FATAL_ERROR "Could NOT find libm on your system."
"Are you sure to a have a C compiler installed?")
endif()
endif()
endif()
......@@ -236,7 +236,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
list(APPEND CHAMELEON_EXTRA_LIBRARIES "${CHAMELEON_RT_rt_LIBRARY}")
else()
if (CHAMELEON_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find librt on your system")
message(FATAL_ERROR "Could NOT find librt on your system")
endif()
endif()
endif()
......@@ -345,7 +345,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
# at cmake configure
if (CHAMELEON_LOOK_FOR_MPI)
if(NOT MPI_C_COMPILER)
set(MPI_C_COMPILER mpicc)
set(MPI_C_COMPILER mpicc)
endif()
list(APPEND STARPU_COMPONENT_LIST "MPI")
endif()
......@@ -357,10 +357,10 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
endif()
if (CHAMELEON_FIND_REQUIRED AND CHAMELEON_FIND_REQUIRED_STARPU)
find_package(STARPU ${CHAMELEON_STARPU_VERSION} REQUIRED
COMPONENTS ${STARPU_COMPONENT_LIST})
COMPONENTS ${STARPU_COMPONENT_LIST})
else()
find_package(STARPU ${CHAMELEON_STARPU_VERSION}
COMPONENTS ${STARPU_COMPONENT_LIST})
COMPONENTS ${STARPU_COMPONENT_LIST})
endif()
endif()
......@@ -421,15 +421,15 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
if(CHAMELEON_DIR)
set(CHAMELEON_morse.h_DIRS "CHAMELEON_morse.h_DIRS-NOTFOUND")
find_path(CHAMELEON_morse.h_DIRS
NAMES morse.h
HINTS ${CHAMELEON_DIR}
PATH_SUFFIXES "include" "include/chameleon")
NAMES morse.h
HINTS ${CHAMELEON_DIR}
PATH_SUFFIXES "include" "include/chameleon")
else()
set(CHAMELEON_morse.h_DIRS "CHAMELEON_morse.h_DIRS-NOTFOUND")
find_path(CHAMELEON_morse.h_DIRS
NAMES morse.h
HINTS ${_inc_env}
PATH_SUFFIXES "chameleon")
NAMES morse.h
HINTS ${_inc_env}
PATH_SUFFIXES "chameleon")
endif()
endif()
mark_as_advanced(CHAMELEON_morse.h_DIRS)
......@@ -463,9 +463,9 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
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}")
......@@ -490,24 +490,24 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
foreach(chameleon_lib ${CHAMELEON_libs_to_find})
set(CHAMELEON_${chameleon_lib}_LIBRARY "CHAMELEON_${chameleon_lib}_LIBRARY-NOTFOUND")
find_library(CHAMELEON_${chameleon_lib}_LIBRARY
NAMES ${chameleon_lib}
HINTS ${CHAMELEON_LIBDIR})
NAMES ${chameleon_lib}
HINTS ${CHAMELEON_LIBDIR})
endforeach()
else()
if(CHAMELEON_DIR)
foreach(chameleon_lib ${CHAMELEON_libs_to_find})
set(CHAMELEON_${chameleon_lib}_LIBRARY "CHAMELEON_${chameleon_lib}_LIBRARY-NOTFOUND")
find_library(CHAMELEON_${chameleon_lib}_LIBRARY
NAMES ${chameleon_lib}
HINTS ${CHAMELEON_DIR}
PATH_SUFFIXES lib lib32 lib64)
set(CHAMELEON_${chameleon_lib}_LIBRARY "CHAMELEON_${chameleon_lib}_LIBRARY-NOTFOUND")
find_library(CHAMELEON_${chameleon_lib}_LIBRARY
NAMES ${chameleon_lib}
HINTS ${CHAMELEON_DIR}
PATH_SUFFIXES lib lib32 lib64)
endforeach()
else()
foreach(chameleon_lib ${CHAMELEON_libs_to_find})
set(CHAMELEON_${chameleon_lib}_LIBRARY "CHAMELEON_${chameleon_lib}_LIBRARY-NOTFOUND")
find_library(CHAMELEON_${chameleon_lib}_LIBRARY
NAMES ${chameleon_lib}
HINTS ${_lib_env})
set(CHAMELEON_${chameleon_lib}_LIBRARY "CHAMELEON_${chameleon_lib}_LIBRARY-NOTFOUND")
find_library(CHAMELEON_${chameleon_lib}_LIBRARY
NAMES ${chameleon_lib}
HINTS ${_lib_env})
endforeach()
endif()
endif()
......@@ -546,180 +546,180 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT CHAMELEON_FOUN
endif()
foreach(libdir ${CHAMELEON_LIBRARY_DIRS})
if (libdir)
list(APPEND REQUIRED_LIBDIRS "${libdir}")
list(APPEND REQUIRED_LIBDIRS "${libdir}")
endif()
endforeach()
set(REQUIRED_LIBS "${CHAMELEON_LIBRARIES}")
# STARPU
if (STARPU_FOUND AND CHAMELEON_LOOK_FOR_STARPU)
if (STARPU_INCLUDE_DIRS_DEP)
list(APPEND REQUIRED_INCDIRS "${STARPU_INCLUDE_DIRS_DEP}")
list(APPEND REQUIRED_INCDIRS "${STARPU_INCLUDE_DIRS_DEP}")
elseif (STARPU_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${STARPU_INCLUDE_DIRS}")
list(APPEND REQUIRED_INCDIRS "${STARPU_INCLUDE_DIRS}")
endif()
if(STARPU_LIBRARY_DIRS_DEP)
list(APPEND REQUIRED_LIBDIRS "${STARPU_LIBRARY_DIRS_DEP}")
list(APPEND REQUIRED_LIBDIRS "${STARPU_LIBRARY_DIRS_DEP}")
elseif(STARPU_LIBRARY_DIRS)
list(APPEND REQUIRED_LIBDIRS "${STARPU_LIBRARY_DIRS}")
list(APPEND REQUIRED_LIBDIRS "${STARPU_LIBRARY_DIRS}")
endif()
if (STARPU_LIBRARIES_DEP)
list(APPEND REQUIRED_LIBS "${STARPU_LIBRARIES_DEP}")
list(APPEND REQUIRED_LIBS "${STARPU_LIBRARIES_DEP}")
elseif (STARPU_LIBRARIES)
foreach(lib ${STARPU_LIBRARIES})
if (EXISTS ${lib} OR ${lib} MATCHES "^-")
list(APPEND REQUIRED_LIBS "${lib}")
else()
list(APPEND REQUIRED_LIBS "-l${lib}")
endif()
endforeach()
foreach(lib ${STARPU_LIBRARIES})
if (EXISTS ${lib} OR ${lib} MATCHES "^-")
list(APPEND REQUIRED_LIBS "${lib}")
else()
list(APPEND REQUIRED_LIBS "-l${lib}")
endif()
endforeach()
endif()
endif()
# QUARK
if (QUARK_FOUND AND CHAMELEON_LOOK_FOR_QUARK)
if (QUARK_INCLUDE_DIRS_DEP)
list(APPEND REQUIRED_INCDIRS "${QUARK_INCLUDE_DIRS_DEP}")
list(APPEND REQUIRED_INCDIRS "${QUARK_INCLUDE_DIRS_DEP}")
elseif(QUARK_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${QUARK_INCLUDE_DIRS}")
list(APPEND REQUIRED_INCDIRS "${QUARK_INCLUDE_DIRS}")
endif()
if(QUARK_LIBRARY_DIRS_DEP)
list(APPEND REQUIRED_LIBDIRS "${QUARK_LIBRARY_DIRS_DEP}")
list(APPEND REQUIRED_LIBDIRS "${QUARK_LIBRARY_DIRS_DEP}")
elseif(QUARK_LIBRARY_DIRS)
list(APPEND REQUIRED_LIBDIRS "${QUARK_LIBRARY_DIRS}")
list(APPEND REQUIRED_LIBDIRS "${QUARK_LIBRARY_DIRS}")
endif()
if (QUARK_LIBRARY_DIRS_DEP)
list(APPEND REQUIRED_LIBS "${QUARK_LIBRARIES_DEP}")
list(APPEND REQUIRED_LIBS "${QUARK_LIBRARIES_DEP}")
elseif (QUARK_LIBRARY_DIRS_DEP)
list(APPEND REQUIRED_LIBS "${QUARK_LIBRARIES}")
list(APPEND REQUIRED_LIBS "${QUARK_LIBRARIES}")
endif()
endif()
# CUDA
if (CUDA_FOUND AND CHAMELEON_LOOK_FOR_CUDA)
if (CUDA_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${CUDA_INCLUDE_DIRS}")
list(APPEND REQUIRED_INCDIRS "${CUDA_INCLUDE_DIRS}")
endif()