Skip to content

Commit 83a7b36

Browse files
paulromanoshimwell
andauthored
Speed up Docker build (#3841)
Co-authored-by: Jonathan Shimwell <drshimwell@gmail.com>
1 parent b3788f1 commit 83a7b36

1 file changed

Lines changed: 8 additions & 21 deletions

File tree

Dockerfile

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ ARG build_libmesh
3333
# Set default value of HOME to /root
3434
ENV HOME=/root
3535

36-
# Embree variables
37-
ENV EMBREE_TAG='v4.3.1'
38-
ENV EMBREE_REPO='https://github.com/embree/embree'
39-
ENV EMBREE_INSTALL_DIR=$HOME/EMBREE/
40-
4136
# MOAB variables
4237
ENV MOAB_TAG='5.5.1'
4338
ENV MOAB_REPO='https://bitbucket.org/fathomteam/moab/'
@@ -61,7 +56,7 @@ ENV LIBMESH_INSTALL_DIR=$HOME/LIBMESH
6156
ENV NJOY_REPO='https://github.com/njoy/NJOY2016'
6257

6358
# Setup environment variables for Docker image
64-
ENV LD_LIBRARY_PATH=${DAGMC_INSTALL_DIR}/lib:$LD_LIBRARY_PATH \
59+
ENV LD_LIBRARY_PATH=${DAGMC_INSTALL_DIR}/lib:${LD_LIBRARY_PATH:-} \
6560
OPENMC_ENDF_DATA=/root/endf-b-vii.1 \
6661
DEBIAN_FRONTEND=noninteractive
6762

@@ -71,7 +66,7 @@ RUN apt-get update -y && \
7166
apt-get install -y \
7267
python3-pip python-is-python3 wget git build-essential cmake \
7368
mpich libmpich-dev libhdf5-serial-dev libhdf5-mpich-dev \
74-
libpng-dev python3-venv && \
69+
libpng-dev libpugixml-dev libfmt-dev catch2 python3-venv && \
7570
apt-get autoremove
7671

7772
# create virtual enviroment to avoid externally managed environment error
@@ -94,22 +89,12 @@ RUN cd $HOME \
9489

9590
RUN if [ "$build_dagmc" = "on" ]; then \
9691
# Install addition packages required for DAGMC
97-
apt-get -y install libeigen3-dev libnetcdf-dev libtbb-dev libglfw3-dev \
92+
apt-get -y install \
93+
libeigen3-dev libnetcdf-dev libtbb-dev libglfw3-dev libembree-dev \
9894
&& pip install --upgrade numpy \
9995
&& pip install --no-cache-dir setuptools cython \
100-
# Clone and install EMBREE
101-
&& mkdir -p $HOME/EMBREE && cd $HOME/EMBREE \
102-
&& git clone --single-branch -b ${EMBREE_TAG} --depth 1 ${EMBREE_REPO} \
103-
&& mkdir build && cd build \
104-
&& cmake ../embree \
105-
-DCMAKE_INSTALL_PREFIX=${EMBREE_INSTALL_DIR} \
106-
-DEMBREE_MAX_ISA=NONE \
107-
-DEMBREE_ISA_SSE42=ON \
108-
-DEMBREE_ISPC_SUPPORT=OFF \
109-
&& make 2>/dev/null -j${compile_cores} install \
110-
&& rm -rf ${EMBREE_INSTALL_DIR}/build ${EMBREE_INSTALL_DIR}/embree ; \
11196
# Clone and install MOAB
112-
mkdir -p $HOME/MOAB && cd $HOME/MOAB \
97+
&& mkdir -p $HOME/MOAB && cd $HOME/MOAB \
11398
&& git clone --single-branch -b ${MOAB_TAG} --depth 1 ${MOAB_REPO} \
11499
&& mkdir build && cd build \
115100
&& cmake ../moab -DCMAKE_BUILD_TYPE=Release \
@@ -118,6 +103,7 @@ RUN if [ "$build_dagmc" = "on" ]; then \
118103
-DBUILD_SHARED_LIBS=OFF \
119104
-DENABLE_FORTRAN=OFF \
120105
-DENABLE_BLASLAPACK=OFF \
106+
-DENABLE_TESTING=OFF \
121107
&& make 2>/dev/null -j${compile_cores} install \
122108
&& cmake ../moab \
123109
-DENABLE_PYMOAB=ON \
@@ -133,7 +119,7 @@ RUN if [ "$build_dagmc" = "on" ]; then \
133119
&& mkdir build && cd build \
134120
&& cmake ../double-down -DCMAKE_INSTALL_PREFIX=${DD_INSTALL_DIR} \
135121
-DMOAB_DIR=/usr/local \
136-
-DEMBREE_DIR=${EMBREE_INSTALL_DIR} \
122+
-DEMBREE_DIR=/usr \
137123
&& make 2>/dev/null -j${compile_cores} install \
138124
&& rm -rf ${DD_INSTALL_DIR}/build ${DD_INSTALL_DIR}/double-down ; \
139125
# Clone and install DAGMC
@@ -147,6 +133,7 @@ RUN if [ "$build_dagmc" = "on" ]; then \
147133
-DDOUBLE_DOWN_DIR=${DD_INSTALL_DIR} \
148134
-DCMAKE_PREFIX_PATH=${DD_INSTALL_DIR}/lib \
149135
-DBUILD_STATIC_LIBS=OFF \
136+
-DBUILD_TESTS=OFF \
150137
&& make 2>/dev/null -j${compile_cores} install \
151138
&& rm -rf ${DAGMC_INSTALL_DIR}/DAGMC ${DAGMC_INSTALL_DIR}/build ; \
152139
fi

0 commit comments

Comments
 (0)