From f1e01427f9ecd7fdd16aa4e9e7d994d6e251fe3a Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 01:43:41 +0800 Subject: [PATCH 01/19] Add Dockerfile snippet for OpenCASCADE installation --- contrib/docker/snippets/ch_cascade.dockerfile | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 contrib/docker/snippets/ch_cascade.dockerfile diff --git a/contrib/docker/snippets/ch_cascade.dockerfile b/contrib/docker/snippets/ch_cascade.dockerfile new file mode 100644 index 0000000000..396f3e48b2 --- /dev/null +++ b/contrib/docker/snippets/ch_cascade.dockerfile @@ -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=//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" From 2c39c2a2873a3eeecc0a0c4810eb30964d77a611 Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 01:44:28 +0800 Subject: [PATCH 02/19] Add C# bindings Dockerfile snippet --- contrib/docker/snippets/ch_csharp.dockerfile | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 contrib/docker/snippets/ch_csharp.dockerfile diff --git a/contrib/docker/snippets/ch_csharp.dockerfile b/contrib/docker/snippets/ch_csharp.dockerfile new file mode 100644 index 0000000000..4186d7c01f --- /dev/null +++ b/contrib/docker/snippets/ch_csharp.dockerfile @@ -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" From 43df53da1c7de4bd4ff5b45f4e5d0304d9c1ce84 Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 01:45:16 +0800 Subject: [PATCH 03/19] Add Dockerfile snippet to enable Chrono::DEM with CUDA support --- contrib/docker/snippets/ch_dem.dockerfile | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 contrib/docker/snippets/ch_dem.dockerfile diff --git a/contrib/docker/snippets/ch_dem.dockerfile b/contrib/docker/snippets/ch_dem.dockerfile new file mode 100644 index 0000000000..898d0887e1 --- /dev/null +++ b/contrib/docker/snippets/ch_dem.dockerfile @@ -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" From 16f5ca61dc3a38109d692e7df58d152d2c6966a1 Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 01:45:45 +0800 Subject: [PATCH 04/19] Add Dockerfile snippet to enable Chrono::FMI with shared libraries --- contrib/docker/snippets/ch_fmi.dockerfile | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 contrib/docker/snippets/ch_fmi.dockerfile diff --git a/contrib/docker/snippets/ch_fmi.dockerfile b/contrib/docker/snippets/ch_fmi.dockerfile new file mode 100644 index 0000000000..89dc985abd --- /dev/null +++ b/contrib/docker/snippets/ch_fmi.dockerfile @@ -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" From 276c75ff259e6f55e0ea01e759ae7ab91e33e31a Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 01:46:03 +0800 Subject: [PATCH 05/19] Add Dockerfile snippet to enable Chrono::FSI with SPH and TDPF backends --- contrib/docker/snippets/ch_fsi.dockerfile | 50 +++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 contrib/docker/snippets/ch_fsi.dockerfile diff --git a/contrib/docker/snippets/ch_fsi.dockerfile b/contrib/docker/snippets/ch_fsi.dockerfile new file mode 100644 index 0000000000..dd975988b3 --- /dev/null +++ b/contrib/docker/snippets/ch_fsi.dockerfile @@ -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" From c26c6a050868deb81ae363c6a7d59a5361a9ac9b Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 01:46:20 +0800 Subject: [PATCH 06/19] Add Dockerfile snippet to install dependencies for Chrono::Modal and build Spectra from source --- contrib/docker/snippets/ch_modal.dockerfile | 38 +++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 contrib/docker/snippets/ch_modal.dockerfile diff --git a/contrib/docker/snippets/ch_modal.dockerfile b/contrib/docker/snippets/ch_modal.dockerfile new file mode 100644 index 0000000000..1fd711c3b7 --- /dev/null +++ b/contrib/docker/snippets/ch_modal.dockerfile @@ -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" From de293443e202e735cf7deaf87f887dcfb34323a7 Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 01:46:32 +0800 Subject: [PATCH 07/19] Add Dockerfile snippet to install dependencies for Chrono::Multicore and build Blaze from source --- .../docker/snippets/ch_multicore.dockerfile | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 contrib/docker/snippets/ch_multicore.dockerfile diff --git a/contrib/docker/snippets/ch_multicore.dockerfile b/contrib/docker/snippets/ch_multicore.dockerfile new file mode 100644 index 0000000000..775bce7ce5 --- /dev/null +++ b/contrib/docker/snippets/ch_multicore.dockerfile @@ -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" From ecd1f8e67b77ce9979e0b7a3bc7d5fa29545b489 Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 01:46:46 +0800 Subject: [PATCH 08/19] Add Dockerfile snippet to install dependencies for Chrono::MUMPS and build from source --- contrib/docker/snippets/ch_mumps.dockerfile | 69 +++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 contrib/docker/snippets/ch_mumps.dockerfile diff --git a/contrib/docker/snippets/ch_mumps.dockerfile b/contrib/docker/snippets/ch_mumps.dockerfile new file mode 100644 index 0000000000..69555a54db --- /dev/null +++ b/contrib/docker/snippets/ch_mumps.dockerfile @@ -0,0 +1,69 @@ +# SPDX-License-Identifier: MIT +# This snippet installs necessary dependencies for Chrono::MUMPS +# Builds MUMPS via projectchrono fork of scivision/mumps. +# Requires: gfortran and Intel MKL (include ch_pardisomkl.dockerfile before this snippet). +# +# Note on MUMPS build and discovery: +# The Chrono::MUMPS installation guide says that MUMPS does not provide its own +# CMake-based installation system and recommends the Chrono utility scripts +# buildMUMPS.bat/buildMUMPS.sh/buildMUMPS_Mac.sh. The Linux script installs the +# CMake package configuration files under the chosen MUMPS install prefix, and +# Chrono should then be configured with MUMPS_DIR pointing at that config +# directory. +# +# This mirrors the current Chrono CMake code path: +# +# - src/chrono_mumps/CMakeLists.txt: +# * checks that a Fortran compiler is available +# * calls find_package(MUMPS QUIET REQUIRED CONFIG) +# - cmake/ChronoConfig.cmake.in: +# * propagates MUMPS_DIR to Chrono consumers +# - contrib/build-scripts/linux/buildMUMPS.sh: +# * builds the projectchrono/mumps CMake wrapper +# * requires a Fortran compiler and Intel oneAPI/MKL +# * installs MUMPSConfig.cmake under the MUMPS install prefix +# * recommends updating LD_LIBRARY_PATH for the installed MUMPS libraries +# +# Use gfortran in this image rather than Intel ifx: it keeps the Docker build +# independent from the oneAPI compiler toolchain while still satisfying Chrono's +# Fortran compiler requirement. Source oneAPI before running buildMUMPS.sh so +# the script can discover MKL from the ch_pardisomkl snippet. Finally, normalize +# the discovered MUMPSConfig.cmake directory to ${PACKAGE_DIR}/mumps/cmake so +# the final Chrono configure step can use a stable MUMPS_DIR value. + +ARG CHRONO_DIR +ARG PACKAGE_DIR +ARG USERSHELLPROFILE + +# Fortran compiler required by MUMPS +RUN sudo apt update && \ + sudo apt install --no-install-recommends -y gfortran && \ + sudo apt clean && sudo apt autoremove -y && sudo rm -rf /var/lib/apt/lists/* + +# Build MUMPS (sources MKL env so MUMPS finds it via Intel oneAPI). +# After install, verify the CMake package and normalize its directory to +# ${PACKAGE_DIR}/mumps/cmake so the final Chrono configure step can use a +# plain, stable path. +RUN . /opt/intel/oneapi/setvars.sh --force > /dev/null 2>&1 && \ + cd ${CHRONO_DIR}/contrib/build-scripts/linux/ && \ + bash buildMUMPS.sh ${PACKAGE_DIR}/mumps && \ + mumps_config="$(find ${PACKAGE_DIR}/mumps \( -name MUMPSConfig.cmake -o -name mumps-config.cmake \) -print -quit)" && \ + if [ -z "$mumps_config" ]; then \ + echo "ERROR: MUMPS CMake package not produced. Tree of ${PACKAGE_DIR}/mumps:"; \ + ls -R ${PACKAGE_DIR}/mumps; \ + exit 1; \ + fi && \ + mumps_cmake_dir="$(dirname "$mumps_config")" && \ + if [ "$mumps_cmake_dir" != "${PACKAGE_DIR}/mumps/cmake" ]; then \ + rm -rf ${PACKAGE_DIR}/mumps/cmake && \ + ln -s "$mumps_cmake_dir" ${PACKAGE_DIR}/mumps/cmake; \ + fi && \ + echo "MUMPS CMake package: ${PACKAGE_DIR}/mumps/cmake" + +# Update shell config +RUN echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${PACKAGE_DIR}/mumps/lib" >> ${USERSHELLPROFILE} + +# Update CMake options +ENV CMAKE_OPTIONS="${CMAKE_OPTIONS} \ + -DCH_ENABLE_MODULE_MUMPS=ON \ + -DMUMPS_DIR=${PACKAGE_DIR}/mumps/cmake" From c22c2e199c1ffeb4b08f804ae67745a8af0c74d6 Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 01:47:01 +0800 Subject: [PATCH 09/19] Add Dockerfile snippet to install Intel oneAPI MKL for Chrono::PardisoMKL --- .../docker/snippets/ch_pardisomkl.dockerfile | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 contrib/docker/snippets/ch_pardisomkl.dockerfile diff --git a/contrib/docker/snippets/ch_pardisomkl.dockerfile b/contrib/docker/snippets/ch_pardisomkl.dockerfile new file mode 100644 index 0000000000..3e5c1ba4d0 --- /dev/null +++ b/contrib/docker/snippets/ch_pardisomkl.dockerfile @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: MIT +# This snippet installs Intel oneAPI MKL for Chrono::PardisoMKL +# +# The Chrono::PardisoMKL installation guide requires Intel MKL, enables the +# module with CH_ENABLE_MODULE_PARDISO_MKL, and asks users to set MKL_DIR to the +# directory containing MKLConfig.cmake when CMake cannot find it automatically. +# The same guide notes that MKL 2023 is known to work with Eigen/Chrono, and +# contrib/build-scripts/linux/buildMUMPS.sh carries the matching warning that +# oneAPI 2025 is incompatible with Eigen. Pin this image to MKL 2024.2, a +# versioned pre-2025 package, to keep builds reproducible while avoiding the +# known incompatible 2025 release family. +# +# MKL_ROOT is passed in addition to MKL_DIR. This is still aligned with the +# current Chrono CMake code path: src/chrono_pardisomkl/CMakeLists.txt documents +# MKL_ROOT as the oneMKL root and the oneMKL CMake package also uses it during +# package discovery. Supplying both paths keeps Docker builds deterministic, +# especially when the CMake build directory is backed by a BuildKit cache. + +ARG USERSHELLPROFILE + +# Add Intel oneAPI APT repository and install MKL +RUN sudo apt update && \ + sudo apt install --no-install-recommends -y wget gnupg ca-certificates && \ + wget -qO- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ + | sudo gpg --dearmor -o /usr/share/keyrings/oneapi-archive-keyring.gpg && \ + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \ + | sudo tee /etc/apt/sources.list.d/oneAPI.list && \ + sudo apt update && \ + sudo apt install --no-install-recommends -y intel-oneapi-mkl-devel-2024.2 && \ + sudo apt clean && sudo apt autoremove -y && sudo rm -rf /var/lib/apt/lists/* + +# Source oneAPI environment in shell startup so MKLROOT etc. are set +RUN echo ". /opt/intel/oneapi/setvars.sh --force > /dev/null 2>&1" >> ${USERSHELLPROFILE} + +# Match the runtime environment recommended by the Chrono::PardisoMKL guide. +ENV MKL_INTERFACE_LAYER=LP64 +ENV MKL_THREADING_LAYER=INTEL + +# Update CMake options. The MKL CMake package ships with oneAPI under /lib/cmake/mkl. +ENV CMAKE_OPTIONS="${CMAKE_OPTIONS} \ + -DCH_ENABLE_MODULE_PARDISO_MKL=ON \ + -DMKL_ROOT=/opt/intel/oneapi/mkl/latest \ + -DMKL_DIR=/opt/intel/oneapi/mkl/latest/lib/cmake/mkl" + +# Source oneAPI before building so the compiler sees MKL libraries +ENV PRE_BUILD_SCRIPTS="${PRE_BUILD_SCRIPTS} . /opt/intel/oneapi/setvars.sh --force > /dev/null 2>&1 &&" From c6ae230ebfe73a8e1a799489651b108ed70bc546 Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 01:47:28 +0800 Subject: [PATCH 10/19] Add Dockerfile snippet to enable Chrono::Peridynamics module --- .../snippets/ch_peridynamics.dockerfile | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 contrib/docker/snippets/ch_peridynamics.dockerfile diff --git a/contrib/docker/snippets/ch_peridynamics.dockerfile b/contrib/docker/snippets/ch_peridynamics.dockerfile new file mode 100644 index 0000000000..ac074b7d0d --- /dev/null +++ b/contrib/docker/snippets/ch_peridynamics.dockerfile @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: MIT +# This snippet enables Chrono::Peridynamics (fracture / damage mechanics). +# +# Note on Peridynamics: +# The generated API documentation for the PERIDYNAMICS module mentions an +# installation guide, but the corresponding Doxygen reference +# module_peridynamics_installation does not correspond to a separate page in +# this source tree. The public API page therefore documents the module itself, +# not a separate dependency/install procedure. +# +# Public API page: +# https://api.projectchrono.org/group__chrono__peridynamics.html +# +# This snippet follows the current Chrono CMake implementation: +# +# - src/chrono_peridynamics/ChApiPeridynamics.h: +# * defines the PERIDYNAMICS module API group +# * references module_peridynamics_installation from the generated docs +# - src/chrono_peridynamics/CMakeLists.txt: +# * enables the module with CH_ENABLE_MODULE_PERIDYNAMICS +# * builds Chrono_peridynamics from in-tree sources +# * links only against Chrono_core +# - src/demos/peridynamics/CMakeLists.txt: +# * links the demos against Chrono_peridynamics +# +# No external build-time dependencies are required beyond Chrono core. + +ENV CMAKE_OPTIONS="${CMAKE_OPTIONS} \ + -DCH_ENABLE_MODULE_PERIDYNAMICS=ON" From 548c97ce7f07c0e913f1dd42dbb6e77f9b8e1227 Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 01:47:44 +0800 Subject: [PATCH 11/19] Add Dockerfile snippet to enable Chrono::Postprocess module --- .../docker/snippets/ch_postprocess.dockerfile | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 contrib/docker/snippets/ch_postprocess.dockerfile diff --git a/contrib/docker/snippets/ch_postprocess.dockerfile b/contrib/docker/snippets/ch_postprocess.dockerfile new file mode 100644 index 0000000000..86446f82ca --- /dev/null +++ b/contrib/docker/snippets/ch_postprocess.dockerfile @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: MIT +# This snippet enables Chrono::Postprocess (POV-Ray, Blender, Gnuplot output generators). +# No build-time dependencies. POV-Ray / Blender / Gnuplot are only needed at runtime +# to render the generated scripts. +# +# Note on optional post-processing tools: +# The Chrono::Postprocess installation guide requires only enabling +# CH_ENABLE_MODULE_POSTPROCESS for the Chrono library itself. Blender, POV-Ray, +# and Gnuplot are external applications used later to render or display the +# scripts generated by this module; they are not required to build the +# Chrono_postprocess library. +# +# This mirrors the current Chrono CMake code path: +# +# - src/chrono_postprocess/CMakeLists.txt: +# * enables the module with CH_ENABLE_MODULE_POSTPROCESS +# * builds ChPovRay and ChBlender without external build-time packages +# * probes Gnuplot quietly and adds ChGnuPlot support only if an +# executable is already available +# - cmake/ChronoConfig.cmake.in: +# * exposes Chrono_POSTPROCESS_AVAILABLE and the Chrono_postprocess +# library to Chrono consumers +# +# Do not install Blender, POV-Ray, or Gnuplot here. Keeping them out avoids +# pulling large GUI/rendering runtimes into a general Chrono Docker image while +# still building the module documented by the installation guide. + +ENV CMAKE_OPTIONS="${CMAKE_OPTIONS} \ + -DCH_ENABLE_MODULE_POSTPROCESS=ON" From 4cd639d4c34e021cfacfabad9be963f474ff050a Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 23:02:45 +0800 Subject: [PATCH 12/19] Add Dockerfile snippets for additional Chrono modules and dependencies --- contrib/docker/snippets/chrono.dockerfile | 56 +++++++++++++++-------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/contrib/docker/snippets/chrono.dockerfile b/contrib/docker/snippets/chrono.dockerfile index 45c043a573..03ba226ff0 100644 --- a/contrib/docker/snippets/chrono.dockerfile +++ b/contrib/docker/snippets/chrono.dockerfile @@ -17,25 +17,25 @@ ENV PRE_BUILD_COMMANDS="" # Install Chrono dependencies that are required for all modules (or some but are fairly small) RUN sudo apt update && \ - sudo apt install --no-install-recommends -y \ - libirrlicht-dev \ - libeigen3-dev \ - git \ - cmake \ - build-essential \ - ninja-build \ - swig \ - libxxf86vm-dev \ - freeglut3-dev \ - python3-numpy \ - libglu1-mesa-dev \ - libglew-dev \ - libglfw3-dev \ - libblas-dev \ - liblapack-dev \ - wget \ - xorg-dev && \ - sudo apt clean && sudo apt autoremove -y && sudo rm -rf /var/lib/apt/lists/* + sudo apt install --no-install-recommends -y \ + libirrlicht-dev \ + libeigen3-dev \ + git \ + cmake \ + build-essential \ + ninja-build \ + swig \ + libxxf86vm-dev \ + freeglut3-dev \ + python3-numpy \ + libglu1-mesa-dev \ + libglew-dev \ + libglfw3-dev \ + libblas-dev \ + liblapack-dev \ + wget \ + xorg-dev && \ + sudo apt clean && sudo apt autoremove -y && sudo rm -rf /var/lib/apt/lists/* # Clone Chrono before running the snippets RUN git clone --recursive -b ${CHRONO_BRANCH} ${CHRONO_REPO} ${CHRONO_DIR} @@ -55,6 +55,24 @@ INCLUDE ./ch_parser.dockerfile INCLUDE ./ch_python.dockerfile INCLUDE ./ch_synchrono.dockerfile +# --------------------------------------------------------------------------- +# Optional additional modules enabled for this image. +# +# Keep ch_pardisomkl before ch_mumps: MUMPS is built against Intel MKL. +# CUDA-dependent modules rely on cuda.dockerfile, included above. +# Enabling all modules produces a large image and a long build. +# --------------------------------------------------------------------------- +INCLUDE ./ch_cascade.dockerfile +INCLUDE ./ch_csharp.dockerfile +INCLUDE ./ch_dem.dockerfile +INCLUDE ./ch_fmi.dockerfile +INCLUDE ./ch_fsi.dockerfile +INCLUDE ./ch_pardisomkl.dockerfile +INCLUDE ./ch_modal.dockerfile +INCLUDE ./ch_multicore.dockerfile +INCLUDE ./ch_mumps.dockerfile +INCLUDE ./ch_peridynamics.dockerfile +INCLUDE ./ch_postprocess.dockerfile # Install Chrono RUN ${PRE_BUILD_SCRIPTS} && \ From 540fcc00ea5f014e5b49d97019858f5c3dead7ef Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 23:03:00 +0800 Subject: [PATCH 13/19] Update CUDA version to 12-9 in docker-compose.yml --- contrib/docker/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/docker/docker-compose.yml b/contrib/docker/docker-compose.yml index aeb2da55f8..a4eac199ab 100644 --- a/contrib/docker/docker-compose.yml +++ b/contrib/docker/docker-compose.yml @@ -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: From 1a042a692a735650caeb192b6f4a38627239ff86 Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 23:20:07 +0800 Subject: [PATCH 14/19] Enhance Dockerfile: Update CUDA architecture handling and improve build commands --- contrib/docker/snippets/chrono.dockerfile | 33 ++++++++++++----------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/contrib/docker/snippets/chrono.dockerfile b/contrib/docker/snippets/chrono.dockerfile index 03ba226ff0..c94612b641 100644 --- a/contrib/docker/snippets/chrono.dockerfile +++ b/contrib/docker/snippets/chrono.dockerfile @@ -6,6 +6,9 @@ ARG CHRONO_BRANCH="main" ARG CHRONO_REPO="https://github.com/projectchrono/chrono.git" ARG CHRONO_DIR="${USERHOME}/chrono" ARG CHRONO_INSTALL_DIR="${USERHOME}/packages/chrono" +# Use explicit numeric architectures so CUDA modules can configure with CMake +# versions before 3.23, where the "all-major" shortcut is not available. +ARG CHRONO_CUDA_ARCHITECTURES="60;61;62;70;72;75;80;86;89;90" ARG PACKAGE_DIR="${USERHOME}/packages" RUN mkdir -p ${PACKAGE_DIR} @@ -75,23 +78,23 @@ INCLUDE ./ch_peridynamics.dockerfile INCLUDE ./ch_postprocess.dockerfile # Install Chrono -RUN ${PRE_BUILD_SCRIPTS} && \ +RUN eval "${PRE_BUILD_SCRIPTS} true" && \ # Evaluate the cmake options to expand any $(...) commands or variables eval "_CMAKE_OPTIONS=\"${CMAKE_OPTIONS}\"" && \ - mkdir ${CHRONO_DIR}/build && \ - cd ${CHRONO_DIR}/build && \ - cmake ../ -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_DEMOS=OFF \ - -DBUILD_BENCHMARKING=OFF \ - -DBUILD_TESTING=OFF \ - -DCMAKE_LIBRARY_PATH=$(find /usr/local/cuda/ -type d -name stubs) \ - -DEigen3_DIR=/usr/lib/cmake/eigen3 \ - -DCMAKE_INSTALL_PREFIX=${CHRONO_INSTALL_DIR} \ - -DNUMPY_INCLUDE_DIR=$(python3 -c 'import numpy; print(numpy.get_include())') \ - ${_CMAKE_OPTIONS} \ - && \ - ninja && ninja install + cd ${CHRONO_DIR} && \ + cmake -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_DEMOS=OFF \ + -DBUILD_BENCHMARKING=OFF \ + -DBUILD_TESTING=OFF \ + -DCMAKE_LIBRARY_PATH=$(find /usr/local/cuda/ -type d -name stubs) \ + -DCHRONO_CUDA_ARCHITECTURES="${CHRONO_CUDA_ARCHITECTURES}" \ + -DEigen3_DIR=/usr/lib/cmake/eigen3 \ + -DCMAKE_INSTALL_PREFIX=${CHRONO_INSTALL_DIR} \ + -DNUMPY_INCLUDE_DIR=$(python3 -c 'import numpy; print(numpy.get_include())') \ + ${_CMAKE_OPTIONS} && \ + cmake --build build && \ + cmake --install build # Update shell config From 0442b610f1196e920f4557a0a574c9a2207d6d33 Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Tue, 28 Apr 2026 23:26:40 +0800 Subject: [PATCH 15/19] Add release Dockerfile for standalone Chrono image build --- contrib/docker/release.dockerfile | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 contrib/docker/release.dockerfile diff --git a/contrib/docker/release.dockerfile b/contrib/docker/release.dockerfile new file mode 100644 index 0000000000..d4571d210a --- /dev/null +++ b/contrib/docker/release.dockerfile @@ -0,0 +1,40 @@ +# 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" . +# +# 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 From 6428f1ea3d681d7b08fe6325cf0d3d4a4cd08007 Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Wed, 29 Apr 2026 03:20:11 +0800 Subject: [PATCH 16/19] Update LD_LIBRARY_PATH in CUDA Dockerfile to include lib64 directory --- contrib/docker/snippets/cuda.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/docker/snippets/cuda.dockerfile b/contrib/docker/snippets/cuda.dockerfile index d7a904dfcf..64b43fad58 100644 --- a/contrib/docker/snippets/cuda.dockerfile +++ b/contrib/docker/snippets/cuda.dockerfile @@ -23,4 +23,4 @@ RUN sudo apt update && sudo apt install -y --no-install-recommends \ # Set environment variables ENV PATH="/usr/local/cuda/bin:${PATH}" -ENV LD_LIBRARY_PATH="/usr/local/cuda/lib:${LD_LIBRARY_PATH}" \ No newline at end of file +ENV LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/lib:${LD_LIBRARY_PATH}" From 4f0336e62cc1e9eebb229a3162bc8c344703320e Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Wed, 29 Apr 2026 03:20:46 +0800 Subject: [PATCH 17/19] Fix CMakeLists.txt: Enclose CUDA_ARCHITECTURES in quotes for Chrono modules --- src/chrono_dem/CMakeLists.txt | 2 +- src/chrono_fsi/sph/CMakeLists.txt | 2 +- src/chrono_sensor/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/chrono_dem/CMakeLists.txt b/src/chrono_dem/CMakeLists.txt index 422af33e35..23c6dd1b6e 100644 --- a/src/chrono_dem/CMakeLists.txt +++ b/src/chrono_dem/CMakeLists.txt @@ -174,7 +174,7 @@ if(CHRONO_CUDA_FOUND) target_link_libraries(Chrono_dem PUBLIC CUDA::cuda_driver) target_link_libraries(Chrono_dem PUBLIC CUDA::cublas) target_link_libraries(Chrono_dem PUBLIC CUDA::cusparse) - set_target_properties(Chrono_dem PROPERTIES CUDA_ARCHITECTURES ${CHRONO_CUDA_ARCHITECTURES}) + set_target_properties(Chrono_dem PROPERTIES CUDA_ARCHITECTURES "${CHRONO_CUDA_ARCHITECTURES}") elseif(CHRONO_HIP_FOUND) find_package(hip QUIET CONFIG HINTS "${CHRONO_ROCM_ROOT}") if(TARGET hip::host) diff --git a/src/chrono_fsi/sph/CMakeLists.txt b/src/chrono_fsi/sph/CMakeLists.txt index eb27bf5d99..43a3a5ac3f 100644 --- a/src/chrono_fsi/sph/CMakeLists.txt +++ b/src/chrono_fsi/sph/CMakeLists.txt @@ -263,7 +263,7 @@ if(CHRONO_CUDA_FOUND) target_compile_definitions(Chrono_fsisph PUBLIC "THRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA") target_compile_definitions(Chrono_fsisph PUBLIC "THRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP") - set_target_properties(Chrono_fsisph PROPERTIES CUDA_ARCHITECTURES ${CHRONO_CUDA_ARCHITECTURES}) + set_target_properties(Chrono_fsisph PROPERTIES CUDA_ARCHITECTURES "${CHRONO_CUDA_ARCHITECTURES}") elseif(CHRONO_HIP_FOUND) find_package(hip QUIET CONFIG HINTS "${CHRONO_ROCM_ROOT}") if(TARGET hip::host) diff --git a/src/chrono_sensor/CMakeLists.txt b/src/chrono_sensor/CMakeLists.txt index 9429ce87e0..893e1538c4 100644 --- a/src/chrono_sensor/CMakeLists.txt +++ b/src/chrono_sensor/CMakeLists.txt @@ -532,7 +532,7 @@ if(CH_USE_SENSOR_OPTIX) target_compile_options(Chrono_sensor PRIVATE $<$:--use_fast_math>) target_compile_options(Chrono_sensor PRIVATE $<$:--extended-lambda>) target_compile_options(Chrono_sensor PRIVATE $<$:-Wno-deprecated-gpu-targets>) - set_target_properties(Chrono_sensor PROPERTIES CUDA_ARCHITECTURES ${CHRONO_CUDA_ARCHITECTURES}) + set_target_properties(Chrono_sensor PROPERTIES CUDA_ARCHITECTURES "${CHRONO_CUDA_ARCHITECTURES}") endif() # ------------------------------------------------------------------------------ From d190082481d844cf9529d715baa3b6a6fd64316d Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Wed, 29 Apr 2026 03:21:06 +0800 Subject: [PATCH 18/19] Fix environment variable name: Change PRE_BUILD_COMMANDS to PRE_BUILD_SCRIPTS in Dockerfile --- contrib/docker/snippets/chrono.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/docker/snippets/chrono.dockerfile b/contrib/docker/snippets/chrono.dockerfile index c94612b641..1991491ec9 100644 --- a/contrib/docker/snippets/chrono.dockerfile +++ b/contrib/docker/snippets/chrono.dockerfile @@ -16,7 +16,7 @@ RUN mkdir -p ${PACKAGE_DIR} ENV CMAKE_OPTIONS="" # This variable is used before building (but in the same RUN command) # This is useful for setting environment variables that are used in the build process -ENV PRE_BUILD_COMMANDS="" +ENV PRE_BUILD_SCRIPTS="" # Install Chrono dependencies that are required for all modules (or some but are fairly small) RUN sudo apt update && \ From 07527769782225a8526640fc179991bbb0588e88 Mon Sep 17 00:00:00 2001 From: sshawn9 Date: Wed, 29 Apr 2026 04:34:49 +0800 Subject: [PATCH 19/19] Add CMAKE_BUILD_PARALLEL_LEVEL argument to Dockerfiles for build parallelism control --- contrib/docker/release.dockerfile | 2 ++ contrib/docker/snippets/chrono.dockerfile | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/contrib/docker/release.dockerfile b/contrib/docker/release.dockerfile index d4571d210a..f8241ee2b8 100644 --- a/contrib/docker/release.dockerfile +++ b/contrib/docker/release.dockerfile @@ -12,6 +12,8 @@ # 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. diff --git a/contrib/docker/snippets/chrono.dockerfile b/contrib/docker/snippets/chrono.dockerfile index 1991491ec9..71ecc9904b 100644 --- a/contrib/docker/snippets/chrono.dockerfile +++ b/contrib/docker/snippets/chrono.dockerfile @@ -9,6 +9,10 @@ ARG CHRONO_INSTALL_DIR="${USERHOME}/packages/chrono" # Use explicit numeric architectures so CUDA modules can configure with CMake # versions before 3.23, where the "all-major" shortcut is not available. ARG CHRONO_CUDA_ARCHITECTURES="60;61;62;70;72;75;80;86;89;90" +# Full optional-module builds can run many C++ and CUDA compilations at once, +# which can trigger compiler ICEs on memory-constrained Docker builders. +# This standard CMake variable lets users reduce parallelism when needed. +ARG CMAKE_BUILD_PARALLEL_LEVEL ARG PACKAGE_DIR="${USERHOME}/packages" RUN mkdir -p ${PACKAGE_DIR}