diff --git a/roottest/CMakeLists.txt b/roottest/CMakeLists.txt index 7b290c389767d..25421595079eb 100644 --- a/roottest/CMakeLists.txt +++ b/roottest/CMakeLists.txt @@ -1,3 +1,29 @@ +# set(ROOT_CONFIG_EXECUTABLE $) # Does not exist +# BINDIR set by RootConfiguration.cmake +if(MSVC) + set(ROOT_CONFIG_EXECUTABLE ${ROOT_BINDIR}/root-config.bat) +else() + set(ROOT_CONFIG_EXECUTABLE ${ROOT_BINDIR}/root-config) +endif() +if(NOT EXISTS ${ROOT_CONFIG_EXECUTABLE}) + message(FATAL_ERROR "root-config was not found in ${ROOT_CONFIG_EXECUTABLE}.") +endif() +set(ROOT_root_CMD $) +set(ROOT_hadd_CMD $) +set(ROOT_genreflex_CMD $) +set(ROOT_rootcint_CMD $) +set(ROOT_rootcling_CMD $) + +execute_process(COMMAND ${ROOT_CONFIG_EXECUTABLE} "--tutdir" OUTPUT_VARIABLE ROOT_TUTORIALS_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND ${ROOT_CONFIG_EXECUTABLE} "--incdir" OUTPUT_VARIABLE ROOT_INCLUDE_DIRS OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND ${ROOT_CONFIG_EXECUTABLE} "--libdir" OUTPUT_VARIABLE ROOT_LIBRARY_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND ${ROOT_CONFIG_EXECUTABLE} "--prefix" OUTPUT_VARIABLE ROOTSYS RESULT_VARIABLE RETVAR OUTPUT_STRIP_TRAILING_WHITESPACE) +# root-config --prefix helps to retrieve ROOTSYS env variable. +if(NOT IS_DIRECTORY ${ROOTSYS}) + message(FATAL_ERROR "ROOTSYS should be set before configuring roottest.") +endif() + + if(MSVC) set(CMAKE_SKIP_TEST_ALL_DEPENDENCY TRUE) set(CMAKE_SUPPRESS_REGENERATION TRUE) @@ -21,25 +47,17 @@ if(MSVC) set(WILLFAIL_ON_WIN32 WILLFAIL) endif() - # ROOT_BINDIR is set by ROOTConfig.cmake - set(ROOT_CONFIG_EXECUTABLE ${ROOT_BINDIR}/root-config.bat) - execute_process(COMMAND ${ROOT_CONFIG_EXECUTABLE} "--prefix" OUTPUT_VARIABLE ROOTSYS RESULT_VARIABLE RETVAR OUTPUT_STRIP_TRAILING_WHITESPACE) cmake_path(CONVERT "${ROOTSYS}" TO_CMAKE_PATH_LIST ROOTSYS) set(ROOTSYS ${ROOTSYS} CACHE INTERNAL "") - execute_process(COMMAND ${ROOT_CONFIG_EXECUTABLE} "--tutdir" OUTPUT_VARIABLE ROOT_TUTORIALS_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) cmake_path(CONVERT "${ROOT_TUTORIALS_DIR}" TO_CMAKE_PATH_LIST ROOT_TUTORIALS_DIR) - set(ROOT_root_CMD ${ROOTSYS}/bin/root.exe) - set(ROOT_hadd_CMD ${ROOTSYS}/bin/hadd.exe) - set(ROOT_genreflex_CMD ${ROOTSYS}/bin/genreflex.exe) - set(ROOT_rootcint_CMD ${ROOTSYS}/bin/rootcint.exe) - set(ROOT_rootcling_CMD ${ROOTSYS}/bin/rootcling.exe) + cmake_path(CONVERT "${ROOT_INCLUDE_DIRS}" TO_CMAKE_PATH_LIST ROOT_INCLUDE_DIRS) + cmake_path(CONVERT "${ROOT_LIBRARY_DIR}" TO_CMAKE_PATH_LIST ROOT_LIBRARY_DIR) if(CMAKE_GENERATOR MATCHES Ninja) set(ROOT_LIBRARIES Core RIO Net Hist Gpad Graf Tree Rint Matrix MathCore) else() set(ROOT_LIBRARIES libCore libRIO libNet libHist libGpad libGraf libTree libRint libMatrix libMathCore) endif() else() - # We can not use CMAKE_SHARED_LIBRARY_SUFFIX as on macos it uses the standard dylib rather than the .so set(libsuffix .so) set(grep_cmd grep) @@ -47,26 +65,9 @@ else() # only for non-Windows platforms set(OptionalMultiProc MultiProc) - # root-config --prefix helps to retrieve ROOTSYS env variable. - # ROOT_BINDIR is set by ROOTConfig.cmake - set(ROOT_CONFIG_EXECUTABLE ${ROOT_BINDIR}/root-config) - if(NOT EXISTS ${ROOT_CONFIG_EXECUTABLE}) - message(FATAL_ERROR "root-config was not found in ${ROOT_CONFIG_EXECUTABLE}.") - endif() - if(NOT IS_DIRECTORY ${ROOTSYS}) - message(FATAL_ERROR "ROOTSYS should be set before configuring roottest.") - endif() - execute_process(COMMAND ${ROOT_CONFIG_EXECUTABLE} "--tutdir" OUTPUT_VARIABLE ROOT_TUTORIALS_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) set(ROOT_LIBRARIES Core RIO Net Hist Gpad Tree Rint Matrix MathCore) - set(ROOT_root_CMD ${ROOTSYS}/bin/root.exe) - set(ROOT_hadd_CMD ${ROOTSYS}/bin/hadd) - set(ROOT_genreflex_CMD ${ROOTSYS}/bin/genreflex) - set(ROOT_rootcint_CMD ${ROOTSYS}/bin/rootcint) - set(ROOT_rootcling_CMD rootcling) endif() -get_filename_component(ROOT_LIBRARY_DIR "${ROOTSYS}/lib" ABSOLUTE) - set(ref_suffix ".ref") # Detect bitness. @@ -107,8 +108,8 @@ find_library(OPENGL_gl_LIBRARY NAMES GL) # Set global include dirs and library dirs for roottest. # These are picked up in the old-style dictionary generation and when standard CMake targets are created. -include_directories(${ROOTSYS}/include ${CMAKE_CURRENT_SOURCE_DIR}) -link_directories(${ROOTSYS}/lib) +include_directories(${ROOT_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}) +link_directories(${ROOT_LIBRARY_DIR}) set(CMAKE_MACOSX_RPATH TRUE) # use RPATH for MacOSX include(RoottestCTest) diff --git a/roottest/main/CMakeLists.txt b/roottest/main/CMakeLists.txt index ac9cadcc8e59b..e2272f4571d92 100644 --- a/roottest/main/CMakeLists.txt +++ b/roottest/main/CMakeLists.txt @@ -11,8 +11,8 @@ configure_file(RootcpReplaceEntireFileCheck.C . COPYONLY) # We should explicitly use the Python executable from the Python version that # was used to build ROOT. Otherwise, we risk picking up a different Python # version at test time. -set(PY_TOOLS_PREFIX ${Python3_EXECUTABLE} ${ROOTSYS}/bin) -set(TOOLS_PREFIX ${ROOTSYS}/bin) +set(PY_TOOLS_PREFIX ${Python3_EXECUTABLE} ${ROOT_BINDIR}) +set(TOOLS_PREFIX ${ROOT_BINDIR}) if(MSVC) set(pyext .py) diff --git a/roottest/python/JupyROOT/CMakeLists.txt b/roottest/python/JupyROOT/CMakeLists.txt index 07547c27328fb..828055119d733 100644 --- a/roottest/python/JupyROOT/CMakeLists.txt +++ b/roottest/python/JupyROOT/CMakeLists.txt @@ -4,7 +4,7 @@ if(NOT MSVC OR win_broken_tests) # Do not run with classic build or if tests are vetoed if (pyroot AND NOT ROOT_CLASSIC_BUILD) -set(MODULES_LOCATION ${ROOTSYS}/lib/ROOT/_jupyroot/helpers) +set(MODULES_LOCATION ${ROOT_LIBRARY_DIR}/ROOT/_jupyroot/helpers) set(NBDIFFUTIL ${CMAKE_CURRENT_SOURCE_DIR}/nbdiff.py ) set(DOCTEST_LAUNCHER ${CMAKE_CURRENT_SOURCE_DIR}/doctest_launcher.py) diff --git a/roottest/root/multicore/CMakeLists.txt b/roottest/root/multicore/CMakeLists.txt index 1423f4813b77a..7a9d28c2c17cd 100644 --- a/roottest/root/multicore/CMakeLists.txt +++ b/roottest/root/multicore/CMakeLists.txt @@ -55,7 +55,7 @@ if(NOT MSVC AND NOT dev) if(xrootd) ROOTTEST_GENERATE_EXECUTABLE(processExecutorH1Test tProcessExecutorH1Test.cpp - COMPILE_FLAGS "-I${ROOTSYS}/tutorials/legacy/multicore" + COMPILE_FLAGS "-I${ROOT_TUTORIALS_DIR}/legacy/multicore" LIBRARIES ROOT::MultiProc ROOT::Core ROOT::Net ROOT::TreePlayer ROOT::Tree ROOT::RIO ROOT::Hist ROOT::Gpad ROOT::Graf FIXTURES_SETUP root-multicore-processExecutorH1Test-fixture) diff --git a/roottest/scripts/run_roottest.sh b/roottest/scripts/run_roottest.sh deleted file mode 100755 index 9dbd43d62f49d..0000000000000 --- a/roottest/scripts/run_roottest.sh +++ /dev/null @@ -1,392 +0,0 @@ -#!/bin/sh - -Setup=yes -Cleanup=no -configname="" -while test "x$1" != "x"; do - case $1 in - "-v" ) verbose=x; shift ;; - "-h" ) help=x; shift;; - "-cintdlls") cintdlls=x; shift;; - "-mail") mail=x; shift; mailto=$1; shift;; - "--config") shift; configname=-$1; shift;; - --cleanup) Cleanup=yes shift;; - *) help=x; shift;; - esac -done - -if test "x$help" != "x"; then - echo "$0 [options]" - echo "Option:" - echo " -v : verbose" - echo " -cintdlls : also built the cintdlls" - echo " -config configname" - echo " --cleanup : if set, this will terminate any unfinished run " - exit -fi - -if [ "x$verbose" = "xx" ] ; then - set -x -fi - -host=`hostname -s` -dir=`dirname $0` - -config_filename=$dir/run_roottest.$host$configname.config -sid_filename=run_roottest.$host$configname.sid - -if [ $Cleanup = "yes" ] ; then - echo "Checking for previous run." - current_sid=`ps h -o sid --pid $$` - - if [ -e $sid_filename ] ; then - prev_sid=`cat $sid_filename ` - inclusions=" -e root.exe -e run_roottest -e make -e cint " - exclusions=" -e $$ -e grep " - # Need to go through a file so that we don't see the temporary sub-shell in the list of files - ps -s $prev_sid h -o pid,command > /var/tmp/run_roottest.tmp.$$ - old_pids=`cat /var/tmp/run_roottest.tmp.$$ | grep -v $exclusions | grep $inclusions | cut -d' ' -f1 | tr '\n' ' ' ` - rm /var/tmp/run_roottest.tmp.$$ - if [ x"$old_pids" != x ] ; then - echo "The previous run_roottest for id $id is still running. We will terminate it to start a new one." -# ps -s $prev_sid h -o pid,command - kill -9 $old_pids - fi - fi - echo $current_sid > $sid_filename -# echo Current pids: -# ps -s $current_sid h -o pid,command -fi - -# No sub-process should ever used up more than one hour of CPU time. -ulimit -t 3600 - -MAKE=gmake -#MAKE=echo -ROOT_MAKEFLAGS= -ROOTTEST_MAKEFLAGS= -CONFIGURE_OPTION="--enable-roofit --enable-tmva " - -ROOTMARKS=n/a -FITROOTMARKS=n/a - -SHOW_TOP=yes -UPLOAD_HOST=flxi01.fnal.gov -UPLOAD_LOCATION=/afs/.fnal.gov/files/expwww/root/html/roottest/ -UPLOAD_SYNC="ssh -x flxi01.fnal.gov bin/flush_webarea" -SVN_HOST=http://root.cern.ch -SVN_BRANCH=trunk -GIT_HOST=http://root.cern.ch -GIT_BRANCH=master -unset ROOTSYS - -# The config is expected to set ROOTLOC, -# ROOTTESTLOC and any of the customization -# above (MAKE, etc.) -# and the method to acquire the `load` -. $config_filename - -if [ "$SVN_BRANCH" != "trunk" ] ; then - GIT_BRANCH=`basename $SVN_BRANCH` -fi - -if [ -z $ROOTSYS ] ; then - export ROOTSYS=${ROOTLOC} - export PATH=${ROOTSYS}/bin:${PATH} - if [ -z ${LD_LIBRARY_PATH} ] ; then - export LD_LIBRARY_PATH=${ROOTSYS}/lib:. - else - export LD_LIBRARY_PATH=${ROOTSYS}/lib:${LD_LIBRARY_PATH}:. - fi - export PYTHONPATH=${ROOTSYS}/lib -fi - -mkdir -p $ROOTLOC -cd $ROOTLOC - -export ROOTBUILD=opt - -echo "Running the nightly test on $host$configname from $ROOTLOC" -export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:. -export PATH - -#echo The path is $PATH -#echo The library path is $LD_LIBRARY_PATH - -upload_sync() { - if [ "x$UPLOAD_SYNC" != "x" ] ; then - eval $UPLOAD_SYNC > uploadsync.log 2>&1 - fi -} - -error_handling() { - cd $ROOTSYS - write_summary - upload_log summary.log - - echo "Found an error on \"$host$configname\" ("`uname`") in $ROOTLOC" - echo "Error: $2" - echo "See full log file at http://www-root.fnal.gov/roottest/summary.shtml" - - if [ "x$mail" = "xx" ] ; then - mail -s "root $OSNAME test on `date +"%F"` " $mailto < scp.$target_name.log 2>&1 - scp -o ConnectTimeout=30 -v $1 $UPLOAD_HOST:$UPLOAD_LOCATION/root-today/$target_name >> scp.$target_name.log 2>&1 - scp_result=$? - if test $scp_result != 0; then - cat scp.$target_name.log - fi -} - -upload_datafile() { - if test "x$1" = "x--untar" ; then - untar=yes - shift - fi - if test -e $1 ; then - target_name=$host$configname.`basename $1` - scp $1 $UPLOAD_HOST:$UPLOAD_LOCATION/root-today/$target_name > scp.data.log 2>&1 - scp_result=$? - if test $scp_result != 0; then - cat scp.data.log - else - if test "x$untar" = "xyes" ; then - untar_name=$host$configname.data - echo "pass 1: " > untar.log - ssh -v $UPLOAD_HOST "cd $UPLOAD_LOCATION/root-today; " >> untar.log 2>&1 - echo "pass 2: " >> untar.log - ssh -v $UPLOAD_HOST "cd $UPLOAD_LOCATION/root-today; mkdir -p $untar_name; " >> untar.log 2>&1 - echo "pass 3: " >> untar.log - ssh -v $UPLOAD_HOST "cd $UPLOAD_LOCATION/root-today; mkdir -p $untar_name; cd $untar_name " >> untar.log 2>&1 - echo "pass 4: " >> untar.log - ssh -v $UPLOAD_HOST "cd $UPLOAD_LOCATION/root-today; mkdir -p $untar_name; cd $untar_name ; tar xfz ../$target_name" >> untar.log 2>&1 - untar_result=$? - if test $untar_result != 0; then - cat untar.log - fi - fi - fi - fi -} - -one_anchor() { - echo "$2" -} - -one_line() { - ref=$1 - status=$2 - extra=$3 - - sline="" - nline="" - fline="" - rline="" - - if test "x$status" = "x$success"; then - line="$sline $status $extra $rline" - elif test "x$status" = "x$na"; then - line="$nline $status $extra $rline" - else - line="$fline $status $extra $rline" - fi - echo $line -} - -write_summary() { - lline="" - rline="" - osline="$lline $OSNAME$configname $rline" - cvsline=`one_line cvsupdate.log.$host$configname $cvsstatus` - gmakeline=`one_line gmake.log.$host$configname $mainstatus` - testline=`one_line test_gmake.log.$host$configname $teststatus` - stressline=`one_line speedresult.log.$host$configname $teststatus` - roottestline=`one_line roottest_gmake.log.$host$configname $rootteststatus` -if [ -e $ROOTTESTLOC/perftrack.tar.gz ] ; then - extra="`one_anchor $host$configname.data "Performance Tracking"`" - roottimingline="`one_line $host$configname.roottesttiming.root $rootteststatus "$extra" `" -else - roottimingline=`one_line $host$configname.roottesttiming.root $rootteststatus` -fi - logsbundleline=`one_line $host$configname.logs.tar.gz $rootteststatus` - - date=`date +"%b %d %Y"` - dateline="$lline $date $rline" - - echo $osline > $ROOTSYS/summary.log - echo $cvsline >> $ROOTSYS/summary.log - echo $gmakeline >> $ROOTSYS/summary.log - echo $testline >> $ROOTSYS/summary.log - echo $stressline >> $ROOTSYS/summary.log - echo $roottestline >> $ROOTSYS/summary.log - echo $roottimingline >> $ROOTSYS/summary.log - echo $logsbundleline >> $ROOTSYS/summary.log - echo $dateline >> $ROOTSYS/summary.log -} - -na="N/A" -success="Ok." -failure="Failed" -cvsstatus=$na -mainstatus=$na -teststatus=$na -rootteststatus=$na - -if [ -e $ROOTSYS/.git ] ; then - cd $ROOTSYS - git branch > cvsupdate.log 2>&1 - git pull >> cvsupdate.log 2>&1 - result=$? -else - dname=`dirname $ROOTSYS` - cd $dname - rm -rf $ROOTSYS > cvsupdate.log - git clone $GIT_HOST/git/root.git $ROOTSYS >> cvsupdate.log 2>&1 - result=$? - if test $result != 0; then - cvsstatus=$failure - error_handling $result "Unable to clone the source git repository!" - fi - mv cvsupdate.log $ROOTSYS - cd $ROOTSYS - git checkout $GIT_BRANCH >> cvsupdate.log 2>&1 -fi -#mkdir -p $ROOTSYS -#cd $ROOTSYS/.. -#locname=`basename $ROOTSYS` -#svn co $SVN_HOST/svn/root/$SVN_BRANCH $locname > $locname/cvsupdate.log 2>&1 -#result=$? - -if test $result != 0; then - cvsstatus=$failure -else - cvsstatus=$success -fi - -cd $ROOTSYS -upload_log cvsupdate.log - -if test ! -e config.status ; then - ./configure $CONFIGURE_OPTION > configure.log 2>&1 -else - ./configure `cat config.status` > configure.log 2>&1 -fi -result=$? -if test $result != 0; then - mainstatus=$failure - error_handling $result "ROOT's configure failed! See log file at $ROOTSYS/configure.log" -fi - -$MAKE $ROOT_MAKEFLAGS > gmake.log 2>&1 -result=$? -upload_log gmake.log -if test $result != 0; then - mainstatus=$failure - error_handling $result "ROOT's gmake failed! See log file at $ROOTSYS/gmake.log" -fi -mainstatus=$success - -if [ "x$cintdlls" = "xx" ] ; then - gmake cintdlls >> gmake.log 2>&1 -fi - -$MAKE map >> gmake.log 2>&1 - -upload_log gmake.log - -cd test; $MAKE distclean > gmake.log -$MAKE >> gmake.log 2>&1 -result=$? - -upload_log gmake.log test_ -if test $result != 0; then - teststatus=$failure - error_handling $result "ROOT's test gmake failed! See log file at $ROOTSYS/test/gmake.log" -fi -teststatus=$success - -echo >> speedresult.log -date >> speedresult.log -echo Expected rootmarks: $ROOTMARKS | tee -a speedresult.log -./stress -b 30 | tail -4 | grep -v '\*\*\*' | tee -a speedresult.log -./stress -b 30 | tail -4 | grep -v '\*\*\*' | tee -a speedresult.log -echo -if test "x$SHOW_TOP" = "xyes"; then - top n 1 b | head -14 | tail -11 | tee -a speedresult.log -fi -if test "x$$IDLE_COMMAND" != "x"; then - idle=`eval $IDLE_COMMAND` - echo "idle value: $idle" | tee -a speedresult.log -fi -echo -echo Expected fit rootmarks: $FITROOTMARKS -./stressFit | tail -5 | grep -v '\*\*\*' | grep -v 'Time at the' | tee -a speedresult.log -./stressFit | tail -5 | grep -v '\*\*\*' | grep -v 'Time at the' | tee -a speedresult.log -echo - -upload_log speedresult.log - -echo Going to roottest at: $ROOTTESTLOC - -mkdir -p $ROOTTESTLOC -cd $ROOTTESTLOC/.. -locname=`basename $ROOTTESTLOC` -if [ -e $locname/.git ] ; then - cd $ROOTTESTLOC - git branch > gmake.log 2>&1 - git pull >> gmake.log 2>&1 -else - git clone $GIT_HOST/git/roottest.git $locname > roottest_gmake.log 2>&1 - result=$? - if test $result != 0; then - upload_log roottest_gmake.log - error_handling $result "Cloning the roottest repository failed" - fi - mv roottest_gmake.log $locname/gmake.log - cd $ROOTTESTLOC - git checkout $GIT_BRANCH >> gmake.log 2>&1 -fi -# svn co $SVN_HOST/svn/roottest/$SVN_BRANCH $locname > $locname/gmake.log 2>&1 - -mv gmake.log gmake.keep -$MAKE clean >> gmake.keep 2>&1 -mv gmake.keep gmake.log -$MAKE -k $ROOTTEST_MAKEFLAGS >> gmake.log 2>&1 -result=$? -upload_log gmake.log roottest_ - -$MAKE logs.tar.gz >> gmake.log 2>&1 -if [ `echo $ROOTTEST_MAKEFLAGS | grep -c perftrack` != 0 ] ; then - $MAKE perftrack.tar.gz >> gmake.log 2>&1 -fi - -upload_datafile roottesttiming.root -upload_datafile logs.tar.gz -upload_datafile --untar perftrack.tar.gz - -grep FAIL $PWD/gmake.log -tail $PWD/gmake.log - -if test $result != 0; then - rootteststatus=$failure - error_handling $result "roottest's gmake failed! See log file at $PWD/gmake.log" -fi -rootteststatus=$success - - -cd $ROOTSYS -write_summary -upload_log summary.log - -upload_sync