-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile.mpi
82 lines (71 loc) · 2.59 KB
/
Dockerfile.mpi
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
FROM fedora:27
RUN dnf -y update \
&& dnf install -y sudo \
&& adduser test_user \
&& echo "test_user ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/test_user \
&& chmod 0440 /etc/sudoers.d/test_user
USER test_user
WORKDIR /home/test_user
RUN sudo dnf -y install \
openmpi-devel \
gcc-gfortran \
gcc-c++ \
make \
metis-devel \
lapack-devel \
openblas-devel \
cmake \
&& sudo dnf clean all
ENV PATH="${PATH}:/usr/lib64/openmpi/bin/"
# Build the SuiteSparse libraries for sparse matrix support
RUN curl -kLO http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-5.1.0.tar.gz \
&& tar -zxvf SuiteSparse-5.1.0.tar.gz \
&& export CXX=/usr/bin/cc \
&& cd SuiteSparse \
&& sudo make install INSTALL=/usr/local BLAS="-L/lib64 -lopenblas"
# Install json-fortran
RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/6.1.0.tar.gz \
&& tar -zxvf 6.1.0.tar.gz \
&& cd json-fortran-6.1.0 \
&& export FC=gfortran \
&& mkdir build \
&& cd build \
&& cmake -D SKIP_DOC_GEN:BOOL=TRUE .. \
&& sudo make install
# copy CVODE source
COPY cvode-3.4-alpha.tar.gz cvode-3.4-alpha.tar.gz
# Install a modified version of CVODE
RUN tar -zxvf cvode-3.4-alpha.tar.gz \
&& cd cvode-3.4-alpha \
&& mkdir build \
&& cd build \
&& cmake -D CMAKE_BUILD_TYPE=release \
-D CMAKE_C_FLAGS_DEBUG="-g -pg" \
-D CMAKE_EXE_LINKER_FLAGS_DEBUG="-pg" \
-D CMAKE_MODULE_LINKER_FLAGS_DEBUG="-pg" \
-D CMAKE_SHARED_LINKER_FLAGS_DEBUG="-pg" \
-D KLU_ENABLE:BOOL=TRUE \
-D KLU_LIBRARY_DIR=/usr/local/lib \
-D KLU_INCLUDE_DIR=/usr/local/include \
.. \
&& sudo make install
# Update environment variables
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64:/usr/local/jsonfortran-gnu-6.1.0/lib"
ENV PATH="${PATH}:/usr/local/jsonfortran-gnu-6.1.0/lib"
# NOTE: Modify .dockerignore to whitelist files/directories to copy.
COPY . /home/test_user/camp/
# Build CAMP
RUN mkdir build \
&& cd build \
&& export JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-6.1.0" \
&& cmake -D CMAKE_BUILD_TYPE=release \
-D CMAKE_C_FLAGS_DEBUG="-g -pg" \
-D CMAKE_Fortran_FLAGS_DEBUG="-g -pg" \
-D CMAKE_MODULE_LINKER_FLAGS="-pg" \
-D ENABLE_DEBUG:BOOL=TRUE \
-D ENABLE_MPI:BOOL=TRUE \
-D CMAKE_Fortran_COMPILER=/usr/lib64/openmpi/bin/mpif90 \
../camp \
&& make \
&& sudo make install
WORKDIR /home/test_user/build