Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a13643c
Feature: Add docker container for clang-based compilation
spenke91 Jan 5, 2026
c13db0b
Actually push the new image
spenke91 Jan 5, 2026
be7b618
Update to Ubuntu 22.04
spenke91 Jan 5, 2026
4d09f03
Add cmake and ninja-build packages
spenke91 Jan 5, 2026
2aab7d7
Avoid installing gcc in clang image
spenke91 Jan 6, 2026
85e2be9
Install ca-certificates
spenke91 Jan 6, 2026
e662396
Removed --no-install-recommends again
spenke91 Jan 6, 2026
e170395
Try building VTK with Clang
spenke91 Jan 13, 2026
6706765
Use Clang for VTK build
spenke91 Jan 13, 2026
b8b892d
Add some more vtk dependencies
spenke91 Jan 13, 2026
8b87768
Add vtk install path
spenke91 Jan 13, 2026
674c76f
Use make for VTK library
spenke91 Jan 13, 2026
065fa47
Try again
spenke91 Jan 13, 2026
da9be58
Try again
spenke91 Jan 13, 2026
367a16f
Add HDF5 and NetCDF
spenke91 Jan 13, 2026
3870bae
Use ninja instead of make for cmake-based build chains
spenke91 Jan 13, 2026
c2b7a5b
Try other hdf5 url
spenke91 Jan 13, 2026
1880f6c
Fix typo
spenke91 Jan 13, 2026
4600074
Try again
spenke91 Jan 13, 2026
7adcc16
More fixes
spenke91 Jan 13, 2026
50212fe
Remove whitespace.
spenke91 Jan 13, 2026
1033e0e
Try clean build dirs for cmake builds
spenke91 Jan 13, 2026
1c87fc6
Change order and try different flags for OCCT
spenke91 Jan 14, 2026
1b22c1a
Try more OCCT flags
spenke91 Jan 14, 2026
372e2a7
Try again
spenke91 Jan 14, 2026
eea4627
Try again
spenke91 Jan 14, 2026
5ae4c6f
Try again
spenke91 Jan 14, 2026
2430cbf
Try again
spenke91 Jan 14, 2026
9e8d9ba
Try libtbb2
spenke91 Jan 14, 2026
373806f
Add PATH IGNOREs again
spenke91 Jan 14, 2026
ce340e2
Try stuff
spenke91 Jan 14, 2026
908f79e
Trying more desperate stuff
spenke91 Jan 14, 2026
c2b9cf2
typos
spenke91 Jan 14, 2026
006027f
Getting desperate
spenke91 Jan 14, 2026
9e7ec75
Test without TBB
spenke91 Jan 14, 2026
75f54c8
Try with TBB again
spenke91 Jan 14, 2026
57bc8a0
Try pushing the image
spenke91 Jan 14, 2026
b434792
Build container again, but only with OCC
spenke91 Jan 15, 2026
d9c37e8
For debugging, try without TBB
spenke91 Jan 15, 2026
199146d
Try with TBB again
spenke91 Jan 15, 2026
31ac1fe
Fix typo
spenke91 Jan 15, 2026
1e0ac74
Build without TBB again
spenke91 Jan 16, 2026
96ed88b
Rearranged some paths
spenke91 Jan 16, 2026
e0c83e8
Try HDF5 and NETCDF in custom version
spenke91 Jan 16, 2026
da5d00c
Major update
spenke91 Jan 16, 2026
17660f2
Try again
spenke91 Jan 16, 2026
4a4bb70
Fix typo
spenke91 Jan 16, 2026
5768547
Added new dockerfile
spenke91 Jan 16, 2026
ee9cd5d
Fix typo
spenke91 Jan 16, 2026
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
131 changes: 75 additions & 56 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,72 +9,91 @@ on:
workflow_dispatch:

jobs:
t8_dependencies:
t8_clanglight_dependencies:
strategy:
fail-fast: false
fail-fast: true
matrix:
include:
include:
- os: ubuntu-latest
target_os: ubuntu
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Build the docker image
run: |
docker build --tag dlramr/t8code-${{ matrix.target_os }}:t8-dependencies dependencies/${{ matrix.target_os }}
docker build --tag dlramr/t8code-${{ matrix.target_os }}:t8-clanglight-dependencies clang_light/${{ matrix.target_os }}
- name: Push the docker image
env: # Set the secret as an input
docker_token: ${{ secrets.DOCKER_TOKEN }}
run: |
echo ${{ env.docker_token }} | docker login --username dlramr --password-stdin
docker push dlramr/t8code-${{ matrix.target_os }}:t8-dependencies
with_t8code:
needs: t8_dependencies
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target_os: ubuntu
tag: t8-1.0.0
t8code_version: 1.0.0
- os: ubuntu-latest
target_os: ubuntu
tag: t8-1.1.0
t8code_version: 1.1.0
- os: ubuntu-latest
target_os: ubuntu
tag: t8-1.2.0
t8code_version: 1.2.0
- os: ubuntu-latest
target_os: ubuntu
tag: t8-1.3.0
t8code_version: 1.3.0
- os: ubuntu-latest
target_os: ubuntu
tag: t8-1.4.1
t8code_version: 1.4.1
- os: ubuntu-latest
target_os: ubuntu
tag: t8-1.5.0
t8code_version: 1.5.0
- os: ubuntu-latest
target_os: ubuntu
tag: t8-1.6.1
t8code_version: 1.6.1
- os: ubuntu-latest
target_os: ubuntu
tag: t8-2.0.0
t8code_version: 2.0.0
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Build the docker image
run: |
docker build --build-arg t8code_version=${{ matrix.t8code_version}} --tag dlramr/t8code-${{ matrix.target_os }}:${{ matrix.tag }} t8code/${{ matrix.target_os }}
- name: Push the docker image
env: # Set the secret as an input
docker_token: ${{ secrets.DOCKER_TOKEN }}
run: |
echo ${{ env.docker_token }} | docker login --username dlramr --password-stdin
docker push dlramr/t8code-${{ matrix.target_os }}:${{ matrix.tag }}
docker push dlramr/t8code-${{ matrix.target_os }}:t8-clanglight-dependencies
# t8_dependencies:
# strategy:
# fail-fast: false
# matrix:
# include:
# - os: ubuntu-latest
# target_os: ubuntu
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v2
# - name: Build the docker image
# run: |
# docker build --tag dlramr/t8code-${{ matrix.target_os }}:t8-dependencies dependencies/${{ matrix.target_os }}
# - name: Push the docker image
# env: # Set the secret as an input
# docker_token: ${{ secrets.DOCKER_TOKEN }}
# run: |
# echo ${{ env.docker_token }} | docker login --username dlramr --password-stdin
# docker push dlramr/t8code-${{ matrix.target_os }}:t8-dependencies
# with_t8code:
# needs: t8_dependencies
# strategy:
# fail-fast: false
# matrix:
# include:
# - os: ubuntu-latest
# target_os: ubuntu
# tag: t8-1.0.0
# t8code_version: 1.0.0
# - os: ubuntu-latest
# target_os: ubuntu
# tag: t8-1.1.0
# t8code_version: 1.1.0
# - os: ubuntu-latest
# target_os: ubuntu
# tag: t8-1.2.0
# t8code_version: 1.2.0
# - os: ubuntu-latest
# target_os: ubuntu
# tag: t8-1.3.0
# t8code_version: 1.3.0
# - os: ubuntu-latest
# target_os: ubuntu
# tag: t8-1.4.1
# t8code_version: 1.4.1
# - os: ubuntu-latest
# target_os: ubuntu
# tag: t8-1.5.0
# t8code_version: 1.5.0
# - os: ubuntu-latest
# target_os: ubuntu
# tag: t8-1.6.1
# t8code_version: 1.6.1
# - os: ubuntu-latest
# target_os: ubuntu
# tag: t8-2.0.0
# t8code_version: 2.0.0
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v2
# - name: Build the docker image
# run: |
# docker build --build-arg t8code_version=${{ matrix.t8code_version}} --tag dlramr/t8code-${{ matrix.target_os }}:${{ matrix.tag }} t8code/${{ matrix.target_os }}
# - name: Push the docker image
# env: # Set the secret as an input
# docker_token: ${{ secrets.DOCKER_TOKEN }}
# run: |
# echo ${{ env.docker_token }} | docker login --username dlramr --password-stdin
# docker push dlramr/t8code-${{ matrix.target_os }}:${{ matrix.tag }}
208 changes: 208 additions & 0 deletions clang/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
FROM ubuntu:22.04
LABEL org.opencontainers.image.authors="Thomas Spenke <thomas.spenke@dlr.de>"
LABEL Description="Ubuntu 22.04 with clang and openmpi setup to be uses with t8code"
SHELL ["/bin/bash", "-c"]

ARG vtk_version=9.1.0
ARG vtk_library_version=9.1

ENV DEBIAN_FRONTEND=noninteractive
ENV LIBRARY_PATH=/usr/local/lib
ENV LD_LIBRARY_PATH=/usr/local/lib
ENV CUSTOM_CLANG_INSTALL=/custom_clang_install
ENV CUSTOM_CLANG_BUILD=/custom_clang_build

#######################################################
# Install software requirements and build tools #
#######################################################

# Install required packages (without recommends to avoid gcc).
RUN apt-get update -y && apt-get upgrade -y; \
apt-get install -y wget \
sudo \
tar \
lld \
make \
cmake \
ninja-build \
libc6-dev \
libc++-dev \
libc++abi-dev \
pkg-config \
git \
clang \
ca-certificates \
# Added for vtk library
libgl1-mesa-dev libx11-dev libxmu-dev libxi-dev \
libxt-dev libxrender-dev libxrandr-dev \
libwayland-dev wayland-protocols \
libfontconfig1-dev libfreetype6-dev \
libxkbcommon-dev libdrm-dev \
# Added for OpenCASCADE
libtbb-dev \
libpng-dev libjpeg-dev libtiff-dev \
libopenexr-dev \
# Added for netcdf
autoconf automake libtool m4 \
zlib1g-dev libcurl4-openssl-dev

# Required for OpenCASCADE
RUN apt-get update && apt-get install -y --no-install-recommends \
tcl-dev \
tk-dev \
libtbb-dev \
libtbb2


# Prepare folders once
RUN rm -rf $CUSTOM_CLANG_BUILD && mkdir -p $CUSTOM_CLANG_BUILD && \
rm -rf $CUSTOM_CLANG_INSTALL && mkdir -p $CUSTOM_CLANG_INSTALL

# Export openmpi path to later use it in the github workflow.
ENV OMPI_INSTALL_PATH=$CUSTOM_CLANG_INSTALL/openmpi_clang

# Install openmpi with clang compiler.
# TODO: Make version an ARG as in vtk?
RUN cd $CUSTOM_CLANG_BUILD; \
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.6.tar.gz; \
tar xf openmpi-4.1.6.tar.gz; \
cd openmpi-4.1.6; \
CC=clang CXX=clang++ ./configure --prefix=$OMPI_INSTALL_PATH; \
make -j$(nproc); \
make install

# Add OpenMPI to paths and environment variables
ENV PATH="$OMPI_INSTALL_PATH/bin:$PATH"
ENV LIBRARY_PATH="$OMPI_INSTALL_PATH/lib:$LIBRARY_PATH"
ENV LD_LIBRARY_PATH="$OMPI_INSTALL_PATH/lib:$LD_LIBRARY_PATH"
ENV CPATH="$OMPI_INSTALL_PATH/include:$CPATH"


# Install OpenCASCADE
ENV OCCT_INSTALL_PATH=$CUSTOM_CLANG_INSTALL/occt_clang
RUN cd $CUSTOM_CLANG_BUILD; \
git clone https://github.com/Open-Cascade-SAS/OCCT.git; \
cd OCCT; \
git checkout V7_5_1; \
# configure build with cmake
rm -rf build && mkdir -p build && cd build ; \
cmake .. \
-DCMAKE_C_COMPILER=${OMPI_INSTALL_PATH}/bin/mpicc \
-DCMAKE_CXX_COMPILER=${OMPI_INSTALL_PATH}/bin/mpicxx \
-DCMAKE_INSTALL_PREFIX=${OCCT_INSTALL_PATH} \
-DBUILD_DRAW=OFF \
-DUSE_TCL=OFF \
-DUSE_TK=OFF \
-D3RDPARTY_TCL_INCLUDE_DIR:PATH=IGNORE \
-D3RDPARTY_TCL_LIBRARY:FILEPATH=IGNORE \
-D3RDPARTY_TCL_LIBRARY_DIR:PATH=IGNORE \
-D3RDPARTY_TK_INCLUDE_DIR:PATH=IGNORE \
-D3RDPARTY_TK_LIBRARY:FILEPATH=IGNORE \
-D3RDPARTY_TK_LIBRARY_DIR:PATH=IGNORE \
-D3RDPARTY_TBB_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-D3RDPARTY_TBBMALLOC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \
-DUSE_TBB=OFF \
-DTBB_INCLUDE_DIRS=/usr/include \
-DTBB_LIBRARIES="/usr/lib/x86_64-linux-gnu/libtbb.so;/usr/lib/x86_64-linux-gnu/libtbbmalloc.so" \
-DBUILD_LIBRARY_TYPE=Shared \
-DUSE_FREETYPE=ON \
-DUSE_OPENGL=ON \
-GNinja; \
# build and install OpenCASCADE
ninja -j4; \
ninja install

# Add OpenCASCADE to paths and environment variables
ENV PATH="$OCCT_INSTALL_PATH/bin:$PATH"
ENV LIBRARY_PATH="$OCCT_INSTALL_PATH/lib:$LIBRARY_PATH"
ENV LD_LIBRARY_PATH="$OCCT_INSTALL_PATH/lib:$LD_LIBRARY_PATH"
ENV CPATH="$OCCT_INSTALL_PATH/include:$CPATH"


# Install HDF5
ENV HDF5_INSTALL_PATH=$CUSTOM_CLANG_INSTALL/hdf5_clang
RUN cd $CUSTOM_CLANG_BUILD; \
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.7/src/hdf5-1.10.7.tar.gz; \
tar xf hdf5-1.10.7.tar.gz; \
cd hdf5-1.10.7; \
rm -rf build && mkdir -p build && cd build; \
cmake .. \
-DCMAKE_INSTALL_PREFIX=${HDF5_INSTALL_PATH} \
-DCMAKE_C_COMPILER=${OMPI_INSTALL_PATH}/bin/mpicc \
-DCMAKE_CXX_COMPILER=${OMPI_INSTALL_PATH}/bin/mpicxx \
-DBUILD_SHARED_LIBS=ON \
-DHDF5_ENABLE_Z_LIB_SUPPORT=ON \
-DZLIB_INCLUDE_DIR=/usr/include \
-DZLIB_LIBRARY=/usr/lib/x86_64-linux-gnu/libz.so \
-GNinja; \
ninja -j4 ; \
ninja install

# Add HDF5 to paths and environment variables
ENV PATH="$HDF5_INSTALL_PATH/bin:$PATH"
ENV LIBRARY_PATH="$HDF5_INSTALL_PATH/lib:$LIBRARY_PATH"
ENV LD_LIBRARY_PATH="$HDF5_INSTALL_PATH/lib:$LD_LIBRARY_PATH"
ENV CPATH="$HDF5_INSTALL_PATH/include:$CPATH"


# Install netcdf-c
ENV NETCDF_INSTALL_PATH=$CUSTOM_CLANG_INSTALL/netcdf_clang
# RUN wget https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.9.2.tar.gz; \
# tar xf v4.9.2.tar.gz; \
# cd netcdf-c-4.9.2; \
RUN cd $CUSTOM_CLANG_BUILD; \
wget https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.8.1.tar.gz -O netcdf-c-4.8.1.tar.gz; \
tar xf netcdf-c-4.8.1.tar.gz; \
cd netcdf-c-4.8.1; \
rm -rf build && mkdir -p build && cd build; \
cmake .. \
-DCMAKE_INSTALL_PREFIX=${NETCDF_INSTALL_PATH} \
-DCMAKE_C_COMPILER=${OMPI_INSTALL_PATH}/bin/mpicc \
-DCMAKE_CXX_COMPILER=${OMPI_INSTALL_PATH}/bin/mpicxx \
-DBUILD_SHARED_LIBS=ON \
-DENABLE_TESTS=OFF \
-GNinja; \
ninja -j4; \
ninja install

# Add NetCDF to paths and environment variables
ENV PATH="$NETCDF_INSTALL_PATH/bin:$PATH"
ENV LIBRARY_PATH="$NETCDF_INSTALL_PATH/lib:$LIBRARY_PATH"
ENV LD_LIBRARY_PATH="$NETCDF_INSTALL_PATH/lib:$LD_LIBRARY_PATH"
ENV CPATH="$NETCDF_INSTALL_PATH/include:$CPATH"

ENV VTK_INSTALL_PATH=$CUSTOM_CLANG_INSTALL/vtk_clang

# Install vtk library with clang compiler
RUN cd $CUSTOM_CLANG_BUILD; \
git clone https://github.com/Kitware/VTK.git; \
cd VTK; \
git checkout v${vtk_version}; \
# configure build with cmake
rm -rf build && mkdir -p build && cd build ; \
cmake .. \
-DCMAKE_C_COMPILER=${OMPI_INSTALL_PATH}/bin/mpicc \
-DCMAKE_CXX_COMPILER=${OMPI_INSTALL_PATH}/bin/mpicxx \
-DCMAKE_INSTALL_PREFIX=${VTK_INSTALL_PATH} \
-DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DVTK_USE_MPI=ON \
-DVTK_GROUP_ENABLE_MPI=YES \
-GNinja; \
# build and install vtk
ninja -j4; \
ninja install -j4

# Add NetCDF to paths and environment variables
ENV PATH="$VTK_INSTALL_PATH/bin:$PATH"
ENV LIBRARY_PATH="$VTK_INSTALL_PATH/lib:$LIBRARY_PATH"
ENV LD_LIBRARY_PATH="$VTK_INSTALL_PATH/lib:$LD_LIBRARY_PATH"
ENV CPATH="$VTK_INSTALL_PATH/include:$CPATH"

# Clean up build directories
RUN rm -rf $CUSTOM_CLANG_BUILD

# BACKUP lines
# -DHDF5_ROOT=${HDF5_INSTALL_PATH} \
# -DNetCDF_ROOT=${NETCDF_INSTALL_PATH} \
# -DHDF5_ROOT=${HDF5_INSTALL_PATH} \
Loading