Skip to content
This repository was archived by the owner on Aug 14, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions adapters/Dockerfile.calculix-adapter
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Dockerfile for building the calculix-adapter for preCICE
# NOTE: Built for CalculiX v2.16

# Building on top of the latest preCICE-build
ARG branch=develop
ARG from=precice/precice-ubuntu1804.home-${branch}
FROM $from

USER root

# ( since we are importing form the precice image )
# Install dependencies
RUN apt-get -qq update && apt-get -qq install \
build-essential \
gfortran \
Expand All @@ -19,20 +23,24 @@ RUN apt-get -qq update && apt-get -qq install \
libyaml-cpp-dev && \
rm -rf /var/lib/apt/lists/*

# Rebuild image from here if `force_rebuild` is enabled
ARG CACHEBUST

USER precice
# get calculix source

# Get calculix source (using version 2.16)
WORKDIR /home/precice
RUN curl -s http://www.dhondt.de/ccx_2.16.src.tar.bz2 | tar -xj

# Get adapter source
ARG adapter_branch=develop
RUN git clone --depth 1 --branch $adapter_branch https://github.com/precice/calculix-adapter.git

# build adapter
# Build adapter
WORKDIR calculix-adapter/
RUN make -j $(nproc)

# create directory for input/out/exchange
# Create directory for input/out/exchange
WORKDIR /home/precice
RUN mkdir -p Logs Data/Input Data/Output Data/Exchange
ENV PATH="/home/precice/calculix-adapter/bin:${PATH}"
Expand Down
15 changes: 8 additions & 7 deletions adapters/Dockerfile.codeaster-adapter
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Dockerfile for building the codeaster-adapter for preCICE

# Building on top of the latest preCICE-build
ARG branch=develop
ARG from=precice/precice-ubuntu1804.home-${branch}
ARG base_solver=precice/codeaster
Expand All @@ -7,20 +10,18 @@ FROM $from
USER root
ENV USER=root

# Install dependecies
# Install dependencies
RUN apt-get -qq update && apt-get -qq install \
git \
locales \
python3-pip \
python3-numpy && \
rm -rf /var/lib/apt/lists/*

RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Rebuild image from here if `force_rebuild` is enabled
ARG CACHEBUST

# Building Code_Aster-adapter
# Build Code_Aster-adapter
USER precice
WORKDIR /home/precice

Expand All @@ -38,6 +39,6 @@ RUN \
RUN \
mkdir Data Logs && cd Data && mkdir Exchange Input Output

# Installing python bindings for preCICE
# Install python bindings for preCICE
RUN \
pip3 install --upgrade pip && pip3 install --user pyprecice
8 changes: 8 additions & 0 deletions adapters/Dockerfile.dealii-adapter
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
# Dockerfile for building the dealii-adapter for preCICE
# NOTE: Built with dimension argument set to 2.

# Building on top of the latest preCICE-build
ARG branch=develop
ARG from=precice/precice-ubuntu1804.home-${branch}
ARG base_solver=precice/deal.ii
FROM ${base_solver} as deal.ii
FROM $from

# Rebuild image from here if `force_rebuild` is enabled
ARG CACHEBUST

# Get solver
COPY --from=deal.ii /home/precice/dealii/ /home/precice/dealii/
COPY --from=deal.ii /home/precice/dealii_build/ /home/precice/dealii_build/

USER precice
WORKDIR /home/precice
RUN mkdir -p Logs Data/Input Data/Output Data/Exchange

# Get adapter source
ARG adapter_branch=develop
RUN git clone --depth 1 --branch $adapter_branch https://github.com/precice/dealii-adapter.git

# Build adapter
RUN cd dealii-adapter/linear_elasticity/ && \
cmake -DDEAL_II_DIR=$HOME/dealii_build -DDIM=2 -DCMAKE_BUILD_TYPE=Release . && \
make -j $(nproc)
Expand Down
8 changes: 8 additions & 0 deletions adapters/Dockerfile.dealii-adapter_3D
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
# Dockerfile for building the dealii-adapter for preCICE
# NOTE: Built with dimension argument set to 3.

# Building on top of the latest preCICE-build
ARG branch=develop
ARG from=precice/precice-ubuntu1804.home-${branch}
ARG base_solver=precice/deal.ii
FROM ${base_solver} as deal.ii
FROM $from

# Rebuild image from here if `force_rebuild` is enabled
ARG CACHEBUST

# Get solver
COPY --from=deal.ii /home/precice/dealii/ /home/precice/dealii/
COPY --from=deal.ii /home/precice/dealii_build/ /home/precice/dealii_build/

USER precice
WORKDIR /home/precice
RUN mkdir -p Logs Data/Input Data/Output Data/Exchange

# Get adapter source
ARG adapter_branch=develop
RUN git clone --branch $adapter_branch https://github.com/precice/dealii-adapter.git

# Build adapter
RUN cd dealii-adapter/linear_elasticity/ && \
cmake -DDEAL_II_DIR=$HOME/dealii_build -DDIM=3 -DCMAKE_BUILD_TYPE=Release . && \
make -j $(nproc)
Expand Down
16 changes: 10 additions & 6 deletions adapters/Dockerfile.fenics-adapter
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# System testing preCICE with fenics-adapter
# Dockerfile for building the fenics-adapter for preCICE
# NOTE: At the moment, fenics has some dependency issues, which
# requires us to use some workarounds for building the adapter.
# At a later point, these workarounds should be removed:
# 1. precice-Ubuntu1804.package being built with outdated PETSc version
# 2. Manually uninstalling the fenics-ufl package (in this file)

# Building on top of the latest preCICE-build
ARG branch=develop
Expand All @@ -9,7 +14,7 @@ USER root
ENV USER=root
ENV DEBIAN_FRONTEND=noninteractive

# Installing necessary dependencies
# Install necessary dependencies
RUN apt-get -qq update && apt-get -qq install \
apt-utils && \
apt-get -qq install \
Expand All @@ -32,17 +37,16 @@ RUN pip3 install --user cython # TODO: can we put this dependency into requireme

USER precice


# Rebuild image if force_rebuild after that command
# Rebuild image from here if `force_rebuild` is enabled
ARG CACHEBUST

ARG bindings_branch=develop
ARG adapter_branch=develop

# Builds the precice python bindings for python3
# Build the precice python bindings for python3
RUN pip3 install --user https://github.com/precice/python-bindings/archive/$bindings_branch.zip

# Building fenics-adapter
# Build fenics-adapter
RUN pip3 install --user numpy==1.14.5 https://github.com/precice/fenics-adapter/archive/$adapter_branch.zip


Expand Down
13 changes: 6 additions & 7 deletions adapters/Dockerfile.openfoam-adapter
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Dockerfile for building the openfoam-adapter for preCICE
# NOTE: Built for OpenFOAM v2006

ARG branch=develop
ARG from=precice/precice-ubuntu1804.home-${branch}
# ARG base_solver=precice/openfoam
Expand All @@ -7,26 +10,22 @@ FROM $from
USER root
ENV USER=root

# Install dependecies
# Install dependencies
RUN apt-get -qq update && apt-get -qq install \
software-properties-common \
wget apt-transport-https && \
rm -rf /var/lib/apt/lists/*



# Rebuild image from here if `force_rebuild` is enabled
ARG CACHEBUST

# Install OpenFOAM v2006
# see https://github.com/precice/openfoam-adapter/wiki/Notes-on-OpenFOAM#get-openfoam
RUN wget -q -O - https://dl.openfoam.com/add-debian-repo.sh | bash && \
apt-get install -y openfoam2006-default

# # Get OpenFOAM5 install via folder copy
# COPY --from=openfoam /opt/openfoam5 /opt/openfoam5/
# for of5, we need to also source the file at /opt/openfoam5/etc/bashrc

# Building openfoam-adapter
# Build openfoam-adapter
USER precice
SHELL ["/bin/bash", "-c"] # without this command /opt/openfoam5/etc/bashrc cannot be sourced
WORKDIR /home/precice
Expand Down
12 changes: 11 additions & 1 deletion adapters/Dockerfile.su2-adapter
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Dockerfile for building the su2-adapter for preCICE
# NOTE: Built for SU2 v6.0.0

ARG branch=develop
ARG from=precice/precice-ubuntu1604.home-${branch}
ARG from=precice/precice-ubuntu1804.home-${branch}
FROM $from

USER root
ENV CXX="g++"

# Install dependencies
RUN apt-get -qq update && apt-get -qq install \
dh-autoreconf \
automake \
Expand All @@ -13,24 +17,30 @@ RUN apt-get -qq update && apt-get -qq install \
ccache \
time

# Rebuild image from here if `force_rebuild` is enabled
ARG CACHEBUST

USER precice

# Get solver
WORKDIR /home/precice
RUN mkdir -p Logs Data/Input Data/Output Data/Exchange
RUN git clone --depth 1 --branch v6.0.0 https://github.com/su2code/SU2.git su2-source

# Set solver environment variables
ENV SU2_HOME="/home/precice/su2-source" \
SU2_BIN="/home/precice/su2-bin" \
SU2_RUN="/home/precice/su2-bin/bin" \
PATH="/home/precice/su2-bin/bin:${PATH}" \
PYTHONPATH="/home/precice/su2-bin/bin:${PYTHONPATH}"

# Get adapter source
ARG adapter_branch=develop
RUN cd /home/precice && \
git clone --depth 1 --branch $adapter_branch https://github.com/precice/su2-adapter.git && cd su2-adapter && \
./su2AdapterInstall

# Build adapter
WORKDIR /home/precice/su2-source
RUN ./configure --disable-metis --disable-parmetis --disable-cgns --disable-DOT \
--disable-MSH --disable-DEF --disable-SOL --disable-GEO \
Expand Down
6 changes: 6 additions & 0 deletions precice/Dockerfile.Ubuntu1604.home
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Dockerfile for building preCICE on ubuntu 16.04

# #################
# WARNING: As of 11.2020, images using Ubuntu 16.04 are no longer maintained.
# Attempting to build this dockerfile or using it as base image for
# other builds is likely to fail.
# #################

# Using ubuntu 16.04 as basis
FROM ubuntu:16.04

Expand Down
6 changes: 6 additions & 0 deletions precice/Dockerfile.Ubuntu1604.package
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Dockerfile for building preCICE on ubuntu 16.04

# #################
# WARNING: As of 11.2020, images using Ubuntu 16.04 are no longer maintained.
# Attempting to build this dockerfile or using it as base image for
# other builds is likely to fail.
# #################

# Using ubuntu 16.04 as basis
FROM ubuntu:16.04

Expand Down
51 changes: 27 additions & 24 deletions precice/Dockerfile.Ubuntu1804.home
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Dockerfile for building preCICE on Ubuntu 18.04
# default setup, user set to 'precice', manual install
# Dockerfile for building preCICE
# OS version: Ubuntu 18.04
# User: precice
# PETSc install: from source
# precice install: default


# Use official Ubuntu 18.04 as base
FROM ubuntu:18.04

# Installing necessary dependacies for preCICE, boost 1.65 from apt-get
# Avoid timeouts during install due to interactive installs
ARG DEBIAN_FRONTEND=noninteractive

# Install necessary dependencies for preCICE, Boost 1.65 from apt-get
RUN apt-get -qq update && apt-get -qq install \
build-essential \
locales \
Expand All @@ -20,57 +27,53 @@ RUN apt-get -qq update && apt-get -qq install \
cmake && \
rm -rf /var/lib/apt/lists/*

# create user precice
# Create user precice
ARG uid=1000
ARG gid=1000
RUN groupadd -g ${gid} precice \
&& useradd -u ${uid} -g ${gid} -m -s /bin/bash precice
&& useradd -u ${uid} -g ${gid} -m -s /bin/bash precice

# set locale
# Set locale
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_NUMERIC en_US.UTF-8
ENV LC_ALL en_US.UTF-8


# Install PETSc from source
# Install PETSc v3.12.5 from source (apt version too low)
WORKDIR /petsc
RUN wget -nv 'https://www.mcs.anl.gov/petsc/mirror/release-snapshots/petsc-3.12.5.tar.gz' -O - | tar xz && \
cd petsc-3.12.5 && \
./configure && \
make all test
cd petsc-3.12.5 && \
./configure && \
make all test
RUN chown -R precice:precice /petsc

# Rebuild image if force_rebuild after that command
USER precice

# Rebuild image from here on if `force_rebuild` is enabled
ARG CACHEBUST

USER precice
WORKDIR /home/precice
# Setting some environment variables for installing preCICE
# Set some environment variables for installing preCICE
ENV CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/usr/include/eigen3" \
CPATH="/usr/include/eigen3:${CPATH}" \
PETSC_DIR="/petsc/petsc-3.12.5" \
PETSC_ARCH="arch-linux2-c-debug" \
LD_LIBRARY_PATH="/petsc/petsc-3.12.5/arch-linux2-c-debug/lib:${LD_LIBRARY_PATH}" \
PKG_CONFIG_PATH="/petsc/petsc-3.12.5/arch-linux2-c-debug/lib/pkgconfig:${PKG_CONFIG_PATH}"


# Building preCICE
# Build preCICE
WORKDIR /home/precice
ARG branch=develop
RUN git clone --depth 1 --branch $branch https://github.com/precice/precice.git /home/precice/precice
WORKDIR /home/precice/precice

# 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
# cmake -DPRECICE_PETScMapping=yes -DPRECICE_MPICommunication=yes -DPRECICE_PythonActions=no -DCMAKE_CXX_COMPILER=mpicxx -j2 /precice
# Set parameters for the build, these can be overwritten by the docker build command
# Example: `docker build --build-arg petsc_para=yes --build-arg mpi_para=yes .`
ARG petsc_para=no
ARG mpi_para=yes
ARG python_para=no

# Build preCICE and clean-up generated object files
# Build preCICE and clean-up generated object files afterwards
RUN mkdir /home/precice/precice-build && \
cd /home/precice/precice-build && \
mkdir /home/precice/precice-install && \
Expand All @@ -86,7 +89,7 @@ RUN mkdir /home/precice/precice-build && \
make install && \
rm -r /home/precice/precice-build

# Setting preCICE environment variables
# Set preCICE environment variables
ENV PRECICE_ROOT="/home/precice/precice" \
PKG_CONFIG_PATH="/home/precice/precice-install/lib/pkgconfig:${PKG_CONFIG_PATH}" \
LD_LIBRARY_PATH="/home/precice/precice-install/lib:${LD_LIBRARY_PATH}" \
Expand Down
Loading