root-project / root

The official repository for ROOT: analyzing, storing and visualizing big data, scientifically
https://root.cern
Other
2.54k stars 1.23k forks source link

ROOT.gSystem.GetIncludePath() adds extra locations on ARM64 #9243

Open peremato opened 2 years ago

peremato commented 2 years ago

Describe the bug

With ROOT 6.24/06 on aarch64 we get additional locations for include files with TSystem::GetIncludePath() pointing to directories exiting only in the node where the build was done. The problem is that ACliC uses these locations in the invocation of the compiler and fails because they do not exists or wrong protections at the runtime.

-I$ROOTSYS/include
-I"/cvmfs/sft.cern.ch/lcg/views/LCG_101arm/aarch64-centos7-gcc8-opt/include/Geant4"
-I"/cvmfs/sft.cern.ch/lcg/views/LCG_101arm/aarch64-centos7-gcc8-opt/include"
-I"/cvmfs/sft.cern.ch/lcg/releases/Python/3.9.6-b0f98/aarch64-centos7-gcc8-opt/include/python3.9"
-I"/cvmfs/sft.cern.ch/lcg/releases/ROOT/6.24.06-f0308/aarch64-centos7-gcc8-opt/etc/"
-I"/cvmfs/sft.cern.ch/lcg/releases/ROOT/6.24.06-f0308/aarch64-centos7-gcc8-opt/etc//cling"
-I"/cvmfs/sft.cern.ch/lcg/releases/ROOT/6.24.06-f0308/aarch64-centos7-gcc8-opt/include/"
-I"/cvmfs/sft.cern.ch/lcg/releases/Python/3.9.6-b0f98/aarch64-centos7-gcc8-opt/include"
-I"/home/sftnight/build/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT-6.24.06-build/include"
-I"/data/sftnight/build/workspace/lcg_release_pipeline/install/Vc/1.4.2/aarch64-centos7-gcc8-opt/include"
-I"/data/sftnight/build/workspace/lcg_release_pipeline/install/zlib/1.2.11/aarch64-centos7-gcc8-opt/include"
-I"/data/sftnight/build/workspace/lcg_release_pipeline/install/jsonmcpp/3.9.1/aarch64-centos7-gcc8-opt/include"
-I"/home/sftnight/build/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT-6.24.06-build/include/"
-I"/data/sftnight/build/workspace/lcg_release_pipeline/install/tbb/2020_U2/aarch64-centos7-gcc8-opt/include"'

The first three elements are directly the contents of $ROOT_INCLUDE_PATH which in the that setup, which is

$ echo $ROOT_INCLUDE_PATH
/cvmfs/sft.cern.ch/lcg/views/LCG_101arm/aarch64-centos7-gcc8-opt/include/Geant4:/cvmfs/sft.cern.ch/lcg/views/LCG_101arm/aarch64-centos7-gcc8-opt/include:/cvmfs/sft.cern.ch/lcg/releases/Python/3.9.6-b0f98/aarch64-centos7-gcc8-opt/include/python3.9

To Reproduce

On an ARM64 system with CVMFS

$ source /cvmfs/sft.cern.ch/lcg/views/LCG_101arm/aarch64-centos7-gcc8-opt/setup.sh
$ python -c 'import ROOT; print(ROOT.gSystem.GetIncludePath())'

Expected behavior

On a Centos7 system (e.g. lxplus.cern.ch), then list is different.

-I$ROOTSYS/include
-I"/cvmfs/sft.cern.ch/lcg/views/LCG_101/x86_64-centos7-gcc8-opt/include/Geant4"
-I"/cvmfs/sft.cern.ch/lcg/releases/jsonmcpp/3.9.1-72770/x86_64-centos7-gcc8-opt/include"
-I"/cvmfs/sft.cern.ch/lcg/views/LCG_101/x86_64-centos7-gcc8-opt/src/cpp"
-I"/cvmfs/sft.cern.ch/lcg/views/LCG_101/x86_64-centos7-gcc8-opt/include"
-I"/cvmfs/sft.cern.ch/lcg/releases/Python/3.9.6-b0f98/x86_64-centos7-gcc8-opt/include/python3.9"
-I"/cvmfs/sft.cern.ch/lcg/releases/R/3.6.3-dfb24/x86_64-centos7-gcc8-opt/lib64/R/include"
-I"/cvmfs/sft.cern.ch/lcg/releases/R/3.6.3-dfb24/x86_64-centos7-gcc8-opt/lib64/R/library/RInside/include"
-I"/cvmfs/sft.cern.ch/lcg/releases/R/3.6.3-dfb24/x86_64-centos7-gcc8-opt/lib64/R/library/Rcpp/include"
-I"/cvmfs/sft.cern.ch/lcg/releases/ROOT/6.24.06-3455f/x86_64-centos7-gcc8-opt/etc/"
-I"/cvmfs/sft.cern.ch/lcg/releases/ROOT/6.24.06-3455f/x86_64-centos7-gcc8-opt/etc//cling"
-I"/cvmfs/sft.cern.ch/lcg/releases/ROOT/6.24.06-3455f/x86_64-centos7-gcc8-opt/include/"
-I"/cvmfs/sft.cern.ch/lcg/releases/Python/3.9.6-b0f98/x86_64-centos7-gcc8-opt/include"

Again the first 8 elements are directly related to $ROOT_INCLUDE_PATH.

peremato commented 2 years ago

The JIRA ticket in SPI is https://sft.its.cern.ch/jira/browse/SPI-2021

JGCarroll commented 2 years ago

I've had similar issues with the Snap build, where ACliC remembers its build environment which doesn't exist in the runtime environment. As a remedy I've taken to patching root/build/unix/compiledata.sh, adding a segment which runs sed and clears up the unwanted extra include directories. Maybe something similar could work in your use case as a workaround.

Example here

peremato commented 2 years ago

compiledata.sh is not installed. The only one installed is compiledata.h and this one has no reference to the build directories. It uses relative to $ROOTSYS

#define INCLUDEPATH "-I$ROOTSYS/include"