forked from ukaea/openmc_workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
208 lines (165 loc) · 6.55 KB
/
Dockerfile
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# build with the following command, replace the 50 cores with however many you would like to use
# docker build -t ukaea/openmcworkshop --build-arg compile_cores=50 .
# run with the following command
# docker run -p 8888:8888 ukaea/openmcworkshop /bin/bash -c "jupyter notebook --notebook-dir=/tasks --ip='*' --port=8888 --no-browser --allow-root"
# test with the folowing command
# docker run --rm ukaea/openmcworkshop pytest ../tests
FROM continuumio/miniconda3
RUN apt-get --yes update && apt-get --yes upgrade
# required pacakges identified from openmc travis.yml
RUN apt-get --yes install mpich libmpich-dev libhdf5-serial-dev \
libhdf5-mpich-dev
# needed to allow NETCDF on MOAB which helps with tet meshes in OpenMC
RUN apt-get --yes install libnetcdf-dev
# RUN apt-get --yes install libnetcdf13
# eigen3 needed for DAGMC
RUN apt-get --yes install libeigen3-dev
# sudo is needed during the NJOY install
RUN apt-get -y install sudo
RUN apt-get -y install git
# dependancies used in the workshop
RUN apt-get --yes install hdf5-tools
RUN apt-get --yes install wget
# installing cadquery and jupyter
RUN conda install jupyter -y
RUN conda install -c conda-forge -c python python=3.7.8
RUN conda install -c conda-forge -c cadquery cadquery=2
# cadquery master don't appear to show the .solid in the notebook
# new version needed for openmc compile
RUN pip install cmake
# Python libraries used in the workshop
RUN pip install plotly tqdm ghalton==0.6.1 noisyopt scikit-optimize \
inference-tools adaptive vtk itkwidgets nest_asyncio \
neutronics_material_maker parametric-plasma-source pytest \
pytest-cov holoviews ipywidgets
RUN git clone --single-branch --branch develop https://github.com/openmc-dev/openmc.git
RUN git clone https://github.com/njoy/NJOY2016
RUN mkdir DAGMC && \
cd DAGMC && \
git clone --single-branch --branch develop https://github.com/svalinn/dagmc
RUN mkdir MOAB && \
cd MOAB && \
git clone --single-branch --branch develop https://bitbucket.org/fathomteam/moab/
# needed for openmc
RUN pip install --upgrade numpy
RUN git clone --single-branch --branch master https://github.com/embree/embree
RUN git clone https://github.com/pshriwise/double-down
# needed for moab
RUN pip install cython
# Install dependencies from Debian package manager
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y \
wget git gfortran g++ cmake \
mpich libmpich-dev libhdf5-serial-dev libhdf5-mpich-dev \
imagemagick && \
apt-get autoremove
# install addition packages required for DAGMC
RUN apt-get --yes install libeigen3-dev && \
apt-get --yes install libnetcdf-dev && \
apt-get --yes install libtbb-dev && \
apt-get --yes install libglfw3-dev
# needed for CadQuery functionality
RUN apt-get install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa-dev \
freeglut3-dev libosmesa6 libosmesa6-dev \
libgles2-mesa-dev && \
apt-get clean
RUN git clone --single-branch --branch develop https://github.com/ukaea/paramak.git && \
cd paramak && \
python setup.py install
# RUN pip install paramak
ARG compile_cores=2
# Clone and install Embree
RUN echo git clone --single-branch --branch master https://github.com/embree/embree && \
cd embree && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX=.. \
-DEMBREE_ISPC_SUPPORT=OFF && \
make -j"$compile_cores" && \
make -j"$compile_cores" install
# Clone and install MOAB
RUN echo git clone --single-branch --branch develop https://bitbucket.org/fathomteam/moab/ && \
cd MOAB && \
mkdir build && \
cd build && \
cmake ../moab -DENABLE_HDF5=ON \
-DENABLE_NETCDF=ON \
-DENABLE_BLASLAPACK=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DENABLE_FORTRAN=OFF \
-DCMAKE_INSTALL_PREFIX=/MOAB && \
make -j"$compile_cores" && \
make -j"$compile_cores" install && \
cmake ../moab -DBUILD_SHARED_LIBS=ON \
-DENABLE_HDF5=ON \
-DENABLE_PYMOAB=ON \
-DENABLE_BLASLAPACK=OFF \
-DENABLE_FORTRAN=OFF \
-DCMAKE_INSTALL_PREFIX=/MOAB && \
make -j"$compile_cores" install && \
cd pymoab && \
bash install.sh && \
python setup.py install
# Clone and install Double-Down
RUN echo git clone https://github.com/pshriwise/double-down && \
cd double-down && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX=.. \
-DMOAB_DIR=/MOAB \
-DEMBREE_DIR=/embree/lib/cmake/embree-3.12.1 && \
make -j"$compile_cores" && \
make -j"$compile_cores" install
# DAGMC install
# ENV DAGMC_INSTALL_DIR=$HOME/DAGMC/
RUN echo installing dagmc && \
cd DAGMC && \
# mkdir DAGMC && cd DAGMC && \
# git clone --single-branch --branch develop https://github.com/svalinn/dagmc && \
mkdir build && \
cd build && \
cmake ../dagmc -DBUILD_TALLY=ON \
-DCMAKE_INSTALL_PREFIX=/DAGMC \
-DMOAB_DIR=/MOAB && \
make -j"$compile_cores" install && \
rm -rf /DAGMC/dagmc /DAGMC/build
# installs OpenMc from source
RUN cd /opt && \
git clone --single-branch --branch develop https://github.com/openmc-dev/openmc.git && \
cd openmc && \
mkdir build && \
cd build && \
cmake -Doptimize=on -Ddagmc=ON -DDAGMC_ROOT=$DAGMC_INSTALL_DIR -DHDF5_PREFER_PARALLEL=OFF .. && \
make -j"$compile_cores" && \
make -j"$compile_cores" install && \
cd /opt/openmc/ && \
pip install .
# Clone and install NJOY2016
RUN echo installing NJOY2016 && \
# git clone https://github.com/njoy/NJOY2016 && \
cd NJOY2016 && \
mkdir build && \
cd build && \
cmake -Dstatic=on .. && \
make 2>/dev/null && \
sudo make install
ENV LD_LIBRARY_PATH=$HOME/MOAB/lib:$HOME/DAGMC/lib
ENV PATH=$PATH:$HOME/NJOY2016/build
# install nuclear data
RUN git clone https://github.com/openmc-dev/data.git
RUN python3 data/convert_nndc71.py --cleanup && \
rm -rf nndc-b7.1-endf && \
rm -rf nndc-b7.1-ace/ && \
rm -rf nndc-b7.1-download
RUN python3 data/convert_tendl.py --cleanup && \
rm -rf tendl-2019-ace/ && \
rm -rf tendl-2019-download
RUN python3 data/combine_libraries.py -l nndc-b7.1-hdf5/cross_sections.xml tendl-2019-hdf5/cross_sections.xml -o cross_sections.xml
RUN wget https://github.com/mit-crpg/WMP_Library/releases/download/v1.1/WMP_Library_v1.1.tar.gz
RUN tar -xf WMP_Library_v1.1.tar.gz -C /
ENV OPENMC_CROSS_SECTIONS=/cross_sections.xml
# Copy over the local repository files
COPY tests tests/
COPY tasks tasks/
WORKDIR tasks