Gcc 7.3.1 not available when generating a C++17 Singularity ROOT image


ROOT Version: 6.14.08
_Platform: CentOS 7
Compiler: g++


Dear experts,
I have run into a problem when trying to build root on CentOS 7. I have installed devtoolset-7-gcc* and enabled it via scl enable devtoolset-7 bash. Furthermore I have chosen the option -Dcxx17 for cmake and turned off the option -Dcxx11. In my Singularity recipe, i am running the command scl enable devtoolset-7 bash but it does not provide singularity with a new cpp compiler, so cmake cannot find it. When i run the generated image, the command does work and gcc 7.3.1 becomes available. Has anyone else experienced this problem?
Any help is greatly appreciated!

I figured it out eventually. Instead of writing scl enable devtoolset-7 bash. one has to do

set -e
yum update -y scl-utils
source scl_source enable devtoolset-7 || true

before compiling ROOT. scl_source does not return zero after successful execution for some strange reason, this is why the || true and set -e needs to be added to the recipe. See https://github.com/sclorg/sclo-ci-tests/commit/1e0783bc6c57f7d13955358c5c6c0a016029c191

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.