diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index 9af5ed8a12229..53ceffd1e4d9a 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -9,9 +9,25 @@ set(ROOT_root_CMD $) set(pythonpaths ${localruntimedir} $ENV{PYTHONPATH}) cmake_path(CONVERT "${pythonpaths}" TO_NATIVE_PATH_LIST pythonpaths_native) -set(root_includepaths ${CMAKE_BINARY_DIR}/tutorials/io/tree ${DEFAULT_ROOT_INCLUDE_PATH}) +set(root_includepaths + ${CMAKE_BINARY_DIR}/tutorials/io/tree + # Some SOFIE tutorials include headers with code generated by other + # tutorials, which ends up in runtutorials/ + ${CMAKE_BINARY_DIR}/runtutorials + ${DEFAULT_ROOT_INCLUDE_PATH} +) cmake_path(CONVERT "${root_includepaths}" TO_NATIVE_PATH_LIST root_includepaths_native) +# The environment argument gets serialized in ROOT_ADD_TEST for the +# RootTestDriver, and then deserialized in the latter with multiple steps of +# string parsing. We have to escape the semicolon excessively, because in every +# parsing step we lose one semicolon. Also we use the SEMICOLON generator +# expression, so at least we don't have to worry about escaping for the initial +# configuration stage. +# TODO: consider improving ROOT_ADD_TEST and RootTestDriver.cmake so this is not necessary. +string(REPLACE ";" "\\\\\\\\$" pythonpaths_escaped "${pythonpaths_native}") +string(REPLACE ";" "\\\\\\\\$" root_includepaths_escaped "${root_includepaths_native}") + # - Set the environment for the tutorials, which also contains some environment # variables related to limiting the number of threads used by NumPy and # enabling batch mode. @@ -22,9 +38,9 @@ set(TUTORIAL_ENV MPLBACKEND=AGG OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 - PYTHONPATH=${pythonpaths_native} + PYTHONPATH=${pythonpaths_escaped} ROOT_BATCH=1 - ROOT_INCLUDE_PATH=${root_includepaths_native} + ROOT_INCLUDE_PATH=${root_includepaths_escaped} ) #---Copy the CTestCustom.cmake file into the build directory-------- diff --git a/tutorials/machine_learning/TMVA_SOFIE_GNN_Application.C b/tutorials/machine_learning/TMVA_SOFIE_GNN_Application.C index 31255ec63d548..5684253fe457d 100644 --- a/tutorials/machine_learning/TMVA_SOFIE_GNN_Application.C +++ b/tutorials/machine_learning/TMVA_SOFIE_GNN_Application.C @@ -8,7 +8,6 @@ // need to add include path to find generated model file #ifdef __CLING__ R__ADD_INCLUDE_PATH($PWD) -R__ADD_INCLUDE_PATH($ROOTSYS/runtutorials) #endif #include "encoder.hxx" diff --git a/tutorials/machine_learning/TMVA_SOFIE_RDataFrame.C b/tutorials/machine_learning/TMVA_SOFIE_RDataFrame.C index 4f6a731c22966..2292327cf26f5 100644 --- a/tutorials/machine_learning/TMVA_SOFIE_RDataFrame.C +++ b/tutorials/machine_learning/TMVA_SOFIE_RDataFrame.C @@ -25,7 +25,6 @@ using namespace TMVA::Experimental; // need to add the current directory (from where we are running this macro) // to the include path for Cling R__ADD_INCLUDE_PATH($PWD) -R__ADD_INCLUDE_PATH($ROOTSYS/runtutorials) #include "Higgs_trained_model.hxx" #include "TMVA/SOFIEHelpers.hxx"