CAMP 1.0.0
Chemistry Across Multiple Phases
Dockerfile.mpi
Go to the documentation of this file.
1FROM fedora:27
2
3RUN dnf -y update \
4 && dnf install -y sudo \
5 && adduser test_user \
6 && echo "test_user ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/test_user \
7 && chmod 0440 /etc/sudoers.d/test_user
8
9USER test_user
10WORKDIR /home/test_user
11
12RUN sudo dnf -y install \
13 openmpi-devel \
14 gcc-gfortran \
15 gcc-c++ \
16 make \
17 metis-devel \
18 lapack-devel \
19 openblas-devel \
20 cmake \
21 && sudo dnf clean all
22ENV PATH="${PATH}:/usr/lib64/openmpi/bin/"
23
24# Build the SuiteSparse libraries for sparse matrix support
25RUN curl -kLO http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-5.1.0.tar.gz \
26 && tar -zxvf SuiteSparse-5.1.0.tar.gz \
27 && export CXX=/usr/bin/cc \
28 && cd SuiteSparse \
29 && sudo make install INSTALL=/usr/local BLAS="-L/lib64 -lopenblas"
30
31# Install json-fortran
32RUN curl -LO https://github.com/jacobwilliams/json-fortran/archive/6.1.0.tar.gz \
33 && tar -zxvf 6.1.0.tar.gz \
34 && cd json-fortran-6.1.0 \
35 && export FC=gfortran \
36 && mkdir build \
37 && cd build \
38 && cmake -D SKIP_DOC_GEN:BOOL=TRUE .. \
39 && sudo make install
40
41# copy CVODE source
42COPY cvode-3.4-alpha.tar.gz cvode-3.4-alpha.tar.gz
43
44# Install a modified version of CVODE
45RUN tar -zxvf cvode-3.4-alpha.tar.gz \
46 && cd cvode-3.4-alpha \
47 && mkdir build \
48 && cd build \
49 && cmake -D CMAKE_BUILD_TYPE=release \
50 -D CMAKE_C_FLAGS_DEBUG="-g -pg" \
51 -D CMAKE_EXE_LINKER_FLAGS_DEBUG="-pg" \
52 -D CMAKE_MODULE_LINKER_FLAGS_DEBUG="-pg" \
53 -D CMAKE_SHARED_LINKER_FLAGS_DEBUG="-pg" \
54 -D KLU_ENABLE:BOOL=TRUE \
55 -D KLU_LIBRARY_DIR=/usr/local/lib \
56 -D KLU_INCLUDE_DIR=/usr/local/include \
57 .. \
58 && sudo make install
59
60# Update environment variables
61ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib:/usr/local/lib64:/usr/local/jsonfortran-gnu-6.1.0/lib"
62ENV PATH="${PATH}:/usr/local/jsonfortran-gnu-6.1.0/lib"
63
64# NOTE: Modify .dockerignore to whitelist files/directories to copy.
65COPY . /home/test_user/camp/
66
67# Build CAMP
68 RUN mkdir build \
69 && cd build \
70 && export JSON_FORTRAN_HOME="/usr/local/jsonfortran-gnu-6.1.0" \
71 && cmake -D CMAKE_BUILD_TYPE=release \
72 -D CMAKE_C_FLAGS_DEBUG="-g -pg" \
73 -D CMAKE_Fortran_FLAGS_DEBUG="-g -pg" \
74 -D CMAKE_MODULE_LINKER_FLAGS="-pg" \
75 -D ENABLE_DEBUG:BOOL=TRUE \
76 -D ENABLE_MPI:BOOL=TRUE \
77 -D CMAKE_Fortran_COMPILER=/usr/lib64/openmpi/bin/mpif90 \
78 ../camp \
79 && make \
80 && sudo make install
81
82WORKDIR /home/test_user/build