Commit 0ca7afc1 authored by PRUVOST Florent's avatar PRUVOST Florent
Browse files
parent 0dde3826
......@@ -47,7 +47,6 @@
include(CheckStructHasMember)
include(CheckCSourceCompiles)
include(CheckLibraryExists)
if (NOT HWLOC_FOUND)
set(HWLOC_DIR "" CACHE PATH "Installation directory of HWLOC library")
......@@ -323,6 +322,7 @@ if (HWLOC_FOUND)
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)
include(CheckLibraryExists)
check_library_exists(${HWLOC_LIBRARIES} hwloc_bitmap_free "" HAVE_HWLOC_BITMAP)
set(CMAKE_REQUIRED_INCLUDES ${HWLOC_SAVE_CMAKE_REQUIRED_INCLUDES})
......
......@@ -38,6 +38,7 @@
# PARSEC_LIBRARY_DIRS_DEP - parsec + dependencies link directories
# PARSEC_LIBRARIES_DEP - parsec libraries + dependencies
# PARSEC_daguepp_BIN_DIR - path to parsec driver daguepp
# PARSEC_DAGUEPP - parsec jdf compiler
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DPARSEC=path/to/parsec):
# PARSEC_DIR - Where to find the base directory of parsec
......@@ -151,6 +152,21 @@ if(UNIX AND NOT APPLE)
endif()
endif()
# Try to find libdl
if (NOT PARSEC_FIND_QUIETLY)
message(STATUS "Looking for PARSEC - Try to detect libdl")
endif()
set(PARSEC_DL_LIBRARIES "")
find_library(
PARSEC_DL_LIBRARY
NAMES dl
)
mark_as_advanced(PARSEC_DL_LIBRARY)
if (PARSEC_DL_LIBRARY)
list(APPEND PARSEC_DL_LIBRARIES "${PARSEC_DL_LIBRARY}")
list(APPEND PARSEC_EXTRA_LIBRARIES "${PARSEC_DL_LIBRARY}")
endif()
# PARSEC may depend on HWLOC, try to find it
if (NOT HWLOC_FOUND AND PARSEC_LOOK_FOR_HWLOC)
if (PARSEC_FIND_REQUIRED)
......@@ -549,7 +565,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT PARSEC_FOUND)
list(APPEND REQUIRED_LIBS "${FORTRAN_ifcore_LIBRARY}")
endif()
endif()
# EXTRA LIBS such that pthread, m, rt
# EXTRA LIBS such that pthread, m, rt, dl
list(APPEND REQUIRED_LIBS ${PARSEC_EXTRA_LIBRARIES})
# set required libraries for link
......@@ -632,3 +648,11 @@ else()
PARSEC_daguepp_BIN_DIR
PARSEC_WORKS)
endif()
if ( PARSEC_daguepp_BIN_DIR )
find_program(PARSEC_DAGUEPP
NAMES daguepp
HINTS ${PARSEC_daguepp_BIN_DIR})
else()
set(PARSEC_DAGUEPP "PARSEC_DAGUEPP-NOTFOUND")
endif()
###
#
# @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-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
#
# - Find SIMGRID include dirs and libraries
# Use this module by invoking find_package with the form:
# find_package(SIMGRID
# [REQUIRED]) # Fail with error if simgrid is not found
#
# This module finds headers and simgrid library.
# Results are reported in variables:
# SIMGRID_FOUND - True if headers and requested libraries were found
# SIMGRID_INCLUDE_DIRS - simgrid include directories
# SIMGRID_LIBRARY_DIRS - Link directories for simgrid libraries
# SIMGRID_LIBRARIES - simgrid component libraries to be linked
#
# The user can give specific paths where to find the libraries adding cmake
# options at configure (ex: cmake path/to/project -DSIMGRID_DIR=path/to/simgrid):
# SIMGRID_DIR - Where to find the base directory of simgrid
# SIMGRID_INCDIR - Where to find the header files
# SIMGRID_LIBDIR - Where to find the library files
# The module can also look for the following environment variables if paths
# are not given as cmake variable: SIMGRID_DIR, SIMGRID_INCDIR, SIMGRID_LIBDIR
#=============================================================================
# Copyright 2012-2013 Inria
# Copyright 2012-2013 Emmanuel Agullo
# Copyright 2012-2013 Mathieu Faverge
# Copyright 2012 Cedric Castagnede
# Copyright 2013 Florent Pruvost
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file MORSE-Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of Morse, substitute the full
# License text for the above reference.)
if (NOT SIMGRID_FOUND)
set(SIMGRID_DIR "" CACHE PATH "Installation directory of SIMGRID library")
if (NOT SIMGRID_FIND_QUIETLY)
message(STATUS "A cache variable, namely SIMGRID_DIR, has been set to specify the install directory of SIMGRID")
endif()
endif()
set(ENV_SIMGRID_DIR "$ENV{SIMGRID_DIR}")
set(ENV_SIMGRID_INCDIR "$ENV{SIMGRID_INCDIR}")
set(ENV_SIMGRID_LIBDIR "$ENV{SIMGRID_LIBDIR}")
set(SIMGRID_GIVEN_BY_USER "FALSE")
if ( SIMGRID_DIR OR ( SIMGRID_INCDIR AND SIMGRID_LIBDIR) OR ENV_SIMGRID_DIR OR (ENV_SIMGRID_INCDIR AND ENV_SIMGRID_LIBDIR) )
set(SIMGRID_GIVEN_BY_USER "TRUE")
endif()
# Optionally use pkg-config to detect include/library dirs (if pkg-config is available)
# -------------------------------------------------------------------------------------
include(FindPkgConfig)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_EXECUTABLE AND NOT SIMGRID_GIVEN_BY_USER)
pkg_search_module(SIMGRID simgrid)
if (NOT SIMGRID_FIND_QUIETLY)
if (SIMGRID_FOUND AND SIMGRID_LIBRARIES)
message(STATUS "Looking for SIMGRID - found using PkgConfig")
#if(NOT SIMGRID_INCLUDE_DIRS)
# message("${Magenta}SIMGRID_INCLUDE_DIRS is empty using PkgConfig."
# "Perhaps the path to simgrid headers is already present in your"
# "C(PLUS)_INCLUDE_PATH environment variable.${ColourReset}")
#endif()
else()
message("${Magenta}Looking for SIMGRID - not found using PkgConfig."
"Perhaps you should add the directory containing simgrid.pc to the"
"PKG_CONFIG_PATH environment variable.${ColourReset}")
endif()
endif()
endif(PKG_CONFIG_EXECUTABLE AND NOT SIMGRID_GIVEN_BY_USER)
if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT SIMGRID_FOUND) OR (SIMGRID_GIVEN_BY_USER) )
if (NOT SIMGRID_FIND_QUIETLY)
message(STATUS "Looking for SIMGRID - PkgConfig not used")
endif()
# Looking for include
# -------------------
# Add system include paths to search include
# ------------------------------------------
unset(_inc_env)
set(ENV_SIMGRID_DIR "$ENV{SIMGRID_DIR}")
set(ENV_SIMGRID_INCDIR "$ENV{SIMGRID_INCDIR}")
if(ENV_SIMGRID_INCDIR)
list(APPEND _inc_env "${ENV_SIMGRID_INCDIR}")
elseif(ENV_SIMGRID_DIR)
list(APPEND _inc_env "${ENV_SIMGRID_DIR}")
list(APPEND _inc_env "${ENV_SIMGRID_DIR}/include")
list(APPEND _inc_env "${ENV_SIMGRID_DIR}/include/simgrid")
else()
if(WIN32)
string(REPLACE ":" ";" _inc_env "$ENV{INCLUDE}")
else()
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{C_INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{CPATH}")
list(APPEND _inc_env "${_path_env}")
string(REPLACE ":" ";" _path_env "$ENV{INCLUDE_PATH}")
list(APPEND _inc_env "${_path_env}")
endif()
endif()
list(APPEND _inc_env "${CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES}")
list(APPEND _inc_env "${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}")
list(REMOVE_DUPLICATES _inc_env)
# Try to find the simgrid header in the given paths
# -------------------------------------------------
# call cmake macro to find the header path
if(SIMGRID_INCDIR)
set(SIMGRID_simgrid.h_DIRS "SIMGRID_simgrid.h_DIRS-NOTFOUND")
find_path(SIMGRID_simgrid.h_DIRS
NAMES simgrid.h
HINTS ${SIMGRID_INCDIR})
else()
if(SIMGRID_DIR)
set(SIMGRID_simgrid.h_DIRS "SIMGRID_simgrid.h_DIRS-NOTFOUND")
find_path(SIMGRID_simgrid.h_DIRS
NAMES simgrid.h
HINTS ${SIMGRID_DIR}
PATH_SUFFIXES "include" "include/simgrid")
else()
set(SIMGRID_simgrid.h_DIRS "SIMGRID_simgrid.h_DIRS-NOTFOUND")
find_path(SIMGRID_simgrid.h_DIRS
NAMES simgrid.h
HINTS ${_inc_env}
PATH_SUFFIXES "simgrid")
endif()
endif()
mark_as_advanced(SIMGRID_simgrid.h_DIRS)
# Add path to cmake variable
# ------------------------------------
if (SIMGRID_simgrid.h_DIRS)
set(SIMGRID_INCLUDE_DIRS "${SIMGRID_simgrid.h_DIRS}")
else ()
set(SIMGRID_INCLUDE_DIRS "SIMGRID_INCLUDE_DIRS-NOTFOUND")
if(NOT SIMGRID_FIND_QUIETLY)
message(STATUS "Looking for simgrid -- simgrid.h not found")
endif()
endif ()
if (SIMGRID_INCLUDE_DIRS)
list(REMOVE_DUPLICATES SIMGRID_INCLUDE_DIRS)
endif ()
# Looking for lib
# ---------------
# Add system library paths to search lib
# --------------------------------------
unset(_lib_env)
set(ENV_SIMGRID_LIBDIR "$ENV{SIMGRID_LIBDIR}")
if(ENV_SIMGRID_LIBDIR)
list(APPEND _lib_env "${ENV_SIMGRID_LIBDIR}")
elseif(ENV_SIMGRID_DIR)
list(APPEND _lib_env "${ENV_SIMGRID_DIR}")
list(APPEND _lib_env "${ENV_SIMGRID_DIR}/lib")
else()
if(WIN32)
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
else()
if(APPLE)
string(REPLACE ":" ";" _lib_env "$ENV{DYLD_LIBRARY_PATH}")
else()
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}")
endif()
endif()
list(REMOVE_DUPLICATES _lib_env)
# Try to find the simgrid lib in the given paths
# ----------------------------------------------
# call cmake macro to find the lib path
if(SIMGRID_LIBDIR)
set(SIMGRID_simgrid_LIBRARY "SIMGRID_simgrid_LIBRARY-NOTFOUND")
find_library(SIMGRID_simgrid_LIBRARY
NAMES simgrid
HINTS ${SIMGRID_LIBDIR})
else()
if(SIMGRID_DIR)
set(SIMGRID_simgrid_LIBRARY "SIMGRID_simgrid_LIBRARY-NOTFOUND")
find_library(SIMGRID_simgrid_LIBRARY
NAMES simgrid
HINTS ${SIMGRID_DIR}
PATH_SUFFIXES lib lib32 lib64)
else()
set(SIMGRID_simgrid_LIBRARY "SIMGRID_simgrid_LIBRARY-NOTFOUND")
find_library(SIMGRID_simgrid_LIBRARY
NAMES simgrid
HINTS ${_lib_env})
endif()
endif()
mark_as_advanced(SIMGRID_simgrid_LIBRARY)
# If found, add path to cmake variable
# ------------------------------------
if (SIMGRID_simgrid_LIBRARY)
get_filename_component(simgrid_lib_path ${SIMGRID_simgrid_LIBRARY} PATH)
# set cmake variables (respects naming convention)
set(SIMGRID_LIBRARIES "${SIMGRID_simgrid_LIBRARY}")
set(SIMGRID_LIBRARY_DIRS "${simgrid_lib_path}")
else ()
set(SIMGRID_LIBRARIES "SIMGRID_LIBRARIES-NOTFOUND")
set(SIMGRID_LIBRARY_DIRS "SIMGRID_LIBRARY_DIRS-NOTFOUND")
if(NOT SIMGRID_FIND_QUIETLY)
message(STATUS "Looking for simgrid -- lib simgrid not found")
endif()
endif ()
if (SIMGRID_LIBRARY_DIRS)
list(REMOVE_DUPLICATES SIMGRID_LIBRARY_DIRS)
endif ()
# check a function to validate the find
if(SIMGRID_LIBRARIES)
set(REQUIRED_INCDIRS)
set(REQUIRED_LIBDIRS)
set(REQUIRED_LIBS)
# SIMGRID
if (SIMGRID_INCLUDE_DIRS)
set(REQUIRED_INCDIRS "${SIMGRID_INCLUDE_DIRS}")
endif()
if (SIMGRID_LIBRARY_DIRS)
set(REQUIRED_LIBDIRS "${SIMGRID_LIBRARY_DIRS}")
endif()
set(REQUIRED_LIBS "${SIMGRID_LIBRARIES}")
# set required libraries for link
set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}")
set(CMAKE_REQUIRED_LIBRARIES)
foreach(lib_dir ${REQUIRED_LIBDIRS})
list(APPEND CMAKE_REQUIRED_LIBRARIES "-L${lib_dir}")
endforeach()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LIBS}")
string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
# test link
unset(SIMGRID_WORKS CACHE)
include(CheckFunctionExists)
check_function_exists(MSG_main SIMGRID_WORKS)
mark_as_advanced(SIMGRID_WORKS)
if(NOT SIMGRID_WORKS)
if(NOT SIMGRID_FIND_QUIETLY)
message(STATUS "Looking for simgrid : test of fut_keychange with simgrid 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)
set(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_LIBRARIES)
endif(SIMGRID_LIBRARIES)
endif( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT SIMGRID_FOUND) OR (SIMGRID_GIVEN_BY_USER) )
if (SIMGRID_LIBRARIES)
if (SIMGRID_LIBRARY_DIRS)
list(GET SIMGRID_LIBRARY_DIRS 0 first_lib_path)
else()
list(GET SIMGRID_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
endif()
if (${first_lib_path} MATCHES "/lib(32|64)?$")
string(REGEX REPLACE "/lib(32|64)?$" "" not_cached_dir "${first_lib_path}")
set(SIMGRID_DIR_FOUND "${not_cached_dir}" CACHE PATH "Installation directory of SIMGRID library" FORCE)
else()
set(SIMGRID_DIR_FOUND "${first_lib_path}" CACHE PATH "Installation directory of SIMGRID library" FORCE)
endif()
endif()
# check that SIMGRID has been found
# -------------------------------
include(FindPackageHandleStandardArgs)
if (PKG_CONFIG_EXECUTABLE AND SIMGRID_FOUND)
find_package_handle_standard_args(SIMGRID DEFAULT_MSG
SIMGRID_LIBRARIES)
else()
find_package_handle_standard_args(SIMGRID DEFAULT_MSG
SIMGRID_LIBRARIES
SIMGRID_WORKS)
endif()
......@@ -3,8 +3,8 @@
# @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-2015 Inria. All rights reserved.
# @copyright (c) 2012-2016 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
#
......@@ -25,6 +25,7 @@
# - BLAS: to activate the detection of StarPU linked with BLAS
# - MAGMA: to activate the detection of StarPU linked with MAGMA
# - FXT: to activate the detection of StarPU linked with FxT
# - SIMGRID: to activate the detection of StarPU linked with SimGrid
#
# Results are reported in variables:
# STARPU_FOUND - True if headers and requested libraries were found
......@@ -81,6 +82,7 @@ set(STARPU_LOOK_FOR_MPI FALSE)
set(STARPU_LOOK_FOR_BLAS FALSE)
set(STARPU_LOOK_FOR_MAGMA FALSE)
set(STARPU_LOOK_FOR_FXT FALSE)
set(STARPU_LOOK_FOR_SIMGRID FALSE)
if( STARPU_FIND_COMPONENTS )
foreach( component ${STARPU_FIND_COMPONENTS} )
......@@ -96,10 +98,30 @@ if( STARPU_FIND_COMPONENTS )
set(STARPU_LOOK_FOR_MAGMA TRUE)
elseif(${component} STREQUAL "FXT")
set(STARPU_LOOK_FOR_FXT TRUE)
elseif(${component} STREQUAL "SIMGRID")
set(STARPU_LOOK_FOR_SIMGRID TRUE)
endif()
endforeach()
endif()
# STARPU may depend on pthread, try to find it
find_package(Threads)
if( THREADS_FOUND )
list(APPEND STARPU_EXTRA_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif ()
# STARPU may depend on libm, try to find it
find_library(M_m_LIBRARY NAMES m)
mark_as_advanced(M_m_LIBRARY)
if( M_m_LIBRARY )
list(APPEND STARPU_EXTRA_LIBRARIES ${M_m_LIBRARY})
endif ()
# STARPU may depend on librt, try to find it
find_library(RT_rt_LIBRARY NAMES m)
mark_as_advanced(RT_rt_LIBRARY)
if( RT_rt_LIBRARY )
list(APPEND STARPU_EXTRA_LIBRARIES ${RT_rt_LIBRARY})
endif ()
# STARPU may depend on HWLOC, try to find it
if (NOT HWLOC_FOUND AND STARPU_LOOK_FOR_HWLOC)
if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_HWLOC)
......@@ -165,6 +187,15 @@ if (NOT FXT_FOUND AND STARPU_LOOK_FOR_FXT)
endif()
endif()
# STARPU may depend on SIMGRID, try to find it
if (NOT SIMGRID_FOUND AND STARPU_LOOK_FOR_SIMGRID)
if (STARPU_FIND_REQUIRED AND STARPU_FIND_REQUIRED_SIMGRID)
find_package(SIMGRID REQUIRED)
else()
find_package(SIMGRID)
endif()
endif()
set(ENV_STARPU_DIR "$ENV{STARPU_DIR}")
set(ENV_STARPU_INCDIR "$ENV{STARPU_INCDIR}")
set(ENV_STARPU_LIBDIR "$ENV{STARPU_LIBDIR}")
......@@ -232,9 +263,17 @@ if(PKG_CONFIG_EXECUTABLE AND NOT STARPU_GIVEN_BY_USER)
endif()
if(STARPU_MPI_LIBRARIES)
if (STARPU_LOOK_FOR_SIMGRID)
# Cmake does not fetch explicit libfxt.a static paths from pkg-config...
find_package(FXT)
string(REGEX MATCH "[^;]*/libfxt.a" FXT_STATIC_LIB "${STARPU_MPI_LDFLAGS_OTHER}")
list(APPEND STARPU_MPI_LIBRARIES "${FXT_STATIC_LIB}")
endif()
set(STARPU_LIBRARIES "${STARPU_MPI_LIBRARIES}")
set(STARPU_LINKER_FLAGS "${STARPU_MPI_LDFLAGS_OTHER}")
elseif(STARPU_SHM_LIBRARIES)
set(STARPU_LIBRARIES "${STARPU_SHM_LIBRARIES}")
set(STARPU_LINKER_FLAGS "${STARPU_SHM_LDFLAGS_OTHER}")
else()
set(STARPU_LIBRARIES "STARPU_LIBRARIES-NOTFOUND")
endif()
......@@ -735,6 +774,23 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT STARPU_FOUND)
endif()
endforeach()
endif()
# SIMGRID
if (SIMGRID_FOUND AND STARPU_LOOK_FOR_SIMGRID)
if (SIMGRID_INCLUDE_DIRS)
list(APPEND REQUIRED_INCDIRS "${SIMGRID_INCLUDE_DIRS}")
endif()
if (SIMGRID_LIBRARY_DIRS)
list(APPEND REQUIRED_LIBDIRS "${SIMGRID_LIBRARY_DIRS}")
endif()
foreach(lib ${SIMGRID_LIBRARIES})
if (EXISTS ${lib} OR ${lib} MATCHES "^-")
list(APPEND REQUIRED_LIBS "${lib}")
else()
list(APPEND REQUIRED_LIBS "-l${lib}")
endif()
endforeach()
list(APPEND REQUIRED_FLAGS "-include starpu_simgrid_wrap.h")
endif()
# BLAS
if (BLAS_FOUND AND STARPU_LOOK_FOR_BLAS)
if (BLAS_INCLUDE_DIRS)
......@@ -770,6 +826,8 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT STARPU_FOUND)
list(APPEND REQUIRED_LIBS "${FORTRAN_ifcore_LIBRARY}")
endif()
endif()
# EXTRA LIBS such that pthread, m, rt
list(APPEND REQUIRED_LIBS ${STARPU_EXTRA_LIBRARIES})
# set required libraries for link
set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}")
......@@ -808,7 +866,7 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT STARPU_FOUND)
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
message(STATUS "Maybe STARPU is linked with specific libraries. "
"Have you tried with COMPONENTS (HWLOC, CUDA, MPI, BLAS, MAGMA, FXT)? "
"Have you tried with COMPONENTS (HWLOC, CUDA, MPI, BLAS, MAGMA, FXT, SIMGRID)? "
"See the explanation in FindSTARPU.cmake.")
endif()
endif()
......@@ -843,7 +901,7 @@ endif()
include(FindPackageHandleStandardArgs)
if(NOT STARPU_FIND_QUIETLY)
if(STARPU_SHM_FOUND)
message(STATUS "StarPU has been found.")
message(STATUS "StarPU library has been found.")
if(STARPU_MPI_LIBRARIES)
message(STATUS "The mpi version of StarPU has been found so that we manage"
"two lists of libs, one sequential and one parallel (see"
......@@ -852,7 +910,7 @@ if(NOT STARPU_FIND_QUIETLY)
message(STATUS "StarPU shared memory libraries stored in STARPU_SHM_LIBRARIES")
endif()
endif()
if (PKG_CONFIG_EXECUTABLE AND STARPU_SHM_FOUND)
if (PKG_CONFIG_EXECUTABLE AND STARPU_SHM_FOUND AND NOT STARPU_GIVEN_BY_USER)
find_package_handle_standard_args(STARPU DEFAULT_MSG
STARPU_SHM_LIBRARIES)
else()
......@@ -864,7 +922,7 @@ if(STARPU_LOOK_FOR_MPI)
if(STARPU_MPI_LIBRARIES AND NOT STARPU_FIND_QUIETLY)
message(STATUS "StarPU mpi libraries stored in STARPU_MPI_LIBRARIES")
endif()
if (PKG_CONFIG_EXECUTABLE AND STARPU_MPI_FOUND)
if (PKG_CONFIG_EXECUTABLE AND STARPU_MPI_FOUND AND NOT STARPU_GIVEN_BY_USER)
find_package_handle_standard_args(STARPU DEFAULT_MSG
STARPU_MPI_LIBRARIES)
else()
......
......@@ -158,19 +158,19 @@ if (LAPACK_FOUND)
if(TMG_LIBDIR)
set(TMG_tmg_LIBRARY "TMG_tmg_LIBRARY-NOTFOUND")
find_library(TMG_tmg_LIBRARY
NAMES tmglib
NAMES tmglib tmg
HINTS ${TMG_LIBDIR} )
else()
if(TMG_DIR)
set(TMG_tmg_LIBRARY "TMG_tmg_LIBRARY-NOTFOUND")
find_library(TMG_tmg_LIBRARY
NAMES tmglib
NAMES tmglib tmg
HINTS ${TMG_DIR}
PATH_SUFFIXES lib lib32 lib64 )
else()
set(TMG_tmg_LIBRARY "TMG_tmg_LIBRARY-NOTFOUND")
find_library(TMG_tmg_LIBRARY
NAMES tmglib
NAMES tmglib tmg
HINTS ${_lib_env} )
endif()
endif()
......
......@@ -11,35 +11,40 @@ macro(jdf_rules jdf_rules_OUTPUTLIST jdf_rules_SOURCES)
foreach(jdf_rules_SOURCE ${jdf_rules_SOURCES})
# Remove .jdf if present
string(REGEX REPLACE ".jdf" "" jdf_rules_SRC ${jdf_rules_SOURCE})
string(REGEX REPLACE ".jdf" "" jdf_rules_SRC ${jdf_rules_SOURCE})
string(REGEX REPLACE "^(.*/)*(.+)\\.*.*" "\\2" jdf_rules_BSRC ${jdf_rules_SRC})
set(jdf_rules_OSRC "${jdf_rules_BSRC}")
GET_PROPERTY(ADDITIONAL_DAGUEPP_CFLAGS SOURCE ${jdf_rules_SOURCE} PROPERTY ADDITIONAL_DAGUEPP_CFLAGS)
get_source_file_property(jdf_rules_IsInBinaryDir ${jdf_rules_SOURCE} IS_IN_BINARY_DIR )
# If the file is generated in a different binary dir,
# If the file is generated in a different binary dir,
# we force the dependency on the generated file
# otherwise we let cmake choose the correct file, it is so good for that.
if( jdf_rules_IsInBinaryDir )
add_custom_command(
OUTPUT ${jdf_rules_OSRC}.h ${jdf_rules_OSRC}.c
COMMAND ${daguepp_EXE} ${DAGUEPP_CFLAGS} ${ADDITIONAL_DAGUEPP_CFLAGS} -i ${jdf_rules_SRC}.jdf -o ${jdf_rules_OSRC} -f ${jdf_rules_BSRC}
COMMAND ${PARSEC_DAGUEPP} ${DAGUEPP_CFLAGS} ${ADDITIONAL_DAGUEPP_CFLAGS} -E -i ${jdf_rules_SRC}.jdf -o ${jdf_rules_OSRC} -f ${jdf_rules_BSRC}
MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/${jdf_rules_SRC}.jdf
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${jdf_rules_SRC}.jdf ${daguepp_EXE})
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${jdf_rules_SRC}.jdf ${PARSEC_DAGUEPP})
else( jdf_rules_IsInBinaryDir )
add_custom_command(
OUTPUT ${jdf_rules_OSRC}.h ${jdf_rules_OSRC}.c
COMMAND ${daguepp_EXE} ${DAGUEPP_CFLAGS} ${ADDITIONAL_DAGUEPP_CFLAGS} -i ${jdf_rules_SRC}.jdf -o ${jdf_rules_OSRC} -f ${jdf_rules_BSRC}
COMMAND ${PARSEC_DAGUEPP} ${DAGUEPP_CFLAGS} ${ADDITIONAL_DAGUEPP_CFLAGS} -E -i ${jdf_rules_SRC}.jdf -o ${jdf_rules_OSRC} -f ${jdf_rules_BSRC}
MAIN_DEPENDENCY ${jdf_rules_SRC}.jdf
DEPENDS ${jdf_rules_SRC}.jdf ${daguepp_EXE})
DEPENDS ${jdf_rules_SRC}.jdf ${PARSEC_DAGUEPP})
endif( jdf_rules_IsInBinaryDir )
set_source_files_properties(${jdf_rules_OSRC}.c PROPERTIES COMPILE_FLAGS "-I${PARSEC_DIR_FOUND}/include/daguepp")
list(APPEND ${jdf_rules_OUTPUTLIST} "${CMAKE_CURRENT_BINARY_DIR}/${jdf_rules_OSRC}.h;${CMAKE_CURRENT_BINARY_DIR}/${jdf_rules_OSRC}.c")
get_source_file_property(jdf_rules_CompileFlags ${jdf_rules_SOURCE} COMPILE_FLAGS )
if( jdf_rules_CompileFlags )
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${jdf_rules_OSRC}.c PROPERTIES COMPILE_FLAGS ${jdf_rules_CompileFlags} )
endif()
endforeach()
#
......@@ -47,4 +52,3 @@ macro(jdf_rules jdf_rules_OUTPUTLIST jdf_rules_SOURCES)
#
set_source_files_properties(${jdf_rules_OUTPUTLIST} PROPERTIES GENERATED 1)
endmacro(jdf_rules)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment