forked from star-bnl/star-prop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.star-base-centos7
61 lines (53 loc) · 2.24 KB
/
Dockerfile.star-base-centos7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM centos:7.4.1708
ARG STAR_BUILD_32BIT
# Set preferred pkg-config search paths for 32-bit libs
ENV PKG_CONFIG_PATH=${STAR_BUILD_32BIT:+"/usr/share/pkgconfig:/usr/lib/pkgconfig"}
ENV SUFFIX_BUILD_32BIT=${STAR_BUILD_32BIT:+"-m32"}
ENV ROOT_BUILD_32BIT=${STAR_BUILD_32BIT:+"-Dbuild_32bit=ON"}
WORKDIR /tmp
# Install system packages
COPY docker/packages.centos${SUFFIX_BUILD_32BIT} /tmp/packages
RUN yum update -q -y \
&& yum install -y epel-release \
&& yum install -y $(<packages) \
&& yum clean all \
&& rm -rf /tmp/*
# Install extra python modules used by the STAR software
RUN pip install pyparsing && pip3 install requests
# Make CMake3 default
RUN alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake 10 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake \
--family cmake
RUN alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \
--slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \
--slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \
--slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
--family cmake
# Install ROOT5
COPY patches/root_v5.34.38${SUFFIX_BUILD_32BIT}.patch /tmp/root_v5.34.38.patch
RUN curl https://root.cern.ch/download/root_v5.34.38.source.tar.gz | tar -xz -C /tmp \
&& mv /tmp/root /tmp/root-5-34-38 && cd /tmp/root-5-34-38 \
&& patch -p1 < /tmp/root_v5.34.38.patch \
&& mkdir /tmp/root-build && cd /tmp/root-build \
&& cmake /tmp/root-5-34-38 \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-Drpath=ON \
-Dtable=ON \
-Dpythia6=ON \
-Dpythia6_nolink=ON \
-Dvc=ON \
-Dkrb5=OFF \
${ROOT_BUILD_32BIT} \
&& make -j $(nproc) \
&& make install \
&& rm -fr /tmp/*
# Install CERNLIB
COPY patches/cernlib_2006${SUFFIX_BUILD_32BIT}.patch scripts/build_cernlib.sh scripts/gdrive.py /tmp/
RUN mkdir /cern && cd /cern \
&& (curl -s -f https://cernlib.web.cern.ch/cernlib/download/2006_source/tar/2006_src.tar.gz || \
python3 /tmp/gdrive.py 10eu5fwq_jDMrl0ludu2keQwamBam0dc7) | tar -xz -C /cern \
&& patch -p0 < /tmp/cernlib_2006${SUFFIX_BUILD_32BIT}.patch \
&& /tmp/build_cernlib.sh \
&& rm -fr /cern/2006/src /cern/2006/log /cern/2006/build /tmp/*