-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
69 lines (60 loc) · 2.13 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
FROM fedora:37
RUN dnf -y update \
&& dnf -y install \
gcc-gfortran \
gcc-c++ \
make \
metis-devel \
lapack-devel \
openblas-devel \
cmake \
&& dnf clean all
# Build the SuiteSparse libraries for sparse matrix support
# (-k included because of problem with SuiteSparse security certificate - 1 Aug 2021)
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 \
&& 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 .. \
&& 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 \
.. \
&& make install
# copy CAMP source code and data
COPY . /camp
# 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"
# 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="-pg" \
-D CMAKE_Fortran_FLAGS_DEBUG="-pg" \
-D CMAKE_MODULE_LINKER_FLAGS="-pg" \
/camp \
&& make install
WORKDIR /build