Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add badges and improve make output #879

Merged
merged 15 commits into from
Mar 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
276 changes: 194 additions & 82 deletions CMakeLists.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/639125056b554837b9fd996fb197f833)](https://www.codacy.com/app/FairRootGroup/FairRoot?utm_source=github.com&utm_medium=referral&utm_content=FairRootGroup/FairRoot&utm_campaign=Badge_Grade)
# FairRoot [![license](https://alfa-ci.gsi.de/shields/badge/license-LGPL--3.0-orange.svg)](COPYRIGHT) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/639125056b554837b9fd996fb197f833)](https://www.codacy.com/app/FairRootGroup/FairRoot?utm_source=github.com&utm_medium=referral&utm_content=FairRootGroup/FairRoot&utm_campaign=Badge_Grade)

## The FairRoot framework
A simulation, reconstruction and analysis framework that is based on the ROOT system.
Expand Down
4 changes: 2 additions & 2 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# GNU Lesser General Public Licence (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
################################################################################
# Create a library called "libBase" which includes the source files given in
Expand Down Expand Up @@ -175,7 +175,7 @@ EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE}
OUTPUT_VARIABLE ROOT_HAS_GDML )

If ( ${ROOT_HAS_GDML} STREQUAL yes )
Message(STATUS "Build CbmModule with Gdml support")
Message(STATUS "Build FairModule with Gdml support")
Add_Definitions(-DROOT_HAS_GDML)
EndIf ( ${ROOT_HAS_GDML} STREQUAL yes )

Expand Down
12 changes: 6 additions & 6 deletions cmake/cuda/FindCUDA.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
################################################################################
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
################################################################################
# - Tools for building CUDA C files: libraries and build dependencies.
Expand Down Expand Up @@ -299,7 +299,7 @@
###############################################################################

# FindCUDA.cmake
Message(STATUS "Looking for CUDA...")
#Message(STATUS "Looking for CUDA...")
# We need to have at least this version to support the VERSION_LESS argument to 'if' (2.6.2) and unset (2.6.3)
cmake_policy(PUSH)
cmake_minimum_required(VERSION 2.6.3)
Expand Down Expand Up @@ -804,7 +804,7 @@ If(CUDA_FOUND)
Message(STATUS "CUDA BLAS : ${CUDA_CUBLAS_LIBRARIES}")
Message(STATUS "CUDA RAND : ${CUDA_curand_LIBRARY}")
Message(STATUS "CUDA Performance Primitives library: ${CUDA_npp_LIBRARY}")

EndIf(CUDA_FOUND)

###############################################################################
Expand Down Expand Up @@ -1286,7 +1286,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
endif()
endif()
# message("_cuda_generate_dependencies = ${_cuda_generate_dependencies}")

# If we needed to regenerate the dependency file, do so now.
if (_cuda_generate_dependencies)

Expand Down Expand Up @@ -1337,7 +1337,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# Try and reload the dependies
cuda_include_nvcc_dependencies(${cmake_dependency_file})
endif()
endif()
endif()
endif()

# Build the generated file and dependency file ##########################
Expand Down
143 changes: 75 additions & 68 deletions cmake/modules/CheckCompiler.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
################################################################################
# Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
################################################################################
MACRO ( Check_Compiler )
Expand Down Expand Up @@ -38,12 +38,14 @@ If(FAIRSOFT_CONFIG)
Get_Filename_Component(FAIRSOFT_C_COMPILER ${FAIRSOFT_C_COMPILER} REALPATH)
Get_Filename_Component(FAIRSOFT_CXX_COMPILER ${FAIRSOFT_CXX_COMPILER} REALPATH)
Get_Filename_Component(FAIRSOFT_Fortran_COMPILER ${FAIRSOFT_Fortran_COMPILER} REALPATH)

Set(FAIRROOT_C_COMPILER ${CMAKE_C_COMPILER})
Set(FAIRROOT_CXX_COMPILER ${CMAKE_CXX_COMPILER})
Set(FAIRROOT_Fortran_COMPILER ${CMAKE_Fortran_COMPILER})

String(STRIP ${FAIRROOT_C_COMPILER} FAIRROOT_C_COMPILER)
String(STRIP ${FAIRROOT_CXX_COMPILER} FAIRROOT_CXX_COMPILER)

If(FAIRROOT_Fortran_COMPILER)
String(STRIP ${FAIRROOT_Fortran_COMPILER} FAIRROOT_Fortran_COMPILER)
Get_Filename_Component(FAIRROOT_Fortran_COMPILER ${FAIRROOT_Fortran_COMPILER} REALPATH)
Expand All @@ -52,7 +54,22 @@ If(FAIRSOFT_CONFIG)
Get_Filename_Component(FAIRROOT_C_COMPILER ${FAIRROOT_C_COMPILER} REALPATH)
Get_Filename_Component(FAIRROOT_CXX_COMPILER ${FAIRROOT_CXX_COMPILER} REALPATH)

If(NOT (${FAIRSOFT_C_COMPILER} STREQUAL ${FAIRROOT_C_COMPILER}) OR NOT (${FAIRSOFT_CXX_COMPILER} STREQUAL ${FAIRROOT_CXX_COMPILER}))
Execute_Process(COMMAND ${FAIRSOFT_C_COMPILER} --version
OUTPUT_VARIABLE FAIRSOFT_C_COMPILER_STRING
)

Execute_Process(COMMAND ${FAIRROOT_C_COMPILER} --version
OUTPUT_VARIABLE FAIRROOT_C_COMPILER_STRING
)

Execute_Process(COMMAND ${FAIRSOFT_CXX_COMPILER} --version
OUTPUT_VARIABLE FAIRSOFT_CXX_COMPILER_STRING
)
Execute_Process(COMMAND ${FAIRROOT_CXX_COMPILER} --version
OUTPUT_VARIABLE FAIRROOT_CXX_COMPILER_STRING
)

If(NOT ("${FAIRSOFT_C_COMPILER_STRING}" STREQUAL "${FAIRROOT_C_COMPILER_STRING}") OR NOT ("${FAIRSOFT_CXX_COMPILER_STRING}" STREQUAL "${FAIRROOT_CXX_COMPILER_STRING}"))
execute_process(COMMAND cmake -E compare_files ${FAIRSOFT_CXX_COMPILER} ${FAIRROOT_CXX_COMPILER} RESULT_VARIABLE COMPILER_DIFF)
If(NOT ${COMPILER_DIFF} EQUAL 0)
Message(STATUS "C compiler used for FairSoft installation: ${FAIRSOFT_C_COMPILER}")
Expand All @@ -68,7 +85,7 @@ If(FAIRSOFT_CONFIG)
EndIf()
EndIf()

If(FAIRROOT_Fortran_COMPILER)
If(FAIRROOT_Fortran_COMPILER)
If(NOT (${FAIRSOFT_Fortran_COMPILER} STREQUAL ${FAIRROOT_Fortran_COMPILER}))
String(STRIP ${FAIRSOFT_Fortran_COMPILER} FAIRSOFT_Fortran_COMPILER)
Message(STATUS "Fortran compiler used for FairSoft installation: ${FAIRSOFT_Fortran_COMPILER}")
Expand All @@ -94,80 +111,69 @@ EndIf()
if (CMAKE_SYSTEM_NAME MATCHES Linux)
MESSAGE("--- Found a Linux system")
if (CMAKE_COMPILER_IS_GNUCXX)
MESSAGE("--- Found GNU compiler collection")
# set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
# set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}")
# we profile...
# if(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile)
# set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
# set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
# endif(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile)
MESSAGE("--- Found GNU compiler collection")

# Configure build types
set(CMAKE_CONFIGURATION_TYPES "RELWITHDEBINFO" "NIGHTLY" "TEST" "RELEASE" "DEBUG" "DEBUGFULL" "PROFILE" "ARRAY_CHECK")

set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -Wshadow")
set(CMAKE_CXX_FLAGS_NIGHTLY "-O0 -g -Wshadow")
set(CMAKE_CXX_FLAGS_TEST "-O2 -g -Wshadow")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wshadow ")

set(CMAKE_CXX_FLAGS_DEBUG "-g -Wshadow ")
set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -fno-check-new -fno-common -fexceptions")
set(CMAKE_CXX_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs -Wshadow -Wall -Wextra -Wunused-variable")
set(CMAKE_CXX_FLAGS_ARRAY_CHECK "-g3 -fno-inline -ftest-coverage -fprofile-arcs -fstack-protector")

set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
set(CMAKE_C_FLAGS_RELEASE "-O2")
# set(CMAKE_C_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline")
set(CMAKE_C_FLAGS_DEBUG "-g")
set(CMAKE_C_FLAGS_DEBUGFULL "-g3 -fno-inline -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common -fexceptions")
set(CMAKE_C_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
set(CMAKE_C_FLAGS_ARRAY_CHECK "-g3 -fno-inline -ftest-coverage -fprofile-arcs -fstack-protector")

# Select flags.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -Wshadow")
set(CMAKE_CXX_FLAGS_NIGHTLY "-O0 -g -Wshadow")
set(CMAKE_CXX_FLAGS_TEST "-O2 -g -Wshadow")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wshadow ")
# set(CMAKE_CXX_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline")
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wshadow ")
set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -fno-check-new -fno-common -fexceptions")
set(CMAKE_CXX_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs -Wshadow -Wall -Wextra -Wunused-variable")
set(CMAKE_CXX_FLAGS_ARRAY_CHECK "-g3 -fno-inline -ftest-coverage -fprofile-arcs -fstack-protector")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
set(CMAKE_C_FLAGS_RELEASE "-O2")
# set(CMAKE_C_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline")
set(CMAKE_C_FLAGS_DEBUG "-g")
set(CMAKE_C_FLAGS_DEBUGFULL "-g3 -fno-inline -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common -fexceptions")
set(CMAKE_C_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
set(CMAKE_C_FLAGS_ARRAY_CHECK "-g3 -fno-inline -ftest-coverage -fprofile-arcs -fstack-protector")

# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
# set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -fno-check-new -fno-common")
endif (CMAKE_COMPILER_IS_GNUCXX)

if (CMAKE_C_COMPILER MATCHES "icc")
MESSAGE("--- Found Intel compiler collection")
# set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
# set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}")

# Select flags.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_DEBUG "-O2 -g -0b0 -noalign")
set(CMAKE_CXX_FLAGS_DEBUGFULL "-g -Ob0 -noalign -W")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-O2 -g -Ob0 -noalign")
set(CMAKE_C_FLAGS_DEBUGFULL "-g -Ob0 -noalign -W")

# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi -Wpointer-arith -fno-common")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi -Wpointer-arith -fno-exceptions -fno-common")

# Get the directory where to find libimf. The only way I found is to get the install dir from icpc and
# from there one knows where the the libraries are installed
Execute_process(COMMAND which icpc OUTPUT_VARIABLE _bla)
String(REPLACE "bin" "compiler/lib" _intel_lib_dirs ${_bla})
String(REPLACE "/icpc" "" _intel_lib_dirs ${_intel_lib_dirs})
String(STRIP ${_intel_lib_dirs} _intel_lib_dirs)
set(CMAKE_CONFIGURATION_TYPES "RELWITHDEBINFO" "RELEASE" "DEBUG" "DEBUGFULL")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g ")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_CXX_FLAGS_DEBUG "-O2 -g -0b0 -noalign")
set(CMAKE_CXX_FLAGS_DEBUGFULL "-g -Ob0 -noalign -W")

set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-O2 -g -Ob0 -noalign")
set(CMAKE_C_FLAGS_DEBUGFULL "-g -Ob0 -noalign -W")
# Get the directory where to find libimf. The only way I found is to get the install dir from icpc and
# from there one knows where the the libraries are installed
Execute_process(COMMAND which icpc OUTPUT_VARIABLE _bla)
String(REPLACE "bin" "compiler/lib" _intel_lib_dirs ${_bla})
String(REPLACE "/icpc" "" _intel_lib_dirs ${_intel_lib_dirs})
String(STRIP ${_intel_lib_dirs} _intel_lib_dirs)

endif (CMAKE_C_COMPILER MATCHES "icc")
if (CMAKE_C_COMPILER MATCHES "clang")
MESSAGE("--- Clang compiler")

# Select flags.
if (CMAKE_C_COMPILER MATCHES "clang")
MESSAGE("-- Clang compiler")

set(CMAKE_C_FLAGS_PROFILE "--coverage -g3")
set(CMAKE_CXX_FLAGS_PROFILE "--coverage -g3")
# Select flags.
set(CMAKE_C_FLAGS_PROFILE "--coverage -g3")
set(CMAKE_CXX_FLAGS_PROFILE "--coverage -g3")

endif (CMAKE_C_COMPILER MATCHES "clang")
endif (CMAKE_SYSTEM_NAME MATCHES Linux)


if (CMAKE_SYSTEM_NAME MATCHES Darwin)
EXEC_PROGRAM("sw_vers -productVersion | cut -d . -f 1-2" OUTPUT_VARIABLE MAC_OS_VERSION)
MESSAGE("--- Found a Mac OS X System ${MAC_OS_VERSION}")
MESSAGE("-- Found a Mac OS X System ${MAC_OS_VERSION}")
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
MESSAGE("--- Found GNU compiler collection")
MESSAGE("-- Found GNU compiler collection")

STRING(COMPARE EQUAL "10.5" "${MAC_OS_VERSION}" MAC_OS_10_5)
STRING(COMPARE EQUAL "10.6" "${MAC_OS_VERSION}" MAC_OS_10_6)
Expand Down Expand Up @@ -204,41 +210,42 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin)
Get_Filename_Component(FORTRAN_LIBDIR ${FORTRAN_LIBDIR}
PATH
)
Message("Fortran libraries found in ${FORTRAN_LIBDIR}")
Message("-- Fortran libraries found in ${FORTRAN_LIBDIR}")
SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS} -flat_namespace -single_module -undefined dynamic_lookup")

# Select flags.
# Configure build types
set(CMAKE_CONFIGURATION_TYPES "RELWITHDEBINFO" "NIGHTLY" "RELEASE" "DEBUG" "DEBUGFULL" "PROFILE")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -Wshadow ")
set(CMAKE_CXX_FLAGS_NIGHTLY "-O2 -g -Wshadow -Wall -Wextra")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wshadow ")
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wshadow -fno-inline")
set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -fno-check-new -fno-common")
set(CMAKE_CXX_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs -Wall -Wextra")

set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-g -fno-inline")
set(CMAKE_C_FLAGS_DEBUGFULL "-g3 -fno-inline -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
set(CMAKE_C_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs")


else (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Message("CXX Compiler: ${CMAKE_CXX_COMPILER}")
Message("CXX Compiler ABI: ${CMAKE_CXX_COMPILER_ABI}")
Message("CXX Compiler ID: ${CMAKE_CXX_COMPILER_ID}")
MESSAGE(FATAL_ERROR "This compiler is not known.")
MESSAGE(FATAL_ERROR "This compiler is not known.")
endif (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")


endif (CMAKE_SYSTEM_NAME MATCHES Darwin)



if (CMAKE_BUILD_TYPE)
STRING(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER)
SET(CMAKE_BUILD_TYPE_CXXFLAGS_KEY CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPER})
endif ()

MESSAGE("--- Build Type: ${CMAKE_BUILD_TYPE}")
MESSAGE("--- Compiler Flags: ${CMAKE_CXX_FLAGS} ${${CMAKE_BUILD_TYPE_CXXFLAGS_KEY}}")
#MESSAGE("--- Build Type: ${CMAKE_BUILD_TYPE}")
#MESSAGE("--- Compiler Flags: ${CMAKE_CXX_FLAGS} ${${CMAKE_BUILD_TYPE_CXXFLAGS_KEY}}")

ENDMACRO ( Check_Compiler )
Loading