-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.precice
50 lines (44 loc) · 1.59 KB
/
Dockerfile.precice
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
# Dockerfile for building preCICE on ubuntu 16.04
# Using ubuntu 16.04 as basis
FROM ubuntu:16.04
# Installing necessary dependacies for preCICE
RUN apt update && apt install -y \
build-essential \
scons \
libeigen3-dev \
libxml2-dev \
petsc-dev \
git \
python-numpy \
python-dev \
wget \
bzip2
# Installing boost from source
RUN wget -nv https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2 && \
tar -xf boost_1_66_0.tar.bz2 && \
cd boost_1_66_0/ && \
./bootstrap.sh --with-libraries=log,thread,system,filesystem,program_options,test --prefix=/usr/local && \
./b2 install && \
ldconfig
# Setting some environment variables for installing preCICE
ENV CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/usr/include/eigen3"
ENV CPATH="/usr/include/eigen3:${CPATH}"
ENV PETSC_DIR="/usr/lib/petscdir/3.6.2/"
ENV PETSC_ARCH="x86_64-linux-gnu-real"
# Building preCICE
RUN git clone https://github.com/precice/precice.git
WORKDIR precice
ARG branch=develop
RUN git fetch && git checkout $branch
# Some parameters for the build, you can set them in the build command e.g.
# sudo docker build Dockerfile.precice --build-arg petsc_para=yes --build-arg mpi_para=yes .
# this will result in
# scons petsc=yes mpi=yes python=no compiler="mpicxx" -j2
ARG petsc_para=no
ARG mpi_para=yes
ARG python_para=no
RUN scons petsc=$petsc_para mpi=$mpi_para python=$python_para -j2
# Setting preCICE environment variables
ENV PRECICE_ROOT="/precice"
ENV LD_LIBRARY_PATH="$PRECICE_ROOT/build/last:${LD_LIBRARY_PATH}"
ENV LIBRARY_PATH="$PRECICE_ROOT/build/last:${LIBRARY_PATH}"