-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
73 lines (58 loc) · 1.6 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
70
71
72
73
FROM ubuntu AS builder
LABEL maintainer="https://github.com/orgs/FreeFem/people"
ARG DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
automake \
bison \
cmake \
file flex \
g++ \
gfortran \
git \
make \
libopenblas-dev \
libhdf5-dev \
libgsl-dev \
libfftw3-dev \
libnlopt-dev \
patch \
pkg-config \
python3-minimal \
python3-distutils \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*
ENV DIRPATH /root/FreeFem-sources
# Copy FreeFEM repository
RUN git clone --depth 1 --single-branch https://github.com/FreeFem/FreeFem-sources.git $DIRPATH
WORKDIR $DIRPATH
# Configure FreeFEM and download PETSc
RUN autoreconf -i \
&& ./configure --enable-download --enable-optim --enable-generic --prefix=/usr/freefem/ \
&& ./3rdparty/getall -o PETSc -a
# Compile PETSc/SLEPc and reconfigure FreeFEM
RUN cd $DIRPATH/3rdparty/ff-petsc \
&& make petsc-slepc
# Reconfigure and compile FreeFEM
RUN ./reconfigure && make -j"$(nproc)"
# Install FreeFEM
RUN make install
FROM ubuntu
LABEL maintainer="https://github.com/orgs/FreeFem/people"
# Install dependencies
RUN apt-get update && apt-get install -y \
libopenblas-dev \
libhdf5-dev \
libgsl-dev \
libfftw3-dev \
libnlopt-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy FreeFEM repository
RUN mkdir /usr/freefem
COPY --from=builder /usr/freefem /usr/freefem
# Add executable in PATH
ENV PATH /usr/freefem/bin:$PATH
# Default command
ENV GLOB *.edp
CMD ["bash", "-c", "ls /data/$GLOB | xargs -I {} /usr/freefem/bin/ff-mpirun -n 1 {}"]