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

Upgrade ROOTSYS Usage #1118

Merged
merged 2 commits into from
Oct 18, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
* This means, that all library dependencies of the type `Core` are either not working at all, or might not work as expected. Please upgrade all of them to be like `ROOT::Core` .
* This also means, that you need to add an `include(ROOTMacros)` after your `find_package2(... ROOT ...)`.
* `ROOT_VERSION_NUMBER` is gone. Use `ROOT_VERSION` (which is the dotted version number) and `VERSION_GREATER`/etc now.
* `ROOTSYS` isn't any longer set. For example use ROOT targets instead.
* Many CMake related tools have been externalized into
[FairCMakeModules](https://github.com/FairRootGroup/FairCMakeModules)
and partly rewritten
Expand Down
8 changes: 6 additions & 2 deletions FairRoot_build_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# copied verbatim in the file "LICENSE" #
################################################################################

list(PREPEND CMAKE_MODULE_PATH "cmake/private")
include(Testlib)

cmake_host_system_information(RESULT fqdn QUERY FQDN)

set(CTEST_SOURCE_DIRECTORY .)
Expand Down Expand Up @@ -59,7 +62,7 @@ ctest_build(FLAGS "-j${NCPUS}" TARGET install

unset(repeat)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
set(repeat REPEAT UNTIL_PASS:5)
set(repeat REPEAT UNTIL_PASS:7)
endif()
if(_ctest_build_ret_val OR _ctest_build_num_errs)
message(STATUS "Skipping tests, because build failed"
Expand All @@ -74,7 +77,8 @@ else()
RETURN_VALUE _ctest_test_ret_val)
endif()

ctest_submit()
fairroot_ctest_submit(FINAL)
fairroot_summary_cdash()

if(_ctest_test_ret_val)
Message(FATAL_ERROR "Some tests failed.")
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/WriteConfigFile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ MACRO (WRITE_CONFIG_FILE filename)
CONVERT_LIST_TO_STRING(${PYTHONPATH})
SET(MY_PYTHONPATH ${output})

SET (PATH ${ROOTSYS}/bin ${PATH})
SET (PATH ${ROOT_BINDIR} ${PATH})
UNIQUE(PATH "${PATH}")
CONVERT_LIST_TO_STRING(${PATH})
Set(MY_PATH ${output})
Expand Down
47 changes: 47 additions & 0 deletions cmake/private/Testlib.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
################################################################################
# Copyright (C) 2020-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH #
# #
# This software is distributed under the terms of the #
# GNU Lesser General Public Licence (LGPL) version 3, #
# copied verbatim in the file "LICENSE" #
################################################################################

function(fairroot_ctest_submit)
cmake_parse_arguments(PARSE_ARGV 0 ARGS "FINAL" "" "")
foreach(env_var IN ITEMS http_proxy HTTP_PROXY https_proxy HTTPS_PROXY)
if("$ENV{${env_var}}" MATCHES ".*proxy.gsi[.]de.*")
set(old_${env_var} "$ENV{${env_var}}")
set(ENV{${env_var}})
message(STATUS "safed ${env_var}: ${old_${env_var}}")
endif()
endforeach()
if(ARGS_FINAL)
ctest_submit(RETURN_VALUE _ctest_submit_ret_val
BUILD_ID cdash_build_id)
set(cdash_build_id "${cdash_build_id}" PARENT_SCOPE)
else()
ctest_submit(RETURN_VALUE _ctest_submit_ret_val)
endif()
foreach(env_var IN ITEMS http_proxy HTTP_PROXY https_proxy HTTPS_PROXY)
if(DEFINED old_${env_var})
set(ENV{${env_var}} "${old_${env_var}}")
message(STATUS "(restored ${env_var}: $ENV{${env_var}})")
endif()
endforeach()

if(_ctest_submit_ret_val)
message(WARNING " ctest_submit() failed. Continueing")
endif()
endfunction()

function(fairroot_summary_cdash)
if(cdash_build_id)
message(STATUS " CDash Build Summary ..: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/buildSummary.php?buildid=${cdash_build_id}")
message(STATUS " CDash Test List ......: "
"${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/viewTest.php?buildid=${cdash_build_id}")
else()
message(STATUS " /!\\ CDash submit likely failed")
endif()
message(STATUS " ")
endfunction()
4 changes: 2 additions & 2 deletions cmake/scripts/CMakeLists.txt_roc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ EndIf(CMAKE_SYSTEM_NAME MATCHES Darwin)

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/roc/lib/libRoc.so
COMMAND LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR}
ROOTSYS=${ROOTSYS} make roclib
make roclib
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/roc
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/roc/patch_okay
)
Expand All @@ -43,7 +43,7 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/roc/lib/libDabcRoc.so
${CMAKE_CURRENT_BINARY_DIR}/roc/lib/libDabcMbs.so
${CMAKE_CURRENT_BINARY_DIR}/roc/lib/libRocDict.rootmap
COMMAND LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR}
ROOTSYS=${ROOTSYS} make rocdict
make rocdict
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/roc
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/roc/lib/libDabcBase.so
)
Expand Down
1 change: 0 additions & 1 deletion cmake/scripts/config.csh.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ setenv System_ "@_system@"
. @_EXECDIR@/check_system.csh
if ( "$same_system" == "1" ) then
setenv SIMPATH "@SIMPATH@"
setenv ROOTSYS "@ROOTSYS@"
setenv FAIRROOTPATH "@FAIRROOTPATH@"
if ( @FULL_CONFIG_FILE@ == true ) then
setenv Geant4_INCLUDE_DIRS "@Geant4_INCLUDE_DIRS@"
Expand Down
1 change: 0 additions & 1 deletion cmake/scripts/config.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export System_="@_system@"
. @_EXECDIR@/check_system.sh
if [ $same_system -eq 1 ]; then
export SIMPATH="@SIMPATH@"
export ROOTSYS="@ROOTSYS@"
export FAIRROOTPATH="@FAIRROOTPATH@"
if (@FULL_CONFIG_FILE@); then
export Geant4_INCLUDE_DIRS="@Geant4_INCLUDE_DIRS@"
Expand Down
1 change: 0 additions & 1 deletion cmake/scripts/generate_dictionary_root.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
# Setup the needed environment
export LD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@
export DYLD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@
export ROOTSYS=@ROOTSYS@

@ROOT_CINT_EXECUTABLE@ -f @Int_DICTIONARY@ @EXTRA_DICT_PARAMETERS_STR@ -c @Int_DEF_STR@ @Int_INC_STR@ @Int_HDRS_STR@ @Int_LINKDEF@
1 change: 0 additions & 1 deletion cmake/scripts/root_macro.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
export LD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@:$DYLD_LIBRARY_PATH
export PATH=@SIMPATH@/bin:$PATH:@Geant4_DIR@
export ROOTSYS=@ROOTSYS@
export ROOTEXE=@ROOT_EXECUTABLE@
export ROOT_INCLUDE_PATH=@Geant3_INCLUDE_DIRS@:@MY_ROOT_INCLUDE_PATH@
export FAIRROOTPATH="@FAIRROOTPATH@"
Expand Down
2 changes: 0 additions & 2 deletions cmake/scripts/run_binary.sh.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/bin/bash

#export LD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@
#export ROOTSYS=@ROOTSYS@
export VMCWORKDIR=@VMCWORKDIR@
export Geant4VMC_MACRO_DIR=@Geant4VMC_MACRO_DIR@
export USE_VGM=1
#export PATH=@ROOTSYS@/bin:$PATH

#export GEANT4_LIBRARY_DIR=@GEANT4_LIBRARY_DIR@
#export Geant4_INCLUDE_DIRS=@Geant4_INCLUDE_DIRS@
Expand Down
1 change: 0 additions & 1 deletion cmake/scripts/set_env.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
export LD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@:$DYLD_LIBRARY_PATH
export PATH=@SIMPATH@/bin:$PATH:@Geant4_DIR@
export ROOTSYS=@ROOTSYS@
export ROOTEXE=@ROOT_EXECUTABLE@
export ROOT_INCLUDE_PATH="@Geant3_INCLUDE_DIRS@:@MY_ROOT_INCLUDE_PATH@"
export VMCWORKDIR=@VMCWORKDIR@
Expand Down