Dockerfile 6.46 KB
Newer Older
David Blyth's avatar
David Blyth committed
1 2 3
# Author: David Blyth
# Description: Docker build for producing a base for ANL EIC software efforts

David Blyth's avatar
David Blyth committed
4
FROM dbcooper/arch:2018-02-23
David Blyth's avatar
David Blyth committed
5 6 7 8 9

ARG BUILD_THREADS=5

# Set up basic environment
RUN pacman -S --noconfirm \
10 11
        sed \
        sudo \
David Blyth's avatar
David Blyth committed
12 13
&&  rm -rf /var/cache/pacman/pkg

14
RUN useradd -m -G wheel eicuser \
15
&&  sed -i.bak 's/\s*#\s*\(%wheel\s*ALL=(ALL)\s*NOPASSWD:\s*ALL\)/\1/' /etc/sudoers
David Blyth's avatar
David Blyth committed
16

17 18
USER eicuser
WORKDIR /home/eicuser
David Blyth's avatar
David Blyth committed
19 20 21 22

CMD /bin/bash

# ROOT
23 24 25
ENV ROOT_RELEASE=v6-12-06 \
    CC=/usr/bin/clang \
    CXX=/usr/bin/clang++
26

David Blyth's avatar
David Blyth committed
27 28 29
RUN sudo pacman -S --noconfirm \
        awk \
        binutils \
30
        clang \
David Blyth's avatar
David Blyth committed
31 32
        cmake \
        fftw \
33
        git \
David Blyth's avatar
David Blyth committed
34 35 36 37 38 39 40 41 42 43 44 45
        glew \
        glu \
        grep \
        gsl \
        gzip \
        libx11 \
        libxft \
        libxpm \
        make \
        python2 \
&&  sudo rm -rf /var/cache/pacman/pkg

46
RUN git clone http://root.cern.ch/git/root.git \
David Blyth's avatar
David Blyth committed
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
&&  cd root \
&&  git checkout tags/$ROOT_RELEASE \
&&  cd .. \
&&  mkdir build \
&&  cd build \
&&  cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DCMAKE_BUILD_TYPE=Release \
        -Dbuiltin_glew=OFF \
        -Dgdml=ON \
        -Dgsl_shared=ON \
        -Dmathmore=ON \
        -Dminuit2=ON \
        -Dopengl=ON \
        ../root \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd .. \
&&  rm -rf build root

ENV PATH=/usr/local/bin:${PATH} \
    LD_LIBRARY_PATH=/usr/local/lib \
    PYTHONPATH=/usr/local/lib \
    ROOTSYS=/usr/local \
71
    MANPATH=/usr/local/man
David Blyth's avatar
David Blyth committed
72 73 74 75 76 77 78 79 80

# CLHEP
ENV CLHEP_RELEASE=CLHEP_2_3_4_5

RUN git clone https://gitlab.cern.ch/CLHEP/CLHEP.git \
&&  cd CLHEP \
&&  git checkout tags/$CLHEP_RELEASE \
&&  mkdir build \
&&  cd build \
81
&&  cmake \
David Blyth's avatar
David Blyth committed
82 83 84 85 86 87 88 89 90
        -DCMAKE_INSTALL_PREFIX=/usr/local/ \
        -DCMAKE_BUILD_TYPE=Release \
        ../ \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../../ \
&&  rm -rf CLHEP

# GEANT4
David Blyth's avatar
David Blyth committed
91
ENV GEANT4_VERSION=10.4.1
David Blyth's avatar
David Blyth committed
92 93 94 95 96 97 98

RUN sudo pacman -S --noconfirm \
        xerces-c \
&&  sudo rm -rf /var/cache/pacman/pkg

RUN git clone https://github.com/Geant4/geant4.git \
&&  cd geant4 \
99
&&  git checkout tags/v$GEANT4_VERSION \
David Blyth's avatar
David Blyth committed
100 101 102 103 104
&&  mkdir build \
&&  cd build \
&&  cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local/ \
        -DCMAKE_BUILD_TYPE=Release \
105
        -DGEANT4_BUILD_MULTITHREADED=ON \
106
        -DGEANT4_BUILD_TLS_MODEL=global-dynamic \
David Blyth's avatar
David Blyth committed
107 108 109 110 111 112 113 114 115 116
        -DGEANT4_INSTALL_DATA=ON \
        -DGEANT4_USE_GDML=ON \
        -DGEANT4_USE_SYSTEM_CLHEP=ON \
        ../ \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../../ \
&&  rm -rf geant4

ENV LD_LIBRARY_PATH=/usr/local/lib64:${LD_LIBRARY_PATH} \
117
    GEANT4_DATA_DIRECTORY=/usr/local/share/Geant4-${GEANT4_VERSION}/data
David Blyth's avatar
David Blyth committed
118
ENV G4NEUTRONHPDATA=${GEANT4_DATA_DIRECTORY}/G4NDL4.5 \
119 120 121
    G4LEDATA=${GEANT4_DATA_DIRECTORY}/G4EMLOW7.3 \
    G4LEVELGAMMADATA=${GEANT4_DATA_DIRECTORY}/PhotonEvaporation5.2 \
    G4RADIOACTIVEDATA=${GEANT4_DATA_DIRECTORY}/RadioactiveDecay5.2 \
David Blyth's avatar
David Blyth committed
122 123
    G4NEUTRONXSDATA=${GEANT4_DATA_DIRECTORY}/G4NEUTRONXS1.4 \
    G4PIIDATA=${GEANT4_DATA_DIRECTORY}/G4PII1.3 \
124
    G4REALSURFACEDATA=${GEANT4_DATA_DIRECTORY}/RealSurface2.1 \
David Blyth's avatar
David Blyth committed
125
    G4SAIDXSDATA=${GEANT4_DATA_DIRECTORY}/G4SAIDDATA1.1 \
126 127
    G4ABLADATA=${GEANT4_DATA_DIRECTORY}/G4ABLA3.1 \
    G4ENSDFSTATEDATA=${GEANT4_DATA_DIRECTORY}/G4ENSDFSTATE2.2
David Blyth's avatar
David Blyth committed
128 129 130 131 132 133 134 135 136 137

# LCIO
ENV LCIO_RELEASE=v02-08

RUN git clone https://github.com/iLCSoft/LCIO.git \
&&  cd LCIO \
&&  git checkout tags/$LCIO_RELEASE \
&&  cd ../ \
&&  mkdir build \
&&  cd build \
138
&&  cmake \
David Blyth's avatar
David Blyth committed
139 140
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DCMAKE_BUILD_TYPE=Release \
141
        -DBUILD_ROOTDICT=ON \
David Blyth's avatar
David Blyth committed
142 143 144 145 146 147
        ../LCIO \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../ \
&&  rm -rf build LCIO

148
ENV ROOT_INCLUDE_PATH=/usr/local:/usr/local/include
David Blyth's avatar
David Blyth committed
149 150

# DD4hep
151
ENV DD4HEP_CHECKOUT=66153bb62344b4509e00ee94cced61f14eeadd59 \
152
    DD4HEP_REPO=https://github.com/decibelcooper/DD4hep.git
David Blyth's avatar
David Blyth committed
153 154

RUN sudo pacman -S --noconfirm \
155
        boost \
David Blyth's avatar
David Blyth committed
156 157
&&  sudo rm -rf /var/cache/pacman/pkg

158
RUN git clone $DD4HEP_REPO \
David Blyth's avatar
David Blyth committed
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
&&  cd DD4hep \
&&  git checkout $DD4HEP_CHECKOUT \
&&  cd .. \
&&  mkdir build \
&&  cd build \
&&  cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DDD4HEP_USE_GEANT4=ON \
        -DDD4HEP_USE_LCIO=ON \
        -DDD4HEP_USE_XERCESC=ON \
        ../DD4hep \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd .. \
&&  rm -rf build DD4hep

ENV DD4hepINSTALL=/usr/local \
    DD4hep_ROOT=/usr/local \
    DD4hep_DIR=/usr/local \
    PYTHONPATH=/usr/local/python:${PYTHONPATH}

# Protobuf
RUN sudo pacman -S --noconfirm \
182 183 184 185
        protobuf \
        protobuf-c \
        python-protobuf \
        python2-protobuf \
David Blyth's avatar
David Blyth committed
186 187
&&  sudo rm -rf /var/cache/pacman/pkg

188
# lz4
David Blyth's avatar
David Blyth committed
189
ENV LZ4_RELEASE=v1.8.1.2
190 191 192 193 194 195 196 197 198

RUN git clone https://github.com/lz4/lz4.git \
&&  cd lz4 \
&&  git checkout tags/$LZ4_RELEASE \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../ \
&&  rm -rf lz4

David Blyth's avatar
David Blyth committed
199
# ProIO
David Blyth's avatar
David Blyth committed
200
ENV GOPATH=/opt/Go
201
ENV PROIO_CHECKOUT=36d235100540f0c2489c1b47bbae5025f94b7e95 \
David Blyth's avatar
David Blyth committed
202 203 204 205 206 207 208 209 210 211
    PROIO_SOURCE=$GOPATH/src/github.com/decibelcooper/proio \
    PATH=$GOPATH/bin:${PATH}

RUN sudo pacman -S --noconfirm \
        go \
        python-pip \
        python2-pip \
&&  sudo rm -rf /var/cache/pacman/pkg

RUN sudo mkdir $GOPATH \
212
&&  sudo chown eicuser:eicuser $GOPATH \
David Blyth's avatar
David Blyth committed
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
&&  git clone https://github.com/decibelcooper/proio.git $PROIO_SOURCE \
&&  cd $PROIO_SOURCE \
&&  git checkout $PROIO_CHECKOUT \
&&  mkdir cpp-proio/build \
&&  cd cpp-proio/build \
&&  cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DCMAKE_BUILD_TYPE=Release \
        ../ \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../../go-proio \
&&  go get ./... \
&&  cd ../py-proio \
&&  sudo pip install . \
&&  sudo pip2 install . \
&&  cd \
&&  rm -rf $GOPATH/src

232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
# GenFit
ENV GENFIT_CHECKOUT=70c408ff7424bdfd572ddc175b9673e8a1e91bbb \
    GENFIT_PATH=/opt/GenFit

RUN sudo pacman -S --noconfirm \
        eigen \
&&  sudo rm -rf /var/cache/pacman/pkg

RUN git clone https://github.com/GenFit/GenFit.git $GENFIT_PATH \
&&  cd $GENFIT_PATH \
&&  git checkout $GENFIT_CHECKOUT \
&&  mkdir build \
&&  cd build \
&&  cmake \
        -DCMAKE_BUILD_TYPE=Release \
        ../ \
&&  make -j $BUILD_THREADS \
&&  make install \
&&  cd ../ \
&&  rm -rf build

David Blyth's avatar
David Blyth committed
253 254 255
ENV ROOT_INCLUDE_PATH=/usr/include/eigen3:${ROOT_INCLUDE_PATH} \
    LD_LIBRARY_PATH=/opt/GenFit/lib:${LD_LIBRARY_PATH}

David Blyth's avatar
David Blyth committed
256 257
# Convenience tools
RUN sudo pacman -S --noconfirm \
258
        gdb \
259 260
        ipython \
        ipython2 \
261
        mesa-demos \
David Blyth's avatar
David Blyth committed
262 263
        openssh \
        procps-ng \
264
        tigervnc \
David Blyth's avatar
David Blyth committed
265
        vim \
266
        wget \
267
        which \
268
        xfce4 \
David Blyth's avatar
David Blyth committed
269 270
&&  sudo rm -rf /var/cache/pacman/pkg