ROOT Version: 6.24/00
Platform: CentOS Linux 7 Docker image
Compiler: gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Python Version: CPython 3.8.10
Hi. I’m trying to build a Docker image that has ROOT installed in a CentOS 7 based environment. For reasons I’ll skip here, I need a containerized modern version of ROOT on a HPC cluster that has strict upper limits on the version of glibc
that is can support. I would normally just build from the centos:8
image series, but the glibc
requirements are motivating me to build on centos:7
(I also need CPython v3.7+ which I built from source to shoehorn it onto CentOS 7 hence the different base image).
To make reporting as easy as possible I’ve created a public GitLab repo here Matthew Carl Feickert / root-centos7-debug which contains all of the following files and CI to demonstrate a minimal failing example.
If I follow the CentOS dependency installation guide on the ROOT website (here in packages.txt
just throwing in even things not needed for this build to make sure that for a minimal failing example I’m not missing anything) and attempt to build ROOT v6.24.00
from source with CXX14
(given that CentOS 7 seems capped below CXX17
) I get the following build failure
[ 76%] Generating G__ROOTVecOps.cxx, ../../lib/ROOTVecOps.pcm
In file included from input_line_10:3:
In file included from /code/build/include/ROOT/RCanvas.hxx:12:
In file included from /code/build/include/ROOT/RPadBase.hxx:12:
In file included from /code/build/include/ROOT/RDrawable.hxx:16:
/code/build/include/ROOT/RAttrMap.hxx:193:4: error: 'auto' return without trailing return type; deduced return types are a C++14 extension
auto begin() const { return m.begin(); }
^
/code/build/include/ROOT/RAttrMap.hxx:194:4: error: 'auto' return without trailing return type; deduced return types are a C++14 extension
auto end() const { return m.end(); }
^
...
Can people advise how to attempt to resolve this?
All files used are linked above, but I’ll also reproduce the Dockerfile
and additional files below
# packages.txt
git
gcc
gcc-c++
make
binutils
libX11-devel
libXpm-devel
libXft-devel
libXext-devel
openssl-devel
gcc-gfortran
readline-devel
cmake3
redhat-lsb-core
gcc-gfortran
pcre-devel
mesa-libGL-devel
mesa-libGLU-devel
glew-devel
ftgl-devel
fftw-devel
cfitsio-devel
libuuid-devel
avahi-compat-libdns_sd-devel
openldap-devel
libxml2-devel
gsl-devel
# requirements.txt
numpy~=1.20
Pygments~=2.9
PyYAML~=5.4
# Dockerfile
ARG BUILDER_IMAGE=neubauergroup/centos-python3:3.8.10
FROM ${BUILDER_IMAGE} as builder
USER root
WORKDIR /
SHELL [ "/bin/bash", "-c" ]
ARG TARGET_BRANCH=v6-24-00
ARG GIT_PROJECT_URL=https://github.com/root-project/root
# c.f. https://root.cern/install/build_from_source/#all-build-options
# gcc v4.8.5 is too old to use CXX17, so use CXX14
# Need epel-release to be installed first so that cmake3 is available
COPY packages.txt /tmp/packages.txt
COPY requirements.txt /tmp/requirements.txt
RUN yum update -y && \
yum install -y epel-release && \
yum install -y $(cat /tmp/packages.txt) && \
yum clean all && \
yum autoremove -y && \
ln --symbolic $(command -v cmake3) /usr/bin/cmake && \
python -m pip --no-cache-dir install --upgrade pip setuptools wheel && \
python -m pip --no-cache-dir install --requirement /tmp/requirements.txt && \
python -m pip list && \
mkdir /code && \
cd /code && \
git clone --depth 1 "${GIT_PROJECT_URL}" \
--branch "${TARGET_BRANCH}" \
--single-branch \
root_src && \
cmake \
-Dall=OFF \
-Dsoversion=ON \
-Dgsl_shared=ON \
-DCMAKE_CXX_STANDARD=14 \
-Droot7=ON \
-Dfortran=ON \
-Droofit=ON \
-Droostats=ON \
-Dhistfactory=ON \
-Dminuit2=ON \
-Dbuiltin_xrootd=ON \
-Dxrootd=ON \
-Dpyroot=ON \
-DPYTHON_EXECUTABLE=$(command -v python3) \
-DCMAKE_INSTALL_PREFIX=/usr/local/root-cern \
-S root_src \
-B build && \
cmake build -L && \
cmake --build build -- -j$(($(nproc) - 1)) && \
cmake --build build --target install && \
cd / && \
rm -rf /code
ENV PYTHONPATH=/usr/local/root-cern/lib:$PYTHONPATH
ENV LD_LIBRARY_PATH=/usr/local/root-cern/lib:$LD_LIBRARY_PATH
ENV ROOTSYS=/usr/local/root-cern
ENV PATH="${PATH}:${ROOTSYS}/bin"
WORKDIR /home/data
ENV HOME /home
ENTRYPOINT ["/bin/bash", "-l", "-c"]
CMD ["/bin/bash"]