@@ -691,6 +691,123 @@ cmake --install build
691691popd
692692EOF-precice
693693
694+
695+ FROM base AS vtk
696+
697+ ARG DEBUG
698+ ARG CACHE_ID_SUFFIX
699+
700+ RUN --mount=type=cache,target=/var/cache/src/,id=precice-${CACHE_ID_SUFFIX} <<"EOF-vtk"
701+ source /etc/bashrc
702+ set -eo pipefail
703+
704+ URL='https://vtk.org/files/release/9.5/VTK-9.5.2.tar.gz'
705+ BASEDIR='VTK-9.5.2'
706+ if [[ -d "/var/cache/src/${BASEDIR}" ]]; then
707+ echo "CACHED ${BASEDIR}"
708+ else
709+ echo "Fetching ${URL}..."
710+ wget --quiet --output-document=- "$URL" | tar --extract --gzip --file=- --directory='/var/cache/src'
711+ fi
712+
713+ pushd "/var/cache/src/${BASEDIR}"
714+
715+ [[ $DEBUG = "0" ]] && BUILD_TYPE="Release" || BUILD_TYPE="Debug"
716+
717+ cmake -S . -B build \
718+ -D VTK_WRAP_PYTHON="OFF" \
719+ -D VTK_USE_MPI="ON" \
720+ -D CMAKE_BUILD_TYPE=$BUILD_TYPE \
721+ -D CMAKE_INSTALL_PREFIX=/usr/local \
722+ -D CMAKE_INSTALL_LIBDIR=lib \
723+ -D VTK_GROUP_ENABLE_Imaging=NO \
724+ -D VTK_GROUP_ENABLE_Views=NO \
725+ -D VTK_GROUP_ENABLE_Web=NO \
726+ -D VTK_GROUP_ENABLE_Qt=NO \
727+ -D VTK_GROUP_ENABLE_Rendering=DONT_WANT \
728+ -D VTK_GROUP_ENABLE_MPI=YES \
729+ -D BUILD_TESTING=OFF
730+
731+ cmake --build build --parallel $(nproc)
732+ cmake --install build
733+ popd
734+ EOF-vtk
735+
736+
737+ FROM base AS aste
738+
739+ ARG DEBUG
740+ ARG CACHE_ID_SUFFIX
741+
742+ COPY --from=libxml2 --link /usr/local/ /usr/local/
743+ COPY --from=eigen --link /usr/local/ /usr/local/
744+ COPY --from=boost --link /usr/local/ /usr/local/
745+ COPY --from=precice --link /usr/local/ /usr/local/
746+ COPY --from=vtk --link /usr/local/ /usr/local/
747+
748+ RUN --mount=type=cache,target=/var/cache/src/,id=precice-${CACHE_ID_SUFFIX} <<"EOF-aste"
749+ source /etc/bashrc
750+ set -eo pipefail
751+
752+ dnf --assumeyes install patch
753+
754+ URL='https://github.com/precice/aste/archive/refs/tags/v3.3.0.tar.gz'
755+ BASEDIR='aste-3.3.0'
756+ if [[ -d "/var/cache/src/${BASEDIR}" ]]; then
757+ echo "CACHED ${BASEDIR}"
758+ else
759+ echo "Fetching ${URL}..."
760+ wget --quiet --output-document=- "$URL" | tar --extract --gzip --file=- --directory='/var/cache/src'
761+ fi
762+
763+ pushd "/var/cache/src/${BASEDIR}"
764+
765+ # Patch aste CmakeList.txt to not look for the system component of boost (it is no longer needed)
766+ cat << EOF_no_boost_system > no_boost_system.patch
767+ --- CMakeLists.txt
768+ +++ CMakeLists.txt
769+ @@ -28,7 +28,7 @@
770+
771+ find_package(precice 3.0 REQUIRED)
772+
773+ -find_package(Boost 1.71.0 CONFIG REQUIRED COMPONENTS log log_setup system program_options unit_test_framework)
774+ +find_package(Boost 1.83.0 CONFIG REQUIRED COMPONENTS log log_setup program_options unit_test_framework)
775+
776+ # Initial attempt to find VTK without specifying components (only supported for VTK9)
777+ find_package(VTK QUIET)
778+ @@ -63,7 +63,6 @@
779+ Boost::log
780+ Boost::log_setup
781+ Boost::program_options
782+ - Boost::system
783+ Boost::thread
784+ Boost::unit_test_framework
785+ MPI::MPI_CXX
786+ @@ -86,7 +85,6 @@
787+ Boost::log
788+ Boost::log_setup
789+ Boost::program_options
790+ - Boost::system
791+ Boost::thread
792+ Boost::unit_test_framework
793+ MPI::MPI_CXX
794+ EOF_no_boost_system
795+
796+ patch -p0 < no_boost_system.patch
797+
798+
799+ [[ $DEBUG = "0" ]] && BUILD_TYPE="Release" || BUILD_TYPE="Debug"
800+
801+ cmake -S . -B build \
802+ -D CMAKE_BUILD_TYPE=$BUILD_TYPE \
803+ -D CMAKE_INSTALL_PREFIX=/usr/local \
804+ -D CMAKE_INSTALL_LIBDIR=lib
805+
806+ cmake --build build --parallel $(nproc)
807+ cmake --install build
808+ popd
809+ EOF-aste
810+
694811FROM base AS all
695812
696813RUN set -eo pipefail && \
@@ -713,3 +830,5 @@ COPY --from=esmf --link /usr/local/ /usr/local/
713830COPY --from=boost --link /usr/local/ /usr/local/
714831COPY --from=googletest --link /usr/local/ /usr/local/
715832COPY --from=precice --link /usr/local/ /usr/local/
833+ COPY --from=vtk --link /usr/local/ /usr/local/
834+ COPY --from=aste --link /usr/local/ /usr/local/
0 commit comments