-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile.tchem
177 lines (162 loc) · 6.34 KB
/
Dockerfile.tchem
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
FROM ubuntu:22.04
ARG BUILD_TYPE=RELEASE
ARG SACADO=ON
RUN echo "BUILD TYPE:" ${BUILD_TYPE}
RUN echo "SACADO:" ${SACADO}
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
autoconf \
clang-format \
cmake \
gcc \
g++ \
gfortran \
git \
lcov \
make \
libopenblas-dev \
pkg-config \
ca-certificates \
less \
tmux \
libnetcdf-dev \
libnetcdff-dev \
libgsl-dev \
openssh-client
RUN git clone https://github.com/PCLAeroParams/TChem-atm.git /tchem_dir/
WORKDIR /tchem_dir/
RUN git submodule update --init --recursive
RUN cmake -S /tchem_dir/external/Tines/ext/kokkos -B /build/kokkos_build \
-DCMAKE_INSTALL_PREFIX="/install/kokkos_install" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_CXX_FLAGS="-fopenmp -g" \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_OPENMP=ON \
-DKokkos_ENABLE_CUDA=OFF \
-DKokkos_ENABLE_CUDA_CONSTEXPR=OFF \
-DKokkos_ENABLE_CUDA_LAMBDA=OFF
WORKDIR /build/kokkos_build/
RUN make -j \
&& make install
RUN cmake -S /tchem_dir/external/Tines/ext/gtest -B /build/gtest_build \
-DCMAKE_INSTALL_PREFIX="/install/gtest_install" \
-DCMAKE_CXX_COMPILER=g++
WORKDIR /build/gtest_build
RUN make -j \
&& make install
RUN cmake -S /tchem_dir/external/Tines/ext/yaml -B /build//yaml_build \
-DCMAKE_INSTALL_PREFIX="/install/yaml_install" \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_FLAGS="-g -c" \
-DCMAKE_EXE_LINKER_FLAGS="" \
-DCMAKE_BUILD_TYPE=RELEASE
WORKDIR /build/yaml_build
RUN make -j \
&& make install
RUN cmake -S /tchem_dir/external/Sundials -B /build/sundials_build \
-DCMAKE_INSTALL_PREFIX="/install/sundials_install" \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_FLAGS="-g" \
-DCMAKE_C_FLAGS="-g" \
-DCMAKE_EXE_LINKER_FLAGS="" \
-DENABLE_CALIPER:BOOL=OFF \
-DCMAKE_BUILD_TYPE=RELEASE
WORKDIR /build/sundials_build
RUN make -j \
&& make install
RUN cmake -S /tchem_dir/external/Skywalker -B /build/skywalker_build \
-DCMAKE_INSTALL_PREFIX="/install/skywalker_install" \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_C_COMPILER=gcc \
-DSKYWALKER_PRECISION=double \
-DCMAKE_BUILD_TYPE=RELEASE
WORKDIR /build/skywalker_build
RUN make -j \
&& make install
RUN cmake -S /tchem_dir/external/Tines/src -B /build/tines_build \
-DCMAKE_INSTALL_PREFIX="/install/tines_install" \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_CXX_FLAGS="-g" \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_EXE_LINKER_FLAGS="-lgfortran" \
-DTINES_ENABLE_DEBUG=OFF \
-DTINES_ENABLE_VERBOSE=OFF \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DTINES_ENABLE_TEST=OFF \
-DTINES_ENABLE_EXAMPLE=OFF \
-DSUNDIALS_INSTALL_PATH=/install/sundials_install \
-DYAML_INSTALL_PATH=/install/yaml_install \
-DKOKKOS_INSTALL_PATH=/install/kokkos_install \
-DOPENBLAS_INSTALL_PATH=`/usr/lib64` \
-DGTEST_INSTALL_PATH=/install/gtest_install
WORKDIR /build/tines_build
RUN make -j \
&& make install
RUN cmake -S /tchem_dir/external/kokkos-kernels -B /build/kokkoskernels_build \
-DCMAKE_INSTALL_PREFIX="/install/kokkoskernels_install" \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_CXX_FLAGS="-g" \
-DCMAKE_EXE_LINKER_FLAGS="-lgfortran" \
-DKokkosKernels_ENABLE_EXAMPLES=OFF \
-DKokkosKernels_ENABLE_EXPERIMENTAL=OFF \
-DKokkosKernels_ENABLE_TESTS=OFF \
-DKokkosKernels_ENABLE_COMPONENT_BLAS=OFF \
-DKokkosKernels_ENABLE_COMPONENT_GRAPH=OFF \
-DKokkosKernels_ENABLE_COMPONENT_LAPACK=OFF \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DKokkos_ROOT=/install/kokkos_install
WORKDIR /build/kokkoskernels_build
RUN make -j4 \
&& make install
RUN cmake -S /tchem_dir/src -B /tchem_build \
-DCMAKE_INSTALL_PREFIX=/tchem_install \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_CXX_FLAGS="-g" \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_EXE_LINKER_FLAGS="-lgfortran" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DTCHEM_ATM_ENABLE_VERBOSE=OFF \
-DTCHEM_ATM_ENABLE_TEST=ON \
-DTCHEM_ATM_ENABLE_EXAMPLE=ON \
-DTCHEM_ATM_ENABLE_SACADO_JACOBIAN_ATMOSPHERIC_CHEMISTRY=${SACADO} \
-DKOKKOS_INSTALL_PATH=/install/kokkos_install \
-DTINES_INSTALL_PATH=/install/tines_install \
-DTCHEM_ATM_ENABLE_SKYWALKER=ON \
-DTCHEM_ATM_ENABLE_REAL_TYPE="double" \
-DSKYWALKER_INSTALL_PATH=/install/skywalker_install \
-DTCHEM_ATM_ENABLE_KOKKOSKERNELS=ON \
-DKOKKOSKERNELS_INSTALL_PATH=/install/kokkoskernels_install \
-DTCHEM_ATM_ENABLE_SKYWALKER=ON \
-DGTEST_INSTALL_PATH=/install/gtest_install
WORKDIR /tchem_build
RUN make -j \
&& make install
#RUN export FC=gfortran \
# export CC=gcc \
# export CXX=g++
COPY . /partmc/
RUN cd /build \
&& export TCHEM_HOME="/tchem_install" \
&& export KOKKOS_PATH="/install/kokkos_install" \
&& export KOKKOSKERNEL_PATH="/install/kokkoskernels_install" \
&& export YAML_PATH="/install/yaml_install" \
&& export TINES_PATH="/install/tines_install" \
&& export LAPACK_PATH="/usr/" \
&& export SUNDIALS_HOME="/install/sundials_install/" \
&& export LD_LIBRARY_PATH="/usr/lib:/usr/lib64:$LD_LIBRARY_PATH" \
&& cmake -DCMAKE_BUILD_TYPE=release \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_Fortran_COMPILER=gfortran \
-DCMAKE_C_FLAGS_RELEASE="-O2 -g -Werror -Wall -Wextra" \
-DCMAKE_Fortran_FLAGS_RELEASE="-O2 -g -Werror -fimplicit-none -Wall -Wextra -Wconversion -Wunderflow -Wimplicit-interface -Wno-compare-reals -Wno-unused -Wno-unused-parameter -Wno-unused-dummy-argument -fbounds-check" \
-D ENABLE_GSL:BOOL=TRUE \
-D ENABLE_TCHEM:BOOL=TRUE \
-D ENABLE_SUNDIALS:BOOL=TRUE \
-DCMAKE_C_FLAGS="-lpthread -ldl -fopenmp" \
-DCMAKE_Fortran_FLAGS="-lpthread -ldl -fopenmp" \
/partmc \
&& make
WORKDIR /build