Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f1e0142
Add Dockerfile snippet for OpenCASCADE installation
sshawn9 Apr 27, 2026
2c39c2a
Add C# bindings Dockerfile snippet
sshawn9 Apr 27, 2026
43df53d
Add Dockerfile snippet to enable Chrono::DEM with CUDA support
sshawn9 Apr 27, 2026
16f5ca6
Add Dockerfile snippet to enable Chrono::FMI with shared libraries
sshawn9 Apr 27, 2026
276c75f
Add Dockerfile snippet to enable Chrono::FSI with SPH and TDPF backends
sshawn9 Apr 27, 2026
c26c6a0
Add Dockerfile snippet to install dependencies for Chrono::Modal and …
sshawn9 Apr 27, 2026
de29344
Add Dockerfile snippet to install dependencies for Chrono::Multicore …
sshawn9 Apr 27, 2026
ecd1f8e
Add Dockerfile snippet to install dependencies for Chrono::MUMPS and …
sshawn9 Apr 27, 2026
c22c2e1
Add Dockerfile snippet to install Intel oneAPI MKL for Chrono::Pardis…
sshawn9 Apr 27, 2026
c6ae230
Add Dockerfile snippet to enable Chrono::Peridynamics module
sshawn9 Apr 27, 2026
548c97c
Add Dockerfile snippet to enable Chrono::Postprocess module
sshawn9 Apr 27, 2026
4cd639d
Add Dockerfile snippets for additional Chrono modules and dependencies
sshawn9 Apr 28, 2026
540fcc0
Update CUDA version to 12-9 in docker-compose.yml
sshawn9 Apr 28, 2026
1a042a6
Enhance Dockerfile: Update CUDA architecture handling and improve bui…
sshawn9 Apr 28, 2026
0442b61
Add release Dockerfile for standalone Chrono image build
sshawn9 Apr 28, 2026
6428f1e
Update LD_LIBRARY_PATH in CUDA Dockerfile to include lib64 directory
sshawn9 Apr 28, 2026
4f0336e
Fix CMakeLists.txt: Enclose CUDA_ARCHITECTURES in quotes for Chrono m…
sshawn9 Apr 28, 2026
d190082
Fix environment variable name: Change PRE_BUILD_COMMANDS to PRE_BUILD…
sshawn9 Apr 28, 2026
0752776
Add CMAKE_BUILD_PARALLEL_LEVEL argument to Dockerfiles for build para…
sshawn9 Apr 28, 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
2 changes: 1 addition & 1 deletion contrib/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
APT_DEPENDENCIES: "vim cmake-curses-gui"
USER_SHELL_ADD_ONS: "alias python=python3"

CUDA_VERSION: "12-2"
CUDA_VERSION: "12-9"
ROS_DISTRO: "humble"
OPTIX_SCRIPT: "data/NVIDIA-OptiX-SDK-9.0.0-linux64-x86_64.sh" # Get optix script at https://developer.nvidia.com/designworks/optix/downloads/legacy
volumes:
Expand Down
42 changes: 42 additions & 0 deletions contrib/docker/release.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# syntax = devthefuture/dockerfile-x
# Standalone Chrono image build entrypoint.
#
# Usage:
# 1. Download the OptiX installer required by Chrono::Sensor and place it at:
# contrib/docker/data/NVIDIA-OptiX-SDK-9.0.0-linux64-x86_64.sh
# 2. Build from contrib/docker so the dockerfile-x INCLUDE paths and
# OPTIX_SCRIPT path are resolved relative to this directory:
#
# docker build -f release.dockerfile -t chrono/chrono:release .
#
# Common overrides:
# docker build -f release.dockerfile -t chrono/chrono:release \
# --build-arg CHRONO_CUDA_ARCHITECTURES="80;86;89" .
# docker build -f release.dockerfile -t chrono/chrono:release \
# --build-arg CMAKE_BUILD_PARALLEL_LEVEL=4 .
#
# This mirrors the docker-compose dev build defaults while allowing a direct
# docker build invocation.

ARG PROJECT=chrono
ARG IMAGE_BASE=ubuntu
ARG IMAGE_TAG=22.04
ARG USER_GROUPS="dialout video"
ARG PIP_REQUIREMENTS=black
ARG APT_DEPENDENCIES="vim cmake-curses-gui"
ARG USER_SHELL_ADD_ONS="alias python=python3"
ARG CUDA_VERSION=12-9
ARG ROS_DISTRO=humble
ARG OPTIX_SCRIPT=data/NVIDIA-OptiX-SDK-9.0.0-linux64-x86_64.sh

# Base user and OS setup
INCLUDE ./common/base.dockerfile

# Chrono and module snippets
INCLUDE ./snippets/chrono.dockerfile

# Common shell/package finishing steps
INCLUDE ./common/common.dockerfile

# Final user, working directory, and shell
INCLUDE ./common/final.dockerfile
64 changes: 64 additions & 0 deletions contrib/docker/snippets/ch_cascade.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SPDX-License-Identifier: MIT
# This snippet installs OpenCASCADE for Chrono::Cascade (STEP/IGES CAD import).
#
# Note on OpenCASCADE version and discovery:
# The Chrono::Cascade installation guide states that the Chrono API is
# compatible with OpenCASCADE OCCT 7.9.2 and 7.9.3, and asks users to set
# OpenCASCADE_DIR to the directory containing OpenCASCADEConfig.cmake if CMake
# cannot find it automatically. Distribution packages can lag behind the
# versions supported by the Chrono guide, so this snippet builds a supported
# upstream OCCT tag instead of relying on the version provided by the base
# image.
#
# This mirrors the current Chrono CMake code path:
#
# - src/chrono_cascade/CMakeLists.txt:
# * calls find_package(OpenCASCADE REQUIRED CONFIG)
# * consumes the package variables exported by OpenCASCADEConfig.cmake
# - contrib/build-scripts/linux/buildChrono.sh:
# * uses a supported OpenCASCADE 7.9.x install directory
# * passes OpenCASCADE_DIR=<prefix>/<lib>/cmake/opencascade
#
# Default to OCCT 7.9.3, the newest supported maintenance release listed by
# the Chrono::Cascade guide, while keeping the tag overridable for reproducible
# rebuilds against 7.9.2 if needed.
#
# Install OCCT under ${PACKAGE_DIR}/opencascade, pass its package config
# directory explicitly, and add its shared-library directory to LD_LIBRARY_PATH
# as recommended by the Chrono::Cascade guide for Linux runtime use.

ARG PACKAGE_DIR
ARG USERSHELLPROFILE
ARG OPENCASCADE_TAG="V7_9_3"

RUN sudo apt update && \
sudo apt install --no-install-recommends -y \
libfreetype-dev \
libx11-dev \
libxext-dev \
libxmu-dev \
libxi-dev \
libgl1-mesa-dev \
libglu1-mesa-dev && \
sudo apt clean && sudo apt autoremove -y && sudo rm -rf /var/lib/apt/lists/*

RUN tmpdir="$(mktemp -d)" && \
git clone --depth 1 --branch ${OPENCASCADE_TAG} https://github.com/Open-Cascade-SAS/OCCT.git "$tmpdir/occt" && \
cmake -S "$tmpdir/occt" -B "$tmpdir/occt-build" -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PACKAGE_DIR}/opencascade \
-DBUILD_MODULE_Draw=OFF \
-DBUILD_SAMPLES_QT=OFF \
-DBUILD_Inspector=OFF \
-DUSE_TBB=OFF && \
cmake --build "$tmpdir/occt-build" && \
cmake --install "$tmpdir/occt-build" && \
rm -rf "$tmpdir" && \
test -f ${PACKAGE_DIR}/opencascade/lib/cmake/opencascade/OpenCASCADEConfig.cmake

RUN echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${PACKAGE_DIR}/opencascade/lib" >> ${USERSHELLPROFILE}

# Update CMake options
ENV CMAKE_OPTIONS="${CMAKE_OPTIONS} \
-DCH_ENABLE_MODULE_CASCADE=ON \
-DOpenCASCADE_DIR=${PACKAGE_DIR}/opencascade/lib/cmake/opencascade"
31 changes: 31 additions & 0 deletions contrib/docker/snippets/ch_csharp.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SPDX-License-Identifier: MIT
# This snippet enables Chrono::CSharp (SWIG-generated C# bindings).
#
# Note on C# bindings:
# The Chrono::CSharp installation guide requires SWIG 4.0 or newer and enables
# the module with CH_ENABLE_MODULE_CSHARP. SWIG is installed by the shared
# chrono.dockerfile dependency layer, so this snippet only needs to enable the
# module.
#
# This mirrors the current Chrono CMake code path:
#
# - contrib/docker/snippets/chrono.dockerfile:
# * installs swig with the common Chrono build dependencies
# - src/chrono_swig/chrono_csharp/CMakeLists.txt:
# * enables the module with CH_ENABLE_MODULE_CSHARP
# * calls find_package(SWIG REQUIRED COMPONENTS csharp)
# * generates native Chrono_csharp_* libraries and SWIG-generated .cs
# sources for enabled Chrono components
# * installs the C# template project
# - cmake/ChronoConfig.cmake.in:
# * exposes Chrono_CSHARP_AVAILABLE
# * collects CHRONO_CSHARP_SOURCES for requested Chrono C# components
#
# Do not enable CH_USE_CSHARP_WRAPPER in this image. That optional target
# requires the dotnet CLI to publish a single ready-to-run
# chrono_csharp_wrapper.dll, which would pull the .NET SDK into the image. The
# default SWIG-generated native libraries and .cs sources are sufficient for a
# general Chrono development image and match the documented C# module workflow.

ENV CMAKE_OPTIONS="${CMAKE_OPTIONS} \
-DCH_ENABLE_MODULE_CSHARP=ON"
39 changes: 39 additions & 0 deletions contrib/docker/snippets/ch_dem.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# SPDX-License-Identifier: MIT
# This snippet enables Chrono::DEM (GPU-based discrete element method).
# Requires CUDA (provided by cuda.dockerfile, which must be included before this snippet).
#
# Note on DEM CUDA requirements:
# The Chrono::DEM installation guide requires CUDA to build applications based
# on this module and an NVIDIA GPU at runtime. It reports testing on Linux and
# Windows with CUDA 12.3 and 12.8. This Docker image uses the shared
# cuda.dockerfile snippet and currently defaults to CUDA 12.9 because
# Chrono::FSI-SPH, enabled in the same full-featured image, documents CUDA 12.9
# as its required toolkit version.
#
# This mirrors the current Chrono CMake code path:
#
# - src/chrono_dem/CMakeLists.txt:
# * enables the module with CH_ENABLE_MODULE_DEM
# * requires CHRONO_CUDA_FOUND
# * requires Eigen >= 3.3.6
# * builds the optional DEM VSG interface when Chrono::VSG is enabled
# - src/CMakeLists.txt:
# * detects CUDAToolkit and sets CHRONO_CUDA_FOUND
# * propagates CHRONO_CUDA_VERSION to generated configuration headers
# - cmake/ChronoConfig.cmake.in:
# * reports CUDA requirements to Chrono::DEM consumers
# * propagates Chrono_dem and, when available, Chrono_dem_vsg
#
# Do not patch DEM CUDA sources here. NVIDIA CCCL/libcu++ documents
# cuda::std::terminate() as the supported device-side termination API and maps
# it to __trap(). The CCCL migration guide also directs users to replace legacy
# CUB/Thrust trap helpers with cuda::std::terminate(). If a future Chrono
# revision or CUDA toolkit exposes a source/API mismatch, the fix should be made
# in the DEM source or the CUDA version pin, rather than rewriting cloned source
# files from this Docker snippet.

# Verify cuda is installed, exit if not
RUN if [ ! -d "/usr/local/cuda" ]; then echo "CUDA is required for Chrono::DEM."; exit 1; fi

ENV CMAKE_OPTIONS="${CMAKE_OPTIONS} \
-DCH_ENABLE_MODULE_DEM=ON"
32 changes: 32 additions & 0 deletions contrib/docker/snippets/ch_fmi.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SPDX-License-Identifier: MIT
# This snippet enables Chrono::FMI (FMI 2.0/3.0 co-simulation interface).
#
# Note on FMI support in this Docker image:
# The Chrono::FMI installation guide explains that full FMU export support is
# easiest to satisfy with static Chrono libraries. It explicitly instructs users
# to configure Chrono with BUILD_SHARED_LIBRARIES=OFF and currently recommends
# not enabling GPU-based Chrono modules in an FMI export build. This Docker image
# is a full-featured shared-library image and also enables CUDA-based modules
# such as Chrono::Sensor, Chrono::FSI-SPH, and Chrono::DEM, so full FMU export
# support is intentionally left disabled here.
#
# This mirrors the current Chrono CMake code path:
#
# - src/chrono_fmi/CMakeLists.txt:
# * enables the module with CH_ENABLE_MODULE_FMI
# * disables FMU_EXPORT_SUPPORT automatically when BUILD_SHARED_LIBS is ON
# * uses the in-tree src/chrono_thirdparty/fmu-forge by default
# * still builds the Chrono_fmi library for FMU import support
# - src/CMakeLists.txt:
# * defaults BUILD_SHARED_LIBS to ON
# * adds chrono_fmi before the other optional modules
# - cmake/ChronoConfig.cmake.in:
# * exposes Chrono_FMI_AVAILABLE and fmu-forge headers to consumers
#
# Make the shared-library intent explicit by setting FMU_EXPORT_SUPPORT=OFF.
# Users who need FMU export should use a separate static Chrono configuration
# with the module set recommended by the Chrono::FMI installation guide.

ENV CMAKE_OPTIONS="${CMAKE_OPTIONS} \
-DCH_ENABLE_MODULE_FMI=ON \
-DFMU_EXPORT_SUPPORT=OFF"
50 changes: 50 additions & 0 deletions contrib/docker/snippets/ch_fsi.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# SPDX-License-Identifier: MIT
# This snippet enables Chrono::FSI (Fluid-Solid Interaction) including SPH and TDPF backends.
# Requires CUDA (provided by cuda.dockerfile, which must be included before this snippet).
#
# Note on FSI dependencies:
# The Chrono::FSI installation guide describes two submodules:
# Chrono::FSI-SPH and Chrono::FSI-TDPF. For FSI-SPH, the guide requires a CUDA
# installation and currently specifies CUDA 12.9, with CUDA 13 not yet supported.
# For FSI-TDPF, the guide requires HDF5 support and CH_ENABLE_HDF5=ON.
#
# This mirrors the current Chrono CMake code path:
#
# - src/chrono_fsi/CMakeLists.txt:
# * builds the generic Chrono_fsi interface library
# * configures the sph and tdpf subdirectories
# - src/chrono_fsi/sph/CMakeLists.txt:
# * enables CH_ENABLE_MODULE_FSI_SPH when CH_ENABLE_MODULE_FSI is ON
# * requires Eigen >= 3.3.6 and CHRONO_CUDA_FOUND
# * optionally enables CH_USE_SPH_DOUBLE
# - src/chrono_fsi/tdpf/CMakeLists.txt:
# * enables CH_ENABLE_MODULE_FSI_TDPF when CH_ENABLE_MODULE_FSI is ON
# * requires Eigen >= 3.3.6 and HDF5_FOUND
# - cmake/ChronoConfig.cmake.in:
# * reports CUDA/Thrust requirements to Chrono::FSI_SPH consumers
# * propagates Chrono_fsi, Chrono_fsisph, and Chrono_fsitdpf libraries
#
# Keep both submodules enabled in this image and install libhdf5-dev for TDPF.
# The CUDA toolkit version is selected by the shared cuda.dockerfile snippet;
# when FSI-SPH is enabled, use CUDA_VERSION=12-9 to match the installation
# guide.
#
# Do not set CH_USE_SPH_DOUBLE here. The installation guide describes double
# precision as optional and notes that the single-precision FSI solver has been
# tested to provide a similar accuracy level with nearly a 2x performance
# improvement. Leaving CH_USE_SPH_DOUBLE at its default OFF value is therefore
# the better default for a general-purpose Docker image.

# Verify cuda is installed, exit if not
RUN if [ ! -d "/usr/local/cuda" ]; then echo "CUDA is required for Chrono::FSI."; exit 1; fi

# HDF5 is required by the TDPF submodule
RUN sudo apt update && \
sudo apt install --no-install-recommends -y libhdf5-dev && \
sudo apt clean && sudo apt autoremove -y && sudo rm -rf /var/lib/apt/lists/*

ENV CMAKE_OPTIONS="${CMAKE_OPTIONS} \
-DCH_ENABLE_MODULE_FSI=ON \
-DCH_ENABLE_MODULE_FSI_SPH=ON \
-DCH_ENABLE_MODULE_FSI_TDPF=ON \
-DCH_ENABLE_HDF5=ON"
38 changes: 38 additions & 0 deletions contrib/docker/snippets/ch_modal.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-License-Identifier: MIT
# This snippet installs necessary dependencies for Chrono::Modal
# Builds Spectra (eigenvalue problem solver) from source.
# Chrono uses the Krylov-Schur solver, available only on the Spectra develop branch.
#
# Note on Spectra CMake variables:
# The public Chrono::Modal installation guide may refer to SpectraINCLUDE_DIR.
# In this source tree, however, the active finder documents and consumes the
# lower-case variables below:
#
# - cmake/FindSpectra.cmake:
# * spectra_DIR: directory containing the Spectra package config script
# * spectra_INCLUDE_DIR: directory containing the subdirectory "Spectra/"
# - src/chrono_modal/CMakeLists.txt:
# * calls find_package(Spectra REQUIRED)
# * reports that users should set spectra_INCLUDE_DIR or spectra_DIR if
# Spectra cannot be found
# - contrib/build-scripts/linux/buildSpectra.sh:
# * installs Spectra's CMake package files under share/spectra/cmake
# * installs Spectra headers under include/Spectra
#
# Pass both the package config directory and the include directory explicitly.
# This follows the current CMake code path and keeps configure-time discovery
# deterministic even if the documentation still mentions the older variable.

ARG CHRONO_DIR
ARG PACKAGE_DIR
ARG USERSHELLPROFILE

# Build Spectra
RUN cd ${CHRONO_DIR}/contrib/build-scripts/linux/ && \
bash buildSpectra.sh ${PACKAGE_DIR}/spectra

# Update CMake options
ENV CMAKE_OPTIONS="${CMAKE_OPTIONS} \
-DCH_ENABLE_MODULE_MODAL=ON \
-Dspectra_DIR=${PACKAGE_DIR}/spectra/share/spectra/cmake \
-Dspectra_INCLUDE_DIR=${PACKAGE_DIR}/spectra/include"
37 changes: 37 additions & 0 deletions contrib/docker/snippets/ch_multicore.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-License-Identifier: MIT
# This snippet installs necessary dependencies for Chrono::Multicore
# Builds Blaze (header-only linear algebra library) from source.
#
# Note on Blaze CMake variables:
# The public Chrono::Multicore installation guide may refer to Blaze_ROOT_DIR.
# In this source tree, however, the active finder documents and consumes the
# lower-case variables below:
#
# - cmake/FindBlaze.cmake:
# * blaze_DIR: directory containing the Blaze package config script
# * blaze_INCLUDE_DIR: directory containing the subdirectory "blaze/"
# - src/chrono_multicore/CMakeLists.txt:
# * calls find_package(Blaze REQUIRED)
# * reports that users should set blaze_INCLUDE_DIR or blaze_DIR if
# Blaze cannot be found
# - contrib/build-scripts/linux/buildBlaze.sh:
# * installs Blaze's CMake package files under share/blaze/cmake
# * installs Blaze headers under include/blaze
#
# Pass both the package config directory and the include directory explicitly.
# This follows the current CMake code path and keeps configure-time discovery
# deterministic even if the documentation still mentions the older variable.

ARG CHRONO_DIR
ARG PACKAGE_DIR
ARG USERSHELLPROFILE

# Build Blaze
RUN cd ${CHRONO_DIR}/contrib/build-scripts/linux/ && \
bash buildBlaze.sh ${PACKAGE_DIR}/blaze

# Update CMake options
ENV CMAKE_OPTIONS="${CMAKE_OPTIONS} \
-DCH_ENABLE_MODULE_MULTICORE=ON \
-Dblaze_DIR=${PACKAGE_DIR}/blaze/share/blaze/cmake \
-Dblaze_INCLUDE_DIR=${PACKAGE_DIR}/blaze/include"
Loading