Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

...
 
Commits (28)
......@@ -11,5 +11,5 @@ Find:
- cd modules/find/tests
- mkdir -p build
- cd build
- cmake .. -DENABLE_CTEST=ON -DLAPACKE_COMPONENTS="TMG" -DQUARK_COMPONENTS="HWLOC" -DPASTIX_COMPONENTS="PARSEC;STARPU"
- cmake .. -DENABLE_CTEST=ON -DLAPACKE_COMPONENTS="TMG" -DQUARK_COMPONENTS="HWLOC" -DCHAMELEON_COMPONENTS="MPI;FXT;STARPU"
- ctest -V
......@@ -23,18 +23,19 @@ See the file [morse_cmakefind_doc.org](modules/find/morse_cmakefind_doc.org).
Installation
---------------------
We recommend to use this project as a `git submodule` of your project.
# Example if morse_cmake is defined as a git submodule in ./cmake_modules/
git submodule add https://gitlab.inria.fr/solverstack/morse_cmake.git cmake_modules/morse_cmake
To use MORSE modules you have to add the path to the modules in your
CMake project and include the MorseInit module:
# Define where are located module files on your system
set(MORSE_CMAKE_MODULE_PATH "/where/is/morse_cmake" CACHE PATH "Path to morse_cmake sources")
# Append this directory to the list of directories containing CMake modules
list(APPEND CMAKE_MODULE_PATH "${MORSE_CMAKE_MODULE_PATH}/modules/" )
# Example if Morse CMake modules are located in ./cmake_modules/morse_cmake/modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/morse_cmake/modules" )
# Include the init module
include(MorseInit)
We recommend to use this project as a `git submodule` of your project.
Testing
---------------------
......
###
#
# @copyright (c) 2018 Inria. All rights reserved.
#
###
#
# @file FindPkgconfigLibrariesAbsolutePath.cmake
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 1.0.0
# @author Florent Pruvost
# @date 06-04-2018
#
###
# Transform relative path into absolute path for libraries found with the
# pkg_search_module cmake macro
# _prefix: the name of the CMake variable used when pkg_search_module was called
# e.g. for pkg_search_module(BLAS blas) _prefix would be BLAS
macro(FIND_PKGCONFIG_LIBRARIES_ABSOLUTE_PATH _prefix)
if(WIN32)
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
elseif(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}")
# non static case
set(${_prefix}_LIBRARIES_COPY "${${_prefix}_LIBRARIES}")
set(${_prefix}_LIBRARIES "")
foreach(_library ${${_prefix}_LIBRARIES_COPY})
if(EXISTS "${_library}")
list(APPEND ${_prefix}_LIBRARIES ${_library})
else()
get_filename_component(_ext "${_library}" EXT)
set(_lib_extensions ".so" ".a" ".dyld" ".dll")
list(FIND _lib_extensions "${_ext}" _index)
if (${_index} GREATER -1)
get_filename_component(_library "${_library}" NAME_WE)
endif()
find_library(_library_path NAMES ${_library}
HINTS ${${_prefix}_LIBDIR} ${${_prefix}_LIBRARY_DIRS} ${_lib_env})
if (_library_path)
list(APPEND ${_prefix}_LIBRARIES ${_library_path})
else()
message(FATAL_ERROR "Dependency of ${_prefix} '${_library}' NOT FOUND")
endif()
unset(_library_path CACHE)
endif()
endforeach()
set (${_prefix}_LIBRARIES "${${_prefix}_LIBRARIES}" CACHE INTERNAL "" FORCE)
# static case
set(${_prefix}_STATIC_LIBRARIES_COPY "${${_prefix}_STATIC_LIBRARIES}")
set(${_prefix}_STATIC_LIBRARIES "")
foreach(_library ${${_prefix}_STATIC_LIBRARIES_COPY})
if(EXISTS "${_library}")
list(APPEND ${_prefix}_STATIC_LIBRARIES ${_library})
else()
get_filename_component(_ext "${_library}" EXT)
set(_lib_extensions ".so" ".a" ".dyld" ".dll")
list(FIND _lib_extensions "${_ext}" _index)
if (${_index} GREATER -1)
get_filename_component(_library "${_library}" NAME_WE)
endif()
# try static first
set (default_find_library_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
set (CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
find_library(_library_path NAMES ${_library}
HINTS ${${_prefix}_STATIC_LIBDIR} ${${_prefix}_STATIC_LIBRARY_DIRS} ${_lib_env})
set (CMAKE_FIND_LIBRARY_SUFFIXES ${default_find_library_suffixes})
# if not found try dynamic
if (NOT _library_path)
find_library(_library_path NAMES ${_library}
HINTS ${${_prefix}_STATIC_LIBDIR} ${${_prefix}_STATIC_LIBRARY_DIRS} ${_lib_env})
endif()
if (_library_path)
list(APPEND ${_prefix}_STATIC_LIBRARIES ${_library_path})
else()
message(FATAL_ERROR "Dependency of ${_prefix} '${_library}' NOT FOUND")
endif()
unset(_library_path CACHE)
endif()
endforeach()
set (${_prefix}_STATIC_LIBRARIES "${${_prefix}_STATIC_LIBRARIES}" CACHE INTERNAL "" FORCE)
endmacro()
##
## @end file FindPkgconfigLibrariesAbsolutePath.cmake
##
###
#
# @copyright (c) 2018 Inria. All rights reserved.
#
###
#
# @file LibrariesAbsolutePath.cmake
#
# @project MORSE
# MORSE is a software package provided by:
# Inria Bordeaux - Sud-Ouest,
# Univ. of Tennessee,
# King Abdullah Univesity of Science and Technology
# Univ. of California Berkeley,
# Univ. of Colorado Denver.
#
# @version 1.0.0
# @author Florent Pruvost
# @date 13-04-2018
#
###
# Transform relative path into absolute path for libraries
# lib_list (input/output): the name of the CMake variable containing libraries, e.g. BLAS_LIBRARIES
# hints_paths (input): additional paths to add when looking for libraries
macro(LIBRARIES_ABSOLUTE_PATH lib_list hints_paths)
# collect environment paths to dig
if(WIN32)
string(REPLACE ":" ";" _lib_env "$ENV{LIB}")
elseif(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}")
# copy the lib list
set (${lib_list}_COPY "${${lib_list}}")
# reset the lib list to populate
set(${lib_list} "")
foreach(_library ${${lib_list}_COPY})
if(EXISTS "${_library}")
# if already an absolute path, nothing special to do
list(APPEND ${lib_list} ${_library})
else()
# replace pattern -lfoo -> foo
string(REGEX REPLACE "^-l" "" _library "${_library}")
# remove extensions if exist
get_filename_component(_ext "${_library}" EXT)
set(_lib_extensions ".so" ".a" ".dyld" ".dll")
list(FIND _lib_extensions "${_ext}" _index)
if (${_index} GREATER -1)
get_filename_component(_library "${_library}" NAME_WE)
endif()
# try to find the lib
find_library(_library_path NAMES ${_library} HINTS ${hints_paths} ${_lib_env})
if (_library_path)
list(APPEND ${lib_list} ${_library_path})
else()
message(FATAL_ERROR "Dependency of ${lib_list} '${_library}' NOT FOUND")
endif()
unset(_library_path CACHE)
endif()
endforeach()
endmacro()
##
## @end file LibrariesAbsolutePath.cmake
##
......@@ -50,6 +50,12 @@ endif()
# To find headers and libs
include(FindHeadersAndLibs)
# To transform relative path from pkg-config into absolute
include(FindPkgconfigLibrariesAbsolutePath)
# To transform relative path into absolute for a list of libraries
include(LibrariesAbsolutePath)
# Some macros to print status when search for headers and libs
# PrintFindStatus.cmake is in cmake_modules/morse/find directory
include(PrintFindStatus)
......
......@@ -233,16 +233,21 @@ MACRO(precisions_rules_py)
# We generate a dependency only if a file will be generated
if( got_file )
set( _compile_flags "-DPRECISION_${_dependency_PREC}" )
set( _listtmp ${PREC_RULE_PRECISIONS})
list(REMOVE_ITEM _listtmp ${_dependency_PREC})
foreach( _prec ${_listtmp})
set( _compile_flags "${_compile_flags} -UPRECISION_${_prec}" )
endforeach()
if( generate_out )
# the custom command is executed in CMAKE_CURRENT_BINARY_DIR
ADD_CUSTOM_COMMAND(
OUTPUT ${_dependency_OUTPUT}
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 ${_compile_flags} 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 ${_compile_flags} GENERATED 0 )
endif( generate_out )
list(APPEND ${OUTPUTLIST} ${_dependency_OUTPUT})
......
This diff is collapsed.
......@@ -18,20 +18,18 @@
#
# 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_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
# 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_CFLAGS_OTHER - compiler flags without headers paths
# BLAS_SEQ_LDFLAGS_OTHER - linker flags without libraries
# BLAS_PAR_LIBRARIES - BLAS component libraries to be linked (multithreaded)
# BLAS_PAR_CFLAGS_OTHER - compiler flags without headers paths
# BLAS_PAR_LDFLAGS_OTHER - linker flags without libraries
# 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
......@@ -90,11 +88,9 @@ if(NOT BLASEXT_FIND_QUIETLY)
"\n ACML, ACML_MP, ACML_GPU, Apple, NAS, Generic")
endif()
if (NOT BLAS_FOUND)
# First blas detection in order to decide if we should look for a
# multitheaded version
find_package_blas(0)
endif ()
# First blas detection in order to decide if we should look for a
# multitheaded version
find_package_blas(0)
# detect the cases where SEQ and PAR libs are handled
if(BLA_VENDOR STREQUAL "All" AND
......@@ -206,11 +202,11 @@ if(BLA_VENDOR MATCHES "Intel*")
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}")
if (BLAS_CFLAGS_OTHER)
set (BLAS_SEQ_CFLAGS_OTHER "${BLAS_CFLAGS_OTHER}")
endif()
if (BLAS_LINKER_FLAGS)
set (BLAS_SEQ_LINKER_FLAGS "${BLAS_LINKER_FLAGS}")
if (BLAS_LDFLAGS_OTHER)
set (BLAS_SEQ_LDFLAGS_OTHER "${BLAS_LDFLAGS_OTHER}")
endif()
else()
set(BLAS_SEQ_LIBRARIES "${BLAS_SEQ_LIBRARIES-NOTFOUND}")
......@@ -224,11 +220,11 @@ if(BLA_VENDOR MATCHES "Intel*")
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}")
if (BLAS_CFLAGS_OTHER)
set (BLAS_PAR_CFLAGS_OTHER "${BLAS_CFLAGS_OTHER}")
endif()
if (BLAS_LINKER_FLAGS)
set (BLAS_PAR_LINKER_FLAGS "${BLAS_LINKER_FLAGS}")
if (BLAS_LDFLAGS_OTHER)
set (BLAS_PAR_LDFLAGS_OTHER "${BLAS_LDFLAGS_OTHER}")
endif()
else()
set(BLAS_PAR_LIBRARIES "${BLAS_PAR_LIBRARIES-NOTFOUND}")
......@@ -301,33 +297,34 @@ 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}")
set(BLAS_CFLAGS_OTHER "${BLAS_SEQ_CFLAGS_OTHER}")
set(BLAS_LDFLAGS_OTHER "${BLAS_SEQ_LDFLAGS_OTHER}")
endif()
# extract libs paths
# remark: because it is not given by find_package(BLAS)
set(BLAS_LIBRARY_DIRS "")
string(REPLACE " " ";" BLAS_LIBRARIES "${BLAS_LIBRARIES}")
foreach(blas_lib ${BLAS_LIBRARIES})
if (EXISTS "${blas_lib}")
get_filename_component(a_blas_lib_dir "${blas_lib}" PATH)
list(APPEND BLAS_LIBRARY_DIRS "${a_blas_lib_dir}" )
else()
string(REPLACE "-L" "" blas_lib "${blas_lib}")
# extract libs paths if not given by find_package(BLAS)
if (NOT BLAS_LIBRARY_DIRS)
set(BLAS_LIBRARY_DIRS "")
string(REPLACE " " ";" BLAS_LIBRARIES "${BLAS_LIBRARIES}")
foreach(blas_lib ${BLAS_LIBRARIES})
if (EXISTS "${blas_lib}")
list(APPEND BLAS_LIBRARY_DIRS "${blas_lib}" )
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}" )
else()
string(REPLACE "-L" "" blas_lib "${blas_lib}")
if (EXISTS "${blas_lib}")
list(APPEND BLAS_LIBRARY_DIRS "${blas_lib}" )
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}" )
endif()
endif()
endif()
endif()
endforeach()
if (BLAS_LIBRARY_DIRS)
list(REMOVE_DUPLICATES BLAS_LIBRARY_DIRS)
endif ()
endforeach()
if (BLAS_LIBRARY_DIRS)
list(REMOVE_DUPLICATES BLAS_LIBRARY_DIRS)
endif ()
endif(NOT BLAS_LIBRARY_DIRS)
# check that BLASEXT has been found
# ---------------------------------
......
This diff is collapsed.
This diff is collapsed.
......@@ -20,11 +20,23 @@
# 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
# if found with pkg-config the following variables are set
# <PREFIX> = EZTRACE
# <XPREFIX> = <PREFIX> for common case
# <XPREFIX> = <PREFIX>_STATIC for static linking
# <XPREFIX>_FOUND ... set to 1 if module(s) exist
# <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
# <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
# <XPREFIX>_LDFLAGS ... all required linker flags
# <XPREFIX>_LDFLAGS_OTHER ... all other linker flags
# <XPREFIX>_INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I')
# <XPREFIX>_CFLAGS ... all required cflags
# <XPREFIX>_CFLAGS_OTHER ... the other compiler flags
#
# 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):
......@@ -73,14 +85,10 @@ find_package(PkgConfig QUIET)
if( PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_GIVEN_BY_USER )
pkg_search_module(EZTRACE eztrace)
if (NOT EZTRACE_FIND_QUIETLY)
if (EZTRACE_FOUND AND EZTRACE_LIBRARIES)
message(STATUS "Looking for EZTRACE - found using PkgConfig")
#if(NOT EZTRACE_INCLUDE_DIRS)
# message("${Magenta}EZTRACE_INCLUDE_DIRS is empty using PkgConfig."
# "Perhaps the path to eztrace headers is already present in your"
# "C(PLUS)_INCLUDE_PATH environment variable.${ColourReset}")
#endif()
else()
message(STATUS "${Magenta}Looking for EZTRACE - not found using PkgConfig."
"\n Perhaps you should add the directory containing eztrace.pc to"
......@@ -88,13 +96,12 @@ if( PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_GIVEN_BY_USER )
endif()
if (EZTRACE_FOUND AND EZTRACE_LIBRARIES)
set(EZTRACE_FOUND_WITH_PKGCONFIG "TRUE")
find_pkgconfig_libraries_absolute_path(EZTRACE)
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 )
if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND) OR (EZTRACE_GIVEN_BY_USER) )
......@@ -288,51 +295,70 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND)
list(REMOVE_DUPLICATES EZTRACE_LIBRARY_DIRS)
endif ()
# check a function to validate the find
if(EZTRACE_LIBRARIES)
endif( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND) OR (EZTRACE_GIVEN_BY_USER) )
set(REQUIRED_INCDIRS)
set(REQUIRED_LIBDIRS)
set(REQUIRED_LIBS)
# check a function to validate the find
if(EZTRACE_LIBRARIES)
# EZTRACE
if (EZTRACE_INCLUDE_DIRS)
set(REQUIRED_INCDIRS "${EZTRACE_INCLUDE_DIRS}")
endif()
if (EZTRACE_LIBRARY_DIRS)
set(REQUIRED_LIBDIRS "${EZTRACE_LIBRARY_DIRS}")
endif()
set(REQUIRED_LIBS "${EZTRACE_LIBRARIES}")
set(REQUIRED_INCDIRS)
set(REQUIRED_LIBDIRS)
set(REQUIRED_LIBS)
# 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(EZTRACE_WORKS CACHE)
include(CheckFunctionExists)
check_function_exists(eztrace_start EZTRACE_WORKS)
mark_as_advanced(EZTRACE_WORKS)
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")
# EZTRACE
if (EZTRACE_INCLUDE_DIRS)
set(REQUIRED_INCDIRS "${EZTRACE_INCLUDE_DIRS}")
endif()
if (EZTRACE_CFLAGS_OTHER)
set(REQUIRED_FLAGS "${EZTRACE_CFLAGS_OTHER}")
endif()
if (EZTRACE_LDFLAGS_OTHER)
set(REQUIRED_LDFLAGS "${EZTRACE_LDFLAGS_OTHER}")
endif()
if (EZTRACE_LIBRARY_DIRS)
set(REQUIRED_LIBDIRS "${EZTRACE_LIBRARY_DIRS}")
endif()
set(REQUIRED_LIBS "${EZTRACE_LIBRARIES}")
# set required libraries for link
set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}")
if (REQUIRED_FLAGS)
set(REQUIRED_FLAGS_COPY "${REQUIRED_FLAGS}")
set(REQUIRED_FLAGS)
set(REQUIRED_DEFINITIONS)
foreach(_flag ${REQUIRED_FLAGS_COPY})
if (_flag MATCHES "^-D")
list(APPEND REQUIRED_DEFINITIONS "${_flag}")
endif()
string(REGEX REPLACE "^-D.*" "" _flag "${_flag}")
list(APPEND REQUIRED_FLAGS "${_flag}")
endforeach()
endif()
set(CMAKE_REQUIRED_DEFINITIONS "${REQUIRED_DEFINITIONS}")
set(CMAKE_REQUIRED_FLAGS "${REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_LIBRARIES)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LDFLAGS}")
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LIBS}")
string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
# test link
unset(EZTRACE_WORKS CACHE)
include(CheckFunctionExists)
check_function_exists(eztrace_start EZTRACE_WORKS)
mark_as_advanced(EZTRACE_WORKS)
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 "CMAKE_REQUIRED_FLAGS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_LIBRARIES)
endif(EZTRACE_LIBRARIES)
endif( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT EZTRACE_FOUND) OR (EZTRACE_GIVEN_BY_USER) )
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_LIBRARIES)
endif(EZTRACE_LIBRARIES)
if (EZTRACE_LIBRARIES)
if (EZTRACE_LIBRARY_DIRS)
......@@ -355,11 +381,6 @@ mark_as_advanced(EZTRACE_DIR_FOUND)
# check that EZTRACE has been found
# -------------------------------
include(FindPackageHandleStandardArgs)
if (PKG_CONFIG_EXECUTABLE AND EZTRACE_FOUND)
find_package_handle_standard_args(EZTRACE DEFAULT_MSG
EZTRACE_LIBRARIES)
else()
find_package_handle_standard_args(EZTRACE DEFAULT_MSG
EZTRACE_LIBRARIES
EZTRACE_WORKS)
endif()
find_package_handle_standard_args(EZTRACE DEFAULT_MSG
EZTRACE_LIBRARIES
EZTRACE_WORKS)
This diff is collapsed.
......@@ -28,15 +28,30 @@
# This module finds headers and fftw library.
# Results are reported in variables:
# FFTW_FOUND - True if headers and requested libraries were found
# FFTW_C_FLAGS - list of required compilation flags (excluding -I)
# FFTW_LINKER_FLAGS - list of required linker flags (excluding -l and -L)
# FFTW_INCLUDE_DIRS - fftw include directories
# FFTW_LIBRARY_DIRS - Link directories for fftw libraries
# FFTW_LIBRARIES - fftw component libraries to be linked
# FFTW_INCLUDE_DIRS_DEP - fftw + dependencies include directories
# FFTW_LIBRARY_DIRS_DEP - fftw + dependencies link directories
# FFTW_LIBRARIES_DEP - fftw libraries + dependencies
# FFTW_CFLAGS_OTHER - fftw compiler flags without headers paths
# FFTW_LDFLAGS_OTHER - fftw linker flags without libraries
# FFTW_INCLUDE_DIRS - fftw include directories
# FFTW_LIBRARY_DIRS - fftw link directories
# FFTW_LIBRARIES - fftw libraries to be linked (absolute path)
# FFTW_CFLAGS_OTHER_DEP - fftw + dependencies compiler flags without headers paths
# FFTW_LDFLAGS_OTHER_DEP - fftw + dependencies linker flags without libraries
# FFTW_INCLUDE_DIRS_DEP - fftw + dependencies include directories
# FFTW_LIBRARY_DIRS_DEP - fftw + dependencies link directories
# FFTW_LIBRARIES_DEP - fftw + dependencies libraries
#
# FFTW_FOUND_WITH_PKGCONFIG - True if found with pkg-config
# if found with pkg-config the following variables are set
# <PREFIX> = FFTW3F or FFTW3 or FFTW3L or FFTW3Q
# <XPREFIX> = <PREFIX> for common case
# <XPREFIX> = <PREFIX>_STATIC for static linking
# <XPREFIX>_FOUND ... set to 1 if module(s) exist
# <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
# <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
# <XPREFIX>_LDFLAGS ... all required linker flags
# <XPREFIX>_LDFLAGS_OTHER ... all other linker flags
# <XPREFIX>_INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I')
# <XPREFIX>_CFLAGS ... all required cflags
# <XPREFIX>_CFLAGS_OTHER ... the other compiler flags
#
# 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):
......@@ -184,10 +199,10 @@ if (FFTW_LOOK_FOR_MKL)
endif()
if (FFTW_FIND_REQUIRED AND FFTW_FIND_REQUIRED_MKL)
find_package(Threads REQUIRED)
find_package(BLASEXT REQUIRED)
find_package(BLAS REQUIRED)
else()
find_package(Threads)
find_package(BLASEXT)
find_package(BLAS)
endif()
endif()
......@@ -201,12 +216,17 @@ if (FFTW_LOOK_FOR_ESSL)
set(BLA_VENDOR "IBMESSL")
endif()
if (FFTW_FIND_REQUIRED AND FFTW_FIND_REQUIRED_ESSL)
find_package(BLASEXT REQUIRED)
find_package(BLAS REQUIRED)
else()
find_package(BLASEXT)
find_package(BLAS)
endif()
endif()
if( THREADS_FOUND )
libraries_absolute_path(CMAKE_THREAD_LIBS_INIT "")
endif ()
set(ENV_FFTW_DIR "$ENV{FFTW_DIR}")
set(ENV_FFTW_INCDIR "$ENV{FFTW_INCDIR}")
set(ENV_FFTW_LIBDIR "$ENV{FFTW_LIBDIR}")
......@@ -231,11 +251,11 @@ 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()
if (FFTW3F_LIBRARIES)
find_pkgconfig_libraries_absolute_path(FFTW3F)
list(APPEND FFTW_LIBRARIES "${FFTW3F_LIBRARIES}")
endif()
if(FFTW3F_INCLUDE_DIRS)
......@@ -261,11 +281,11 @@ 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()
if (FFTW3L_LIBRARIES)
find_pkgconfig_libraries_absolute_path(FFTW3L)
list(APPEND FFTW_LIBRARIES "${FFTW3L_LIBRARIES}")
endif()
if(FFTW3L_INCLUDE_DIRS)
......@@ -291,11 +311,11 @@ 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()
if (FFTW3Q_LIBRARIES)
find_pkgconfig_libraries_absolute_path(FFTW3Q)
list(APPEND FFTW_LIBRARIES "${FFTW3Q_LIBRARIES}")
endif()
if(FFTW3Q_INCLUDE_DIRS)
......@@ -319,13 +339,16 @@ if (NOT FFTW_LOOK_FOR_MKL AND NOT FFTW_LOOK_FOR_ESSL)
endif(FFTW3Q_FOUND)
else()
pkg_search_module(FFTW3 fftw3)
if (FFTW3_FOUND AND FFTW3_LIBRARIES)
find_pkgconfig_libraries_absolute_path(FFTW3)
endif()
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()
if (FFTW3_LIBRARIES)
find_pkgconfig_libraries_absolute_path(FFTW3)
list(APPEND FFTW_LIBRARIES "${FFTW3_LIBRARIES}")
endif()
if(FFTW3_INCLUDE_DIRS)
......@@ -348,14 +371,6 @@ if (NOT FFTW_LOOK_FOR_MKL AND NOT FFTW_LOOK_FOR_ESSL)
endif()
endif(FFTW3_FOUND)
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()
......@@ -688,98 +703,6 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR
endif()
endforeach()
# check a function to validate the find
if(FFTW_LIBRARIES)
set(REQUIRED_FLAGS)
set(REQUIRED_LDFLAGS)
set(REQUIRED_INCDIRS)
set(REQUIRED_LIBDIRS)
set(REQUIRED_LIBS)
# FFTW
if (FFTW_INCLUDE_DIRS)
set(REQUIRED_INCDIRS "${FFTW_INCLUDE_DIRS}")
endif()
if (FFTW_LIBRARY_DIRS)
set(REQUIRED_LIBDIRS "${FFTW_LIBRARY_DIRS}")
endif()
set(REQUIRED_LIBS "${FFTW_LIBRARIES}")
# THREADS
if (FFTW_LOOK_FOR_THREADS)
list(APPEND REQUIRED_LIBS "${CMAKE_THREAD_LIBS_INIT}")
endif()
# OMP
if(FFTW_LOOK_FOR_OMP)
list(APPEND REQUIRED_FLAGS "${OPENMP_C_FLAGS}")
#if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
# # either gomp ...
# list(APPEND REQUIRED_LIBS "-lgomp")
# # or iomp5
# list(APPEND REQUIRED_LIBS "-liomp5")
#elseif (CMAKE_C_COMPILER_ID STREQUAL "Intel")
# list(APPEND REQUIRED_LIBS "-liomp5")
#endif()
endif()
# MKL
if(FFTW_LOOK_FOR_MKL)
list(APPEND REQUIRED_LIBS "${CMAKE_THREAD_LIBS_INIT}")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND REQUIRED_LDFLAGS "-Wl,--no-as-needed")
endif()
endif()
# m
find_library(M_LIBRARY NAMES m)
mark_as_advanced(M_LIBRARY)
if(M_LIBRARY)
list(APPEND REQUIRED_LIBS "-lm")
endif()
# set required libraries for link
set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}")
set(CMAKE_REQUIRED_LIBRARIES)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LDFLAGS}")
foreach(lib_dir ${REQUIRED_LIBDIRS})
list(APPEND CMAKE_REQUIRED_LIBRARIES "-L${lib_dir}")
endforeach()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LIBS}")
list(APPEND CMAKE_REQUIRED_FLAGS "${REQUIRED_FLAGS}")
string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
# test link
unset(FFTW_WORKS CACHE)
include(CheckFunctionExists)
if (FFTW_LOOK_FOR_ESSL)
check_function_exists(${FFTW_PREC_TESTFUNC}fftw_execute FFTW_WORKS)
else()
check_function_exists(${FFTW_PREC_TESTFUNC}fftw_execute_ FFTW_WORKS)
endif()
mark_as_advanced(FFTW_WORKS)
if(FFTW_WORKS)
# save link with dependencies
set(FFTW_LIBRARIES_DEP "${REQUIRED_LIBS}")
set(FFTW_LIBRARY_DIRS_DEP "${REQUIRED_LIBDIRS}")
set(FFTW_INCLUDE_DIRS_DEP "${REQUIRED_INCDIRS}")
set(FFTW_C_FLAGS "${REQUIRED_FLAGS}")
set(FFTW_LINKER_FLAGS "${REQUIRED_LDFLAGS}")
list(REMOVE_DUPLICATES FFTW_LIBRARY_DIRS_DEP)
list(REMOVE_DUPLICATES FFTW_INCLUDE_DIRS_DEP)
list(REMOVE_DUPLICATES FFTW_LINKER_FLAGS)
else()
if(NOT FFTW_FIND_QUIETLY)
message(STATUS "Looking for FFTW : test of ${FFTW_PREC_TESTFUNC}fftw_execute_ with fftw library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "CMAKE_REQUIRED_FLAGS: ${CMAKE_REQUIRED_FLAGS}")
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(FFTW_LIBRARIES)
endif( (NOT PKG_CONFIG_EXECUTABLE) OR
(PKG_CONFIG_EXECUTABLE AND NOT FFTW_FOUND) OR
FFTW_GIVEN_BY_USER OR
......@@ -787,6 +710,107 @@ endif( (NOT PKG_CONFIG_EXECUTABLE) OR
FFTW_LOOK_FOR_ESSL
)
# check a function to validate the find
if(FFTW_LIBRARIES)
set(REQUIRED_FLAGS)
set(REQUIRED_LDFLAGS)
set(REQUIRED_INCDIRS)
set(REQUIRED_LIBDIRS)
set(REQUIRED_LIBS)
# FFTW
if (FFTW_INCLUDE_DIRS)
set(REQUIRED_INCDIRS "${FFTW_INCLUDE_DIRS}")
endif()
if (FFTW_CFLAGS_OTHER)
set(REQUIRED_FLAGS "${FFTW_CFLAGS_OTHER}")
endif()
if (FFTW_LDFLAGS_OTHER)
set(REQUIRED_LDFLAGS "${FFTW_LDFLAGS_OTHER}")
endif()
if (FFTW_LIBRARY_DIRS)
set(REQUIRED_LIBDIRS "${FFTW_LIBRARY_DIRS}")
endif()
set(REQUIRED_LIBS "${FFTW_LIBRARIES}")
# THREADS
if (FFTW_LOOK_FOR_THREADS)
list(APPEND REQUIRED_LIBS "${CMAKE_THREAD_LIBS_INIT}")
endif()
# OMP
if(FFTW_LOOK_FOR_OMP)
list(APPEND REQUIRED_FLAGS "${OPENMP_C_FLAGS}")
endif()
# MKL
if(FFTW_LOOK_FOR_MKL)
list(APPEND REQUIRED_LIBS "${CMAKE_THREAD_LIBS_INIT}")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND REQUIRED_LDFLAGS "-Wl,--no-as-needed")
endif()
endif()
# m
find_library(M_LIBRARY NAMES m)
mark_as_advanced(M_LIBRARY)
if(M_LIBRARY)
list(APPEND REQUIRED_LIBS "-lm")
endif()
# set required libraries for link
set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}")
if (REQUIRED_FLAGS)
set(REQUIRED_FLAGS_COPY "${REQUIRED_FLAGS}")
set(REQUIRED_FLAGS)
set(REQUIRED_DEFINITIONS)
foreach(_flag ${REQUIRED_FLAGS_COPY})
if (_flag MATCHES "^-D")
list(APPEND REQUIRED_DEFINITIONS "${_flag}")
endif()
string(REGEX REPLACE "^-D.*" "" _flag "${_flag}")
list(APPEND REQUIRED_FLAGS "${_flag}")
endforeach()
endif()
set(CMAKE_REQUIRED_DEFINITIONS "${REQUIRED_DEFINITIONS}")
set(CMAKE_REQUIRED_FLAGS "${REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_LIBRARIES)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LDFLAGS}")
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LIBS}")
list(APPEND CMAKE_REQUIRED_FLAGS "${REQUIRED_FLAGS}")
string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
# test link
unset(FFTW_WORKS CACHE)
include(CheckFunctionExists)
if (FFTW_LOOK_FOR_ESSL)
check_function_exists(${FFTW_PREC_TESTFUNC}fftw_execute FFTW_WORKS)
else()
check_function_exists(${FFTW_PREC_TESTFUNC}fftw_execute_ FFTW_WORKS)
endif()
mark_as_advanced(FFTW_WORKS)
if(FFTW_WORKS)
# save link with dependencies
set(FFTW_LIBRARIES_DEP "${REQUIRED_LIBS}")
set(FFTW_LIBRARY_DIRS_DEP "${REQUIRED_LIBDIRS}")
set(FFTW_INCLUDE_DIRS_DEP "${REQUIRED_INCDIRS}")
set(FFTW_CFLAGS_OTHER_DEP "${REQUIRED_FLAGS}")
set(FFTW_LDFLAGS_OTHER_DEP "${REQUIRED_LDFLAGS}")
list(REMOVE_DUPLICATES FFTW_LIBRARY_DIRS_DEP)
list(REMOVE_DUPLICATES FFTW_CFLAGS_OTHER_DEP)
list(REMOVE_DUPLICATES FFTW_LDFLAGS_OTHER_DEP)
else()
if(NOT FFTW_FIND_QUIETLY)
message(STATUS "Looking for FFTW : test of ${FFTW_PREC_TESTFUNC}fftw_execute_ with fftw library fails")
message(STATUS "CMAKE_REQUIRED_LIBRARIES: ${CMAKE_REQUIRED_LIBRARIES}")
message(STATUS "CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}")
message(STATUS "CMAKE_REQUIRED_FLAGS: ${CMAKE_REQUIRED_FLAGS}")
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(FFTW_LIBRARIES)
if (FFTW_LIBRARIES)
list(GET FFTW_LIBRARIES 0 first_lib)
get_filename_component(first_lib_path "${first_lib}" PATH)
......@@ -806,13 +830,6 @@ mark_as_advanced(FFTW_DIR_FOUND)
# check that FFTW has been found
# -------------------------------
include(FindPackageHandleStandardArgs)
if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FFTW_FOUND) OR (FFTW_GIVEN_BY_USER) )
find_package_handle_standard_args(FFTW DEFAULT_MSG
FFTW_LIBRARIES
FFTW_INCLUDE_DIRS
FFTW_WORKS)
else()
find_package_handle_standard_args(FFTW DEFAULT_MSG
FFTW_LIBRARIES
FFTW_WORKS)
endif()
find_package_handle_standard_args(FFTW DEFAULT_MSG
FFTW_LIBRARIES
FFTW_WORKS)
......@@ -16,11 +16,23 @@
# 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_LIBRARY_DIRS - fxt link directories
# FXT_LIBRARIES - fxt libraries to be linked (absolute path)
#
# FXT_FOUND_WITH_PKGCONFIG - True if found with pkg-config
# if found with pkg-config the following variables are set
# <PREFIX> = FXT
# <XPREFIX> = <PREFIX> for common case
# <XPREFIX> = <PREFIX>_STATIC for static linking
# <XPREFIX>_FOUND ... set to 1 if module(s) exist
# <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
# <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
# <XPREFIX>_LDFLAGS ... all required linker flags
# <XPREFIX>_LDFLAGS_OTHER ... all other linker flags
# <XPREFIX>_INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I')
# <XPREFIX>_CFLAGS ... all required cflags
# <XPREFIX>_CFLAGS_OTHER ... the other compiler flags
#
# 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):
......@@ -69,14 +81,10 @@ find_package(PkgConfig QUIET)
if(PKG_CONFIG_EXECUTABLE AND NOT FXT_GIVEN_BY_USER)
pkg_search_module(FXT fxt)
if (NOT FXT_FIND_QUIETLY)
if (FXT_FOUND AND FXT_LIBRARIES)
message(STATUS "Looking for FXT - found using PkgConfig")
#if(NOT FXT_INCLUDE_DIRS)
# message("${Magenta}FXT_INCLUDE_DIRS is empty using PkgConfig."
# "Perhaps the path to fxt headers is already present in your"
# "C(PLUS)_INCLUDE_PATH environment variable.${ColourReset}")
#endif()
else()
message(STATUS "${Magenta}Looking for FXT - not found using PkgConfig."
"\n Perhaps you should add the directory containing fxt.pc to the"
......@@ -84,10 +92,9 @@ 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")
find_pkgconfig_libraries_absolute_path(FXT)
else()
set(FXT_FOUND_WITH_PKGCONFIG "FALSE")
endif()
......@@ -244,51 +251,72 @@ if( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR
list(REMOVE_DUPLICATES FXT_LIBRARY_DIRS)
endif ()
# check a function to validate the find
if(FXT_LIBRARIES)
endif( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR (FXT_GIVEN_BY_USER) )
set(REQUIRED_INCDIRS)
set(REQUIRED_LIBDIRS)
set(REQUIRED_LIBS)
# check a function to validate the find
if(FXT_LIBRARIES)
# FXT
if (FXT_INCLUDE_DIRS)
set(REQUIRED_INCDIRS "${FXT_INCLUDE_DIRS}")
endif()
if (FXT_LIBRARY_DIRS)
set(REQUIRED_LIBDIRS "${FXT_LIBRARY_DIRS}")
endif()
set(REQUIRED_LIBS "${FXT_LIBRARIES}")
set(REQUIRED_INCDIRS)
set(REQUIRED_FLAGS)
set(REQUIRED_LDFLAGS)
set(REQUIRED_LIBDIRS)
set(REQUIRED_LIBS)
# 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}")
# FXT
if (FXT_INCLUDE_DIRS)
set(REQUIRED_INCDIRS "${FXT_INCLUDE_DIRS}")
endif()
if (FXT_CFLAGS_OTHER)
set(REQUIRED_FLAGS "${FXT_CFLAGS_OTHER}")
endif()
if (FXT_LDFLAGS_OTHER)
set(REQUIRED_LDFLAGS "${FXT_LDFLAGS_OTHER}")
endif()
if (FXT_LIBRARY_DIRS)
set(REQUIRED_LIBDIRS "${FXT_LIBRARY_DIRS}")
endif()
set(REQUIRED_LIBS "${FXT_LIBRARIES}")
# set required libraries for link
set(CMAKE_REQUIRED_INCLUDES "${REQUIRED_INCDIRS}")
if (REQUIRED_FLAGS)
set(REQUIRED_FLAGS_COPY "${REQUIRED_FLAGS}")
set(REQUIRED_FLAGS)
set(REQUIRED_DEFINITIONS)
foreach(_flag ${REQUIRED_FLAGS_COPY})
if (_flag MATCHES "^-D")
list(APPEND REQUIRED_DEFINITIONS "${_flag}")
endif()
string(REGEX REPLACE "^-D.*" "" _flag "${_flag}")
list(APPEND REQUIRED_FLAGS "${_flag}")
endforeach()
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LIBS}")
string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
endif()
set(CMAKE_REQUIRED_DEFINITIONS "${REQUIRED_DEFINITIONS}")
set(CMAKE_REQUIRED_FLAGS "${REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_LIBRARIES)
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LDFLAGS}")
list(APPEND CMAKE_REQUIRED_LIBRARIES "${REQUIRED_LIBS}")
string(REGEX REPLACE "^ -" "-" CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
# test link
unset(FXT_WORKS CACHE)
include(CheckFunctionExists)
check_function_exists(fut_keychange FXT_WORKS)
mark_as_advanced(FXT_WORKS)
# test link
unset(FXT_WORKS CACHE)
include(CheckFunctionExists)
check_function_exists(fut_keychange FXT_WORKS)
mark_as_advanced(FXT_WORKS)
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")
endif()
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 "CMAKE_REQUIRED_FLAGS: ${CMAKE_REQUIRED_FLAGS}")
message(STATUS "Check in CMakeFiles/CMakeError.log to figure out why it fails")
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_LIBRARIES)
endif(FXT_LIBRARIES)
endif( (NOT PKG_CONFIG_EXECUTABLE) OR (PKG_CONFIG_EXECUTABLE AND NOT FXT_FOUND) OR (FXT_GIVEN_BY_USER) )
endif()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_LIBRARIES)
endif(FXT_LIBRARIES)
if (FXT_LIBRARIES)
if (FXT_LIBRARY_DIRS)
......@@ -311,11 +339,6 @@ mark_as_advanced(FXT_DIR_FOUND)
# check that FXT has been found
# -------------------------------
include(FindPackageHandleStandardArgs)
if (PKG_CONFIG_EXECUTABLE AND FXT_FOUND)
find_package_handle_standard_args(FXT DEFAULT_MSG
FXT_LIBRARIES)
else()
find_package_handle_standard_args(FXT DEFAULT_MSG
FXT_LIBRARIES
FXT_WORKS)
endif()
find_package_handle_standard_args(FXT DEFAULT_MSG
FXT_LIBRARIES
FXT_WORKS)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -72,13 +72,14 @@ if(NOT MAGMA_FOUND)
endif(NOT MAGMA_FOUND)
# MAGMA depends on CUDA anyway, try to find it
if (NOT CUDA_FOUND)
if(MAGMA_FIND_REQUIRED)
find_package(CUDA REQUIRED)
else()
find_package(CUDA)
endif()
if(MAGMA_FIND_REQUIRED)
find_package(CUDA REQUIRED)
else()
find_package(CUDA)
endif()
if( CUDA_FOUND )
libraries_absolute_path(CUDA_LIBRARIES "$ENV{CUDA_ROOT}/lib64")
endif ()
# MAGMA depends on cuBLAS which should come with CUDA, if not found -> error
if (NOT CUDA_CUBLAS_LIBRARIES)
if(MAGMA_FIND_REQUIRED)
......@@ -87,20 +88,16 @@ if (NOT CUDA_CUBLAS_LIBRARIES)
endif()
endif()
# MAGMA depends on LAPACK anyway, try to find it
if (NOT LAPACK_FOUND)
if(MAGMA_FIND_REQUIRED)
find_package(LAPACKEXT REQUIRED)
else()
find_package(LAPACKEXT)
endif()
if(MAGMA_FIND_REQUIRED)
find_package(LAPACK REQUIRED)
else()
find_package(LAPACK)
endif()
# MAGMA depends on CBLAS anyway, try to find it
if (NOT CBLAS_FOUND)
if(MAGMA_FIND_REQUIRED)
find_package(CBLAS REQUIRED)
else()
find_package(CBLAS)
endif()
if(MAGMA_FIND_REQUIRED)
find_package(CBLAS REQUIRED)
else()
find_package(CBLAS)
endif()
set(ENV_MAGMA_DIR "$ENV{MAGMA_DIR}")
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.