...
 
Commits (658)
image: hpclib/hiepacs
variables:
GIT_SUBMODULE_STRATEGY: normal
stages:
- build
- test
- sonar
build:
stage: build
artifacts:
name: scalfmm_build
expire_in: 1 day
paths:
- Build/
script:
- cd Build && cmake ..
-DSCALFMM_USE_LOG=ON
-DSCALFMM_USE_ASSERT=ON
-DSCALFMM_USE_SSE=OFF
-DSCALFMM_USE_AVX=OFF
-DSCALFMM_USE_BLAS=ON
-DSCALFMM_USE_FFT=ON
-DSCALFMM_USE_MPI=ON
-DSCALFMM_USE_STARPU=ON
-DSCALFMM_BUILD_EXAMPLES=ON
-DSCALFMM_BUILD_TESTS=ON
-DSCALFMM_BUILD_UTESTS=ON
-DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_C_COMPILER=gcc-6
-DCMAKE_CXX_COMPILER=g++-6
- make -j5 2>&1 |tee scalfmm-build.log
doc:
stage: build
artifacts:
name: scalfmm_doc
expire_in: 1 day
paths:
- Build/Doc/html
script:
- cd Build && cmake ..
-DSCALFMM_BUILD_DOC=ON
-DCMAKE_C_COMPILER=gcc-6
-DCMAKE_CXX_COMPILER=g++-6
- make doc
test:
stage: test
dependencies:
- build
artifacts:
name: scalfmm_test
expire_in: 1 day
paths:
- Build/
script:
- (cd Build && OMP_NUM_THREADS=4 ctest --no-compress-output -V -j 5 -D ExperimentalBuild -D ExperimentalTest -D ExperimentalCoverage -D ExperimentalSubmit)
sonar:
stage: sonar
dependencies:
- test
artifacts:
name: scalfmm_sonar
expire_in: 1 day
paths:
- scalfmm-build.log
- scalfmm-coverage.xml
- scalfmm-cppcheck.xml
- scalfmm-rats.xml
- sonar-project.properties
- sonar.log
script:
- mv Build/scalfmm-build.log .
- source ./Utils/scripts/analysis.sh
- sonar-scanner |tee sonar.log;
only:
- develop@solverstack/ScalFMM
\ No newline at end of file
[submodule "CMakeModules/morse_cmake"]
path = CMakeModules/morse_cmake
url = https://gitlab.inria.fr/solverstack/morse_cmake.git
This diff is collapsed.
###
#
# @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-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
#
# @file AuxilaryFlags.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 0.9.0
# @author Xavier Lacoste
# @author Florent Pruvost
# @date 30-01-2015
#
# Update CMAKE auxilary variables:
# - CMAKE_C_FLAGS: C compiler flags
# - CMAKE_CXX_FLAGS: CXX compiler flags
# - CMAKE_Fortran_FLAGS: Fortran compiler flags
# - CMAKE_Fortran_PREPROCESS_FLAGS : force C preprocessor.
# - CMAKE_Fortran_FREEFORM_FLAG : Force free format.
###
if (MORSE_ENABLE_WARNING)
if(CMAKE_C_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
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")
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")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -warn all -diag-disable:remark")
endif()
endif(MORSE_ENABLE_WARNING)
if (MORSE_ENABLE_COVERAGE)
if(CMAKE_C_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --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")
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")
else()
message(FATAL_ERROR "Code coverage is only available with the GNU"
"\n Fortran (gfortran) compiler, please turn MORSE_ENABLE_COVERAGE"
"\n OFF\n.")
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
endif(MORSE_ENABLE_COVERAGE)
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
list(APPEND CMAKE_Fortran_PREPROCESS_FLAGS "-cpp")
list(APPEND CMAKE_Fortran_FREEFORM_FLAG "-ffree-form")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
list(APPEND CMAKE_Fortran_PREPROCESS_FLAG "-fpp")
list(APPEND CMAKE_Fortran_FREEFORM_FLAG "")
endif()
###
#
# @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.
#
###
#
# @file ColorizeMessage.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 0.9.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @author Florent Pruvost
# @date 13-07-2012
#
###
# Set some colors
#if(NOT WIN32)
# string(ASCII 27 Esc)
# set(ColourReset "${Esc}[m")
# set(ColourBold "${Esc}[1m")
# set(Red "${Esc}[31m")
# set(Green "${Esc}[32m")
# set(Yellow "${Esc}[33m")
# set(Blue "${Esc}[34m")
# set(Magenta "${Esc}[35m")
# set(Cyan "${Esc}[36m")
# set(White "${Esc}[37m")
# set(BoldRed "${Esc}[1;31m")
# set(BoldGreen "${Esc}[1;32m")
# set(BoldYellow "${Esc}[1;33m")
# set(BoldBlue "${Esc}[1;34m")
# set(BoldMagenta "${Esc}[1;35m")
# set(BoldCyan "${Esc}[1;36m")
# set(BoldWhite "${Esc}[1;37m")
#endif()
# Colorize cmake messages during configure
function(message)
list(GET ARGV 0 MessageType)
if(MessageType STREQUAL FATAL_ERROR OR MessageType STREQUAL SEND_ERROR)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${BoldRed}${ARGV_STR}${ColourReset}")
elseif(MessageType STREQUAL WARNING)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${BoldYellow}${ARGV_STR}${ColourReset}")
elseif(MessageType STREQUAL AUTHOR_WARNING)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${BoldCyan}${ARGV_STR}${ColourReset}")
elseif(MessageType STREQUAL STATUS)
list(REMOVE_AT ARGV 0)
string (REPLACE ";" " " ARGV_STR "${ARGV}")
_message(${MessageType} "${Green}${ARGV_STR}${ColourReset}")
else()
string (REPLACE ";" " " ARGV_STR "${ARGV}")
string (REPLACE "${Esc}[1 " "${Esc}[1;" ARGV_STR "${ARGV_STR}")
_message("${ARGV_STR}")
endif()
endfunction()
##
## @end file ColorizeMessage.cmake
##
###
#
# @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.
#
###
#
# @file FindHeadersAndLibs.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 0.9.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @author Florent Pruvost
# @date 13-07-2012
#
###
# Add the path where we handle our FindFOO.cmake to seek for liraries
list(APPEND CMAKE_MODULE_PATH ${MORSE_CMAKE_MODULE_PATH}/find)
# Some macros to print status when search for headers and libs
# PrintFindStatus.cmake is in cmake_modules/morse/find directory
include(PrintFindStatus)
function(FindHeader _libname _header_to_find)
# save _libname upper and lower case
string(TOUPPER ${_libname} LIBNAME)
string(TOLOWER ${_libname} libname)
# Looking for include
# -------------------
# Add system include paths to search include
# ------------------------------------------
unset(_inc_env)
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()
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 _header_to_find in the given paths
# --------------------------------------------------
# call cmake macro to find the header path
if(${LIBNAME}_INCDIR)
set(${LIBNAME}_${_header_to_find}_DIRS "${LIBNAME}_${_header_to_find}_DIRS-NOTFOUND")
find_path(${LIBNAME}_${_header_to_find}_DIRS
NAMES ${_header_to_find}
HINTS ${${LIBNAME}_INCDIR})
elseif(${LIBNAME}_DIR)
set(${LIBNAME}_${_header_to_find}_DIRS "${LIBNAME}_${_header_to_find}_DIRS-NOTFOUND")
find_path(${LIBNAME}_${_header_to_find}_DIRS
NAMES ${_header_to_find}
HINTS ${${LIBNAME}_DIR}
PATH_SUFFIXES include)
else()
set(${LIBNAME}_${_header_to_find}_DIRS "${LIBNAME}_${_header_to_find}_DIRS-NOTFOUND")
find_path(${LIBNAME}_${_header_to_find}_DIRS
NAMES ${_header_to_find}
HINTS ${_inc_env})
endif()
mark_as_advanced(${LIBNAME}_${_header_to_find}_DIRS)
# Print status if not found
# -------------------------
if (NOT ${LIBNAME}_${_header_to_find}_DIRS)
Print_Find_Header_Status(${libname} ${_header_to_find})
endif ()
endfunction(FindHeader)
##
## @end file FindHeadersAndLibs.cmake
##
###
#
# @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-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
#
###
#
# @file MorseInit.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 0.9.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @author Florent Pruvost
# @date 13-07-2012
#
###
# This include is required to check symbols of libs in the main CMakeLists.txt
include(CheckFunctionExists)
# To colorize messages
#include(ColorizeMessage)
# To find headers and libs
include(FindHeadersAndLibs)
# Some macros to print status when search for headers and libs
# PrintFindStatus.cmake is in cmake_modules/morse/find directory
include(PrintFindStatus)
# Define some auxilary flags
include(AuxilaryFlags)
# Define some variables to et info about ressources
include(Ressources)
# Add the path where we handle our FindFOO.cmake to seek for liraries
list(APPEND CMAKE_MODULE_PATH ${MORSE_CMAKE_MODULE_PATH}/find)
option(MORSE_ENABLE_WARNING "Enable warning messages" OFF)
option(MORSE_ENABLE_COVERAGE "Enable flags for coverage test" OFF)
#option(MORSE_VERBOSE_FIND_PACKAGE "Add additional messages concerning packages not found" OFF)
#message(STATUS "MORSE_VERBOSE_FIND_PACKAGE is set to OFF, turn it ON to get"
# " information about packages not found")
##
## @end file MorseInit.cmake
##
###
#
# @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.
#
###
#
# @file ParseArguments.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 0.9.0
# @author Cedric Castagnede
# @author Emmanuel Agullo
# @author Mathieu Faverge
# @date 13-07-2012
#
###
MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
set(DEFAULT_ARGS)
foreach(arg_name ${arg_names})
set(${prefix}_${arg_name})
endforeach(arg_name)
foreach(option ${option_names})
set(${prefix}_${option} FALSE)
endforeach(option)
set(current_arg_name DEFAULT_ARGS)
set(current_arg_list)
foreach(arg ${ARGN})
set(larg_names ${arg_names})
list(FIND larg_names "${arg}" is_arg_name)
if(is_arg_name GREATER -1)
set(${prefix}_${current_arg_name} ${current_arg_list})
set(current_arg_name ${arg})
set(current_arg_list)
else(is_arg_name GREATER -1)
set(loption_names ${option_names})
list(FIND loption_names "${arg}" is_option)
if(is_option GREATER -1)
set(${prefix}_${arg} TRUE)
else(is_option GREATER -1)
set(current_arg_list ${current_arg_list} ${arg})
endif(is_option GREATER -1)
endif(is_arg_name GREATER -1)
endforeach(arg)
set(${prefix}_${current_arg_name} ${current_arg_list})
ENDMACRO(PARSE_ARGUMENTS)
MACRO(CAR var)
set(${var} ${ARGV1})
ENDMACRO(CAR)
MACRO(CDR var junk)
set(${var} ${ARGN})
ENDMACRO(CDR)
##
## @end file ParseArguments.cmake
##
###
#
# @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.
#
###
#
# - Some macros to print status when search for headers and libs
# Main parameters of macros
# _libname: name of the lib you seek, foo for example
# _header_to_find: name of the header you seek, foo.h for example
# _lib_to_find: name of the library you seek, libfoo for example
# _pc_to_find: name of the pkg-config file zyou seek, foo.pc for example
#=============================================================================
# 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.)
# Set some colors
#if(NOT WIN32)
# string(ASCII 27 Esc)
# set(ColourReset "${Esc}[m")
# set(ColourBold "${Esc}[1m")
# set(Red "${Esc}[31m")
# set(Green "${Esc}[32m")
# set(Yellow "${Esc}[33m")
# set(Blue "${Esc}[34m")
# set(Magenta "${Esc}[35m")
# set(Cyan "${Esc}[36m")
# set(White "${Esc}[37m")
# set(BoldRed "${Esc}[1;31m")
# set(BoldGreen "${Esc}[1;32m")
# set(BoldYellow "${Esc}[1;33m")
# set(BoldBlue "${Esc}[1;34m")
# set(BoldMagenta "${Esc}[1;35m")
# set(BoldCyan "${Esc}[1;36m")
# set(BoldWhite "${Esc}[1;37m")
#endif()
# This macro informs why the _header_to_find file has not been found
macro(Print_Find_Header_Status _libname _header_to_find)
# save _libname upper and lower case
string(TOUPPER ${_libname} LIBNAME)
string(TOLOWER ${_libname} libname)
# print status
#message(" ")
if(${LIBNAME}_INCDIR)
message("${Blue}${LIBNAME}_INCDIR is defined but ${_header_to_find}"
"has not been found in ${${LIBNAME}_INCDIR}${ColourReset}")
else()
if(${LIBNAME}_DIR)
message("${Blue}${LIBNAME}_DIR is defined but"
"${_header_to_find} has not been found in"
"${${LIBNAME}_DIR}/include${ColourReset}")
else()
message("${Blue}${_header_to_find} not found."
"Nor ${LIBNAME}_DIR neither ${LIBNAME}_INCDIR"
"are defined so that we looked for ${_header_to_find} in"
"system paths (INCLUDE, CPATH, C_INCLUDE_PATH,"
"INCLUDE_PATH, CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES"
", CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES)${ColourReset}")
if(_inc_env)
message("${Blue}${_header_to_find} has not been found in"
"${_inc_env}${ColourReset}")
endif()
endif()
endif()
message("${BoldBlue}Please indicate where to find ${_header_to_find}. You have three options:\n"
"- Option 1: Provide the root directory of the library with cmake option: -D${LIBNAME}_DIR=your/path/to/${libname}/\n"
"- Option 2: Provide the directory where to find the headers with cmake option: -D${LIBNAME}_INCDIR=your/path/to/${libname}/include/\n"
"- Option 3: Update your environment variable (INCLUDE or CPATH)\n"
"- Option 4: If your library provides a PkgConfig file, make sure pkg-config finds your library${ColourReset}")
#message(" ")
endmacro()
# This macro informs why the _lib_to_find file has not been found
macro(Print_Find_Library_Status _libname _lib_to_find)
# save _libname upper/lower case
string(TOUPPER ${_libname} LIBNAME)
string(TOLOWER ${_libname} libname)
# print status
#message(" ")
if(${LIBNAME}_LIBDIR)
message("${Yellow}${LIBNAME}_LIBDIR is defined but ${_lib_to_find}"
"has not been found in ${${LIBNAME}_LIBDIR}${ColourReset}")
else()
if(${LIBNAME}_DIR)
message("${Yellow}${LIBNAME}_DIR is defined but ${_lib_to_find}"
"has not been found in ${${LIBNAME}_DIR}/lib(or /lib32 or"
"/lib64)${ColourReset}")
else()
message("${Yellow}${_lib_to_find} not found."
"Nor ${LIBNAME}_DIR neither ${LIBNAME}_LIBDIR"
"are defined so that we looked for ${_lib_to_find} in"
"system paths (Linux: LD_LIBRARY_PATH, Windows: LIB,"
"Mac: DYLD_LIBRARY_PATH,"
"CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES,"
"CMAKE_C_IMPLICIT_LINK_DIRECTORIES)${ColourReset}")
if(_lib_env)
message("${Yellow}${_lib_to_find} has not been found in"
"${_lib_env}${ColourReset}")
endif()
endif()
endif()
message("${BoldYellow}Please indicate where to find ${_lib_to_find}. You have three options:\n"
"- Option 1: Provide the root directory of the library with cmake option: -D${LIBNAME}_DIR=your/path/to/${libname}/\n"
"- Option 2: Provide the directory where to find the library with cmake option: -D${LIBNAME}_LIBDIR=your/path/to/${libname}/lib/\n"
"- Option 3: Update your environment variable (Linux: LD_LIBRARY_PATH, Windows: LIB, Mac: DYLD_LIBRARY_PATH)\n"
"- Option 4: If your library provides a PkgConfig file, make sure pkg-config finds your library${ColourReset}")
endmacro()
# This macro informs why the _lib_to_find file has not been found
macro(Print_Find_Library_Blas_Status _libname _lib_to_find)
# save _libname upper/lower case
string(TOUPPER ${_libname} LIBNAME)
string(TOLOWER ${_libname} libname)
# print status
#message(" ")
if(${LIBNAME}_LIBDIR)
message("${Yellow}${LIBNAME}_LIBDIR is defined but ${_lib_to_find}"
"has not been found in ${ARGN}${ColourReset}")
else()
if(${LIBNAME}_DIR)
message("${Yellow}${LIBNAME}_DIR is defined but ${_lib_to_find}"
"has not been found in ${ARGN}${ColourReset}")
else()
message("${Yellow}${_lib_to_find} not found."
"Nor ${LIBNAME}_DIR neither ${LIBNAME}_LIBDIR"
"are defined so that we look for ${_lib_to_find} in"
"system paths (Linux: LD_LIBRARY_PATH, Windows: LIB,"
"Mac: DYLD_LIBRARY_PATH,"
"CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES,"
"CMAKE_C_IMPLICIT_LINK_DIRECTORIES)${ColourReset}")
if(_lib_env)
message("${Yellow}${_lib_to_find} has not been found in"
"${_lib_env}${ColourReset}")
endif()
endif()
endif()
message("${BoldYellow}Please indicate where to find ${_lib_to_find}. You have three options:\n"
"- Option 1: Provide the root directory of the library with cmake option: -D${LIBNAME}_DIR=your/path/to/${libname}/\n"
"- Option 2: Provide the directory where to find the library with cmake option: -D${LIBNAME}_LIBDIR=your/path/to/${libname}/lib/\n"
"- Option 3: Update your environment variable (Linux: LD_LIBRARY_PATH, Windows: LIB, Mac: DYLD_LIBRARY_PATH)\n"
"- Option 4: If your library provides a PkgConfig file, make sure pkg-config finds your library${ColourReset}")
endmacro()
# This macro informs why the _lib_to_find file has not been found
macro(Print_Find_Library_Blas_CheckFunc_Status _name)
# save _libname upper/lower case
string(TOUPPER ${_name} FUNCNAME)
string(TOLOWER ${_name} funcname)
# print status
#message(" ")
message("${Red}Libs have been found but check of symbol ${_name} failed "
"with following libraries ${ARGN}${ColourReset}")
message("${BoldRed}Please open your error file CMakeFiles/CMakeError.log"
"to figure out why it fails${ColourReset}")
#message(" ")
endmacro()
# This macro informs that _pc_to_find file has not been found in the list
# path you give as last argument (read in ${ARGN})
# ex: Print_Find_Pkgconfig_Status(foo foo.pc ${PATHLIST}
macro(Print_Find_Pkgconfig_Status _libname _pc_to_find)
# save _libname lower case
string(TOLOWER ${_libname} libname)
# print status
#message(" ")
message("${Magenta}${_pc_to_find} has not been found in"
"${ARGN}${ColourReset}")
message("${BoldMagenta}If you really want to use the pkg-config file of"
"${libname}, please update your PKG_CONFIG_PATH with the path"
"where ${_pc_to_find} states${ColourReset}")
#message(" ")
endmacro()
###
#
# @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.
#
###
#
# @file Ressources.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 0.9.0
# @author Florent Pruvost
# @date 13-05-2015
#
# Define variables for hardware ressources:
# - NUMBER_OF_CPU.
# - TODO: NUMBER_OF_CUDA.
###
if(NOT DEFINED PROCESSOR_COUNT)
# Unknown:
set(NUMBER_OF_CPU 0)
# Linux:
set(cpuinfo_file "/proc/cpuinfo")
if(EXISTS "${cpuinfo_file}")
file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$")
list(LENGTH procs NUMBER_OF_CPU)
endif()
# Mac:
if(APPLE)
find_program(cmd_sys_pro "system_profiler")
if(cmd_sys_pro)
execute_process(COMMAND ${cmd_sys_pro} SPHardwareDataType OUTPUT_VARIABLE info)
string(REGEX REPLACE "^.*Total Number of Cores: ([0-9]+).*$" "\\1"
NUMBER_OF_CPU "${info}")
endif()
endif()
# Windows:
if(WIN32)
set(NUMBER_OF_CPU "$ENV{NUMBER_OF_PROCESSORS}")
endif()
endif()
###
#
# @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.
#
###
#
# @file RulesPrecisions.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 0.9.0
# @author Thomas Herault
# @author George Bosilca
# @author Aurelien Bouteiller
# @author Mathieu Faverge
# @author Florent Puvost
# @date 13-07-2012
#
###
cmake_minimum_required(VERSION 2.8)
include(CMakeDependentOption)
set(RP_GENDEPENDENCIES ${MORSE_CMAKE_MODULE_PATH}/precision_generator/genDependencies.py)
set(RP_CODEGEN ${MORSE_CMAKE_MODULE_PATH}/precision_generator/codegen.py)
# Dictionnary
# -----------
if( NOT DEFINED RP_${CMAKE_PROJECT_NAME}_DICTIONNARY )
message( WARNING "RulesPrecisions included before RP_${CMAKE_PROJECT_NAME}_DICTIONNARY was defined (Default is used)" )
set(RP_${CMAKE_PROJECT_NAME}_DICTIONNARY ${MORSE_CMAKE_MODULE_PATH}/precision_generator/subs.py
CACHE INTERNAL "Dictionnary used for precision generation" )
else()
set(RP_${CMAKE_PROJECT_NAME}_DICTIONNARY ${RP_${CMAKE_PROJECT_NAME}_DICTIONNARY}
CACHE INTERNAL "Dictionnary used for precision generation" )
endif()
# Default Precisions
# ------------------
if( NOT DEFINED RP_${CMAKE_PROJECT_NAME}_PRECISIONS )
message( WARNING "RulesPrecisions included before RP_${CMAKE_PROJECT_NAME}_PRECISIONS was defined (\"s;d;c;z\" is used)" )
set(RP_${CMAKE_PROJECT_NAME}_PRECISIONS "s;d;c;z"
CACHE INTERNAL "Set of available precisions for the project" )
else()
set(RP_${CMAKE_PROJECT_NAME}_PRECISIONS ${RP_${CMAKE_PROJECT_NAME}_PRECISIONS}
CACHE INTERNAL "Set of available precisions for the project" )
endif()
# Detect if compilation is done in or out of place
# ------------------------------------------------
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" __inplace)
set( ${CMAKE_PROJECT_NAME}_COMPILE_INPLACE ${__inplace}
CACHE INTERNAL "Defines if the project compilation is made inplace or not" )
# Detect default settings
# -----------------------
set( _prec_S OFF )
set( _prec_D OFF )
set( _prec_DS OFF )
set( _prec_C OFF )
set( _prec_Z OFF )
set( _prec_ZC OFF )
foreach(_prec ${RP_${CMAKE_PROJECT_NAME}_PRECISIONS})
if ( ${_prec} STREQUAL zc )
set( _prec_S ON )
set( _prec_D ON )
set( _prec_C ON )
set( _prec_Z ON )
set( _prec_ZC ON )
elseif( ${_prec} STREQUAL z )
set( _prec_D ON )
set( _prec_Z ON )
elseif( ${_prec} STREQUAL c )
set( _prec_S ON )
set( _prec_C ON )
elseif( ${_prec} STREQUAL ds )
set( _prec_S ON )
set( _prec_D ON )
set( _prec_DS ON )
elseif( ${_prec} STREQUAL d )
set( _prec_S ON )
elseif( ${_prec} STREQUAL s )
set( _prec_S ON )
endif()
endforeach()
# set computed precisions
# -----------------------
if( ${_prec_S} )
option(${PROJECT_NAME}_PREC_S
"Build ${PROJECT_NAME} real single precision" ON)
endif()
if( ${_prec_D} )
option(${PROJECT_NAME}_PREC_D
"Build ${PROJECT_NAME} real double precision" ON)
endif()
if( ${_prec_C} )
cmake_dependent_option(${PROJECT_NAME}_PREC_C
"Build ${PROJECT_NAME} complex single precision" ON "${PROJECT_NAME}_PREC_S" OFF)
endif()
if( ${_prec_Z} )
cmake_dependent_option(${PROJECT_NAME}_PREC_Z
"Build ${PROJECT_NAME} complex double precision" ON "${PROJECT_NAME}_PREC_D" OFF)
endif()
if( ${_prec_DS} )
cmake_dependent_option(${PROJECT_NAME}_PREC_DS
"Build ${PROJECT_NAME} real mixed precision" ON "${PROJECT_NAME}_PREC_S;${PROJECT_NAME}_PREC_D" OFF)
endif()
if( ${_prec_ZC} )
cmake_dependent_option(${PROJECT_NAME}_PREC_ZC
"Build ${PROJECT_NAME} complex mixed precision" ON "${PROJECT_NAME}_PREC_C;${PROJECT_NAME}_PREC_Z" OFF)
endif()
# Define precision supported by the project
# -----------------------------------------
set( ${CMAKE_PROJECT_NAME}_PRECISION "" )
if(${CMAKE_PROJECT_NAME}_PREC_S)
list(APPEND ${CMAKE_PROJECT_NAME}_PRECISION "s")
endif()
if(${CMAKE_PROJECT_NAME}_PREC_D)
list(APPEND ${CMAKE_PROJECT_NAME}_PRECISION "d")
endif()
if(${CMAKE_PROJECT_NAME}_PREC_DS)
list(APPEND ${CMAKE_PROJECT_NAME}_PRECISION "ds")
endif()
if(${CMAKE_PROJECT_NAME}_PREC_C)
list(APPEND ${CMAKE_PROJECT_NAME}_PRECISION "c")
endif()
if(${CMAKE_PROJECT_NAME}_PREC_Z)
list(APPEND ${CMAKE_PROJECT_NAME}_PRECISION "z")
endif()
if(${CMAKE_PROJECT_NAME}_PREC_ZC)
list(APPEND ${CMAKE_PROJECT_NAME}_PRECISION "zc")
endif()
#
# Generates a rule for every SOURCES file, to create the precisions in PRECISIONS. If TARGETDIR
# is not empty then all generated files will be prepended with the $TARGETDIR/.
# A new file is created, from a copy by default
# If the first precision is "/", all occurences of the basename in the file are remplaced by
# "pbasename" where p is the selected precision.
# the target receives a -DPRECISION_p in its cflags.
#
include(ParseArguments)
find_package(PythonInterp REQUIRED)
MACRO(precisions_rules_py)
PARSE_ARGUMENTS(PREC_RULE "TARGETDIR;PRECISIONS" "" ${ARGN})
message(STATUS "Generate precision dependencies in ${CMAKE_CURRENT_SOURCE_DIR}")
# The first is the output variable list
CAR(OUTPUTLIST ${PREC_RULE_DEFAULT_ARGS})
# Everything else should be source files.
CDR(SOURCES ${PREC_RULE_DEFAULT_ARGS})
if( NOT DEFINED ${CMAKE_PROJECT_NAME}_COMPILE_INPLACE )
message( FATAL_ERROR "precisions_rules_init must be called before any call to precisions_rules_py" )
endif()
if( NOT DEFINED RP_${CMAKE_PROJECT_NAME}_DICTIONNARY )
message( FATAL_ERROR "precisions_rules_init must be called before any call to precisions_rules_py" )
endif()
# By default the TARGETDIR is the current binary directory
if( "${PREC_RULE_TARGETDIR}" STREQUAL "" )
set(PREC_RULE_TARGETDIR "./")
set(PRECISIONPP_prefix "./")
set(PRECISIONPP_arg "-P")
else( "${PREC_RULE_TARGETDIR}" STREQUAL "" )
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${PREC_RULE_TARGETDIR})
else(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${PREC_RULE_TARGETDIR})
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PREC_RULE_TARGETDIR})
endif(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${PREC_RULE_TARGETDIR})
set(PRECISIONPP_arg "-P")
set(PRECISIONPP_prefix "${PREC_RULE_TARGETDIR}")
endif( "${PREC_RULE_TARGETDIR}" STREQUAL "" )
set(options_list "")
foreach(prec_rules_PREC ${PREC_RULE_PRECISIONS})
set(options_list "${options_list} ${prec_rules_PREC}")
endforeach()
set(sources_list "")
foreach(_src ${SOURCES})
set(sources_list "${sources_list} ${_src}")
endforeach()
set(gencmd ${PYTHON_EXECUTABLE} ${RP_GENDEPENDENCIES} -f "${sources_list}" -p "${options_list}" -s "${CMAKE_CURRENT_SOURCE_DIR}" ${PRECISIONPP_arg} ${PRECISIONPP_prefix})
EXECUTE_PROCESS(COMMAND ${gencmd} OUTPUT_VARIABLE dependencies_list)
foreach(_dependency ${dependencies_list})
string(STRIP "${_dependency}" _dependency)
string(COMPARE NOTEQUAL "${_dependency}" "" not_empty)
if( not_empty )
string(REGEX REPLACE "^(.*),(.*),(.*)$" "\\1" _dependency_INPUT "${_dependency}")
set(_dependency_PREC "${CMAKE_MATCH_2}")
set(_dependency_OUTPUT "${CMAKE_MATCH_3}")
set(pythoncmd ${PYTHON_EXECUTABLE} ${RP_CODEGEN} -f ${CMAKE_CURRENT_SOURCE_DIR}/${_dependency_INPUT} -p ${_dependency_PREC} ${PRECISIONPP_arg} ${PRECISIONPP_prefix})
string(STRIP "${_dependency_OUTPUT}" _dependency_OUTPUT)
string(COMPARE NOTEQUAL "${_dependency_OUTPUT}" "" got_file)
# Force the copy of the original files in the binary_dir
# for VPATH compilation
if( NOT ${CMAKE_PROJECT_NAME}_COMPILE_INPLACE )
set(generate_out 1)
else( NOT ${CMAKE_PROJECT_NAME}_COMPILE_INPLACE )
string(COMPARE NOTEQUAL "${_dependency_OUTPUT}" "${_dependency_INPUT}" generate_out )
endif()
# We generate a dependency only if a file will be generated
if( got_file )
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 )
else( generate_out )
set_SOURCE_FILES_PROPERTIES(${_dependency_OUTPUT} PROPERTIES COMPILE_FLAGS "-DPRECISION_${_dependency_PREC}" GENERATED 0 )
endif( generate_out )
list(APPEND ${OUTPUTLIST} ${_dependency_OUTPUT})
endif( got_file )
endif()
endforeach()
message(STATUS "Generate precision dependencies in ${CMAKE_CURRENT_SOURCE_DIR} - Done")
ENDMACRO(precisions_rules_py)
##
## @end file RulesPrecisions.cmake
##
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.
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.