-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-build-env
More file actions
242 lines (213 loc) · 7.49 KB
/
Copy pathDockerfile-build-env
File metadata and controls
242 lines (213 loc) · 7.49 KB
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
FROM ubuntu:18.10
MAINTAINER Lukasz.Kaczmarczyk@glasgow.ac.uk
# Confif apt-get
RUN echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/99local
# ENV http_proxy="http://wwwcache.gla.ac.uk:8080/"
# ENV ftp_proxy="ftp://wwwcache.gla.ac.uk:8080/"
# ENV https_proxy="https://wwwcache.gla.ac.uk:8080/"
ENV DEBIAN_FRONTEND=noninteractive
# Install packages
RUN apt-get update && \
apt-get install -y \
file \
zlib1g-dev \
openssh-server \
wget \
valgrind \
git \
g++ \
gfortran \
gdb \
m4 \
automake \
build-essential \
libtool \
libblas-dev \
liblapack-dev \
libsigsegv2 \
libjpeg-dev \
graphviz \
doxygen \
cmake \
gnuplot \
pstack \
ca-certificates \
python \
bison \
flex \
libx11-dev \
libboost-all-dev \
libopenmpi-dev \
openmpi-bin \
xauth \
xterm \
unzip \
tk8.6-dev \
libfreetype6-dev \
mesa-common-dev \
libglu1-mesa-dev \
libxmu-dev \
libxi-dev \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
#libadolc-dev
# CMake
RUN cd /opt \
&& wget https://cmake.org/files/v3.8/cmake-3.8.2.tar.gz \
&& tar -xzf cmake-3.8.2.tar.gz && rm cmake-3.8.2.tar.gz \
&& cd cmake-3.8.2 && cmake -DCMAKE_USE_OPENSSL=ON -DCMAKE_INSTALL_PREFIX=/opt/local \
&& make install \
&& cd /opt && rm -rf cmake-3.8.2*
# Set petesc version
ENV PETSC_VERSION 3.7.7
ENV PETSC_ARCH arch-linux2-c-opt
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/opt/petsc/arch-linux2-c-opt/lib
ENV MESHKIT_DIR /opt/petsc/arch-linux2-c-opt/
ENV CASROOT /opt/petsc/arch-linux2-c-opt/
# Install petsc opt
RUN cd /opt && git clone --branch v$PETSC_VERSION --depth 1 https://gitlab.com/petsc/petsc.git
RUN cd /opt/petsc \
&& wget https://bitbucket.org/likask/mofem-joseph/downloads/netcdf-4.3.3.1.tar.gz \
&& ./configure \
--with-debugging=0 \
--with-mpi=1 \
--download-metis=1 \
--download-parmetis=1 \
--download-hypre=1 \
--download-mumps=1 \
--download-superlu_dist=1 \
--download-blacs=1 \
--download-hdf5=1 \
--download-netcdf=/opt/petsc/netcdf-4.3.3.1.tar.gz \
--download-scalapack=1 \
--with-shared-libraries=1 \
&& make PETSC_DIR=/opt/petsc PETSC_ARCH=$PETSC_ARCH all \
&& rm -rvf /opt/petsc/$PETSC_ARCH/externalpackages/*
# ADOL-C
RUN cd /opt \
&& wget http://www.coin-or.org/download/source/ADOL-C/ADOL-C-2.5.2.tgz \
&& tar -xzf ADOL-C-2.5.2.tgz \
&& cd ADOL-C-2.5.2 \
&& ./configure --prefix=/opt/petsc/$PETSC_ARCH \
&& make && make install
## OpenCascade & CGM
#RUN cd /opt && git clone --branch master --depth 1 https://bitbucket.org/fathomteam/cgm && \
#cd /opt && wget http://userweb.eng.gla.ac.uk/lukasz.kaczmarczyk/OpenCASCADE660.tgz && \
#tar -xzf OpenCASCADE660.tgz && rm OpenCASCADE660.tgz && \
#cd /opt/ros && \
#patch -p1 < ../cgm/src/geom/OCC/occ_patches_6.6.0; true && \
#autoreconf -fi && \
#./configure --prefix=/opt/petsc/arch-linux2-c-opt/ && \
#make install && make clean && \
#cd /opt/cgm && \
#autoreconf -fi && \
#./configure --prefix=/opt/petsc/$PETSC_ARCH --libdir=/opt/petsc/$PETSC_ARCH/lib \
#CC=mpicc CFLAGS="-fPIC -g -O" \
#AR=/usr/bin/ar ARFLAGS=cr \
#CXX=mpicxx CXXFLAGS="-g -fPIC" F90=mpif90 \
#F90FLAGS="-fPIC -ffree-line-length-0 -g -O" \
#F77=mpif90 FFLAGS="-fPIC -ffree-line-length-0 -g -O" \
#FC=mpif90 FCFLAGS="-fPIC -ffree-line-length-0 -g -O" \
#--with-occ=/opt/petsc/$PETSC_ARCH \
#--enable-shared \
#&& make install && make clean && \
#rm -rf /opt/ros
# Install moab
RUN cd /opt && git clone --branch master --depth 1 https://bitbucket.org/likask/moab.git
RUN cd /opt/moab && \
autoreconf -fi && \
./configure --prefix=/opt/petsc/$PETSC_ARCH --libdir=/opt/petsc/$PETSC_ARCH/lib \
CC=mpicc CFLAGS="-fPIC -g -O" \
AR=/usr/bin/ar ARFLAGS=cr \
CXX=mpicxx CXXFLAGS="-g -fPIC" F90=mpif90 \
F90FLAGS="-fPIC -ffree-line-length-0 -g -O" \
F77=mpif90 FFLAGS="-fPIC -ffree-line-length-0 -g -O" \
FC=mpif90 FCFLAGS="-fPIC -ffree-line-length-0 -g -O" \
LDFLAGS="-L/opt/petsc/arch-linux2-c-opt/lin64/gcc/lib" \
--enable-shared --with-mpi= \
--with-hdf5=/opt/petsc/$PETSC_ARCH \
--with-netcdf=/opt/petsc/$PETSC_ARCH \
--with-parmetis=/opt/petsc/$PETSC_ARCH \
--with-metis=/opt/petsc/$PETSC_ARCH \
&& make install && make clean
#--with-cgm=/opt/petsc/$PETSC_ARCH \
#--enable-irel --enable-fbigeom \
# SLEP opt solve eigen value problem
#RUN cd /opt && git clone https://bitbucket.org/slepc/slepc && cd /opt/slepc && git checkout tags/v$PETSC_VERSION
#RUN cd /opt/slepc && PETSC_DIR=/opt/petsc PETSC_ARCH=$PETSC_ARCH ./configure && make SLEPC_DIR=$PWD PETSC_DIR=/opt/petsc PETSC_ARCH=$PETSC_ARCH
# MED
RUN cd /opt && wget http://files.salome-platform.org/Salome/other/med-3.2.0.tar.gz && \
tar -xzf med-3.2.0.tar.gz && rm med-3.2.0.tar.gz && \
cd med-3.2.0/ && \
./configure --disable-python --disable-fortran --prefix=/opt/med --with-hdf5=/opt/petsc/$PETSC_ARCH && \
make install && make clean && rm -rf /opt/med-3.2.0
# TETGEN
RUN cd /opt && wget https://bitbucket.org/likask/mofem-joseph/downloads/tetgen1.5.0.tgz && \
tar -xf tetgen1.5.0.tgz && rm tetgen1.5.0.tgz && \
cd tetgen1.5.0 && \
/opt/local/bin/cmake . && \
make && \
cp libtet.a lib/
## NETGEN
#RUN cd /opt && wget http://downloads.sourceforge.net/project/netgen-mesher/netgen-mesher/5.3/netgen-5.3.0.tar.gz && \
#tar -xzf netgen-5.3.0.tar.gz && rm netgen-5.3.0.tar.gz && \
#cd netgen-5.3.0 && \
#./configure --prefix=/opt/petsc/$PETSC_ARCH --libdir=/opt/petsc/$PETSC_ARCH/lib \
#CC=mpicc CFLAGS="-fPIC -g -O" \
#AR=/usr/bin/ar ARFLAGS=cr \
#CXX=mpicxx CXXFLAGS="-g -fPIC" F90=mpif90 \
#F90FLAGS="-fPIC -ffree-line-length-0 -g -O" \
#F77=mpif90 FFLAGS="-fPIC -ffree-line-length-0 -g -O" \
#FC=mpif90 FCFLAGS="-fPIC -ffree-line-length-0 -g -O" \
#--disable-gui --enable-nglib && \
#make install && make clean && rm -rf /opt/netgen-5.3.0
## Triangle
#RUN cd /opt && mkdir /opt/triangle && \
#cd triangle && wget http://www.netlib.org/voronoi/triangle.zip && \
#unzip triangle.zip && rm triangle.zip && \
#mpicc -O -o triangle triangle.c -lm && \
#mpicc -DTRILIBRARY -O -c triangle.c && \
#mkdir lib && mkdir include && \
#cp triangle.h include/ && \
#ar rcs lib/libtriangle.a triangle.o
## MeshKit
#RUN cd /opt && git clone --branch master --depth 1 https://bitbucket.org/fathomteam/meshkit && \
#cd /opt/meshkit && \
#autoreconf -fi && \
#./configure --prefix=/opt/petsc/$PETSC_ARCH --libdir=/opt/petsc/$PETSC_ARCH/lib \
#CC=mpicc CFLAGS="-fPIC -g -O" \
#AR=/usr/bin/ar ARFLAGS=cr \
#CXX=mpicxx CXXFLAGS="-g -fPIC" F90=mpif90 \
#F90FLAGS="-fPIC -ffree-line-length-0 -g -O" \
#F77=mpif90 FFLAGS="-fPIC -ffree-line-length-0 -g -O" \
#FC=mpif90 FCFLAGS="-fPIC -ffree-line-length-0 -g -O" \
#--with-igeom=/opt/petsc/$PETSC_ARCH \
#--with-imesh=/opt/petsc/$PETSC_ARCH \
#--with-tetgen=/opt/tetgen1.5.0 \
#--with-netgen=/opt/petsc/$PETSC_ARCH \
#--with-triangle=/opt/triangle \
#&& make install && make clean
ENV PETSC_DIR=/opt/petsc
ENV PETSC_ARCH=$PETSC_ARCH
ENV PATH $PATH:$PETSC_DIR/$PETSC_ARCH/bin
ENV MOFEM_SRC_DIR=/mofem
ENV MOFEM_ROOT_DIR=/mofem_build
ENV MOFEM_INSTALL_DIR=/mofem_build/um
ENV MOFEM_BUILD_DIR=/mofem_build/lib
# Set mpirun alias
ENV OMPI_MCA_btl_vader_single_copy_mechanism=none
RUN echo "alias mpirun='mpirun --allow-run-as-root'" >> /root/.bash_aliases
# SSH
RUN mkdir /var/run/sshd
RUN echo 'root:mofem' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
# SSH .ssh dir
RUN mkdir root/.ssh
# Allow to trace child procsses needed for debuging
RUN sed -i 's/kernel.yama.ptrace_scope = 1/kernel.yama.ptrace_scope = 0/' /etc/sysctl.d/10-ptrace.conf
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]