From 79aa0c9b2542f3beef13f7516886ae1c14ba7908 Mon Sep 17 00:00:00 2001 From: dav-og <12831266+dav-og@users.noreply.github.com> Date: Fri, 28 Aug 2026 11:11:16 +0100 Subject: [PATCH 1/3] fix(chrono10): keep m_script_directory for the Chrono 10.0.0 baseline a0d34cc switched HCParser::SetScriptDir to m_file_handler.SetReferenceDirectory(dir). That member exists on Chrono main, but not on the Chrono 10.0.0 release that SEA-Stack documents as its baseline, so the app fails to compile against 10.0.0. Restore the protected m_script_directory assignment, which is the Chrono 10.0.0 API. The yaml-cpp half of a0d34cc is kept unchanged -- preferring Chrono::yaml-cpp over a system yaml-cpp is correct on both Chrono versions and avoids the YAML::FpToString / YAML::Emitter::Write link errors Salhus reported. Verified on Ubuntu 22.04 against Chrono 10.0.0 built with Chrono's pinned VSG stack (vsg 1.1.11, vsgXchange 1.1.7, vsgImGui 0.7.0). --- apps/seastack/single_run.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/seastack/single_run.cpp b/apps/seastack/single_run.cpp index 56d8918..3c3b36b 100644 --- a/apps/seastack/single_run.cpp +++ b/apps/seastack/single_run.cpp @@ -123,7 +123,7 @@ namespace { class HCParser : public ::chrono::parsers::ChParserMbsYAML { public: HCParser() : ChParserMbsYAML() {} - void SetScriptDir(const std::string& dir) { m_file_handler.SetReferenceDirectory(dir); } + void SetScriptDir(const std::string& dir) { m_script_directory = dir; } }; static std::shared_ptr<::chrono::ChBody> FindBodyByName(::chrono::ChSystem& system, From 51505c34cca9857fc4609f3773f34e7936c86e25 Mon Sep 17 00:00:00 2001 From: dav-og <12831266+dav-og@users.noreply.github.com> Date: Fri, 28 Aug 2026 11:11:51 +0100 Subject: [PATCH 2/3] Revert "fix(gui/vsg): use opaque water surface to avoid runtime DepthSorted crash" This reverts 2172d0b, restoring the intended translucent free surface (kWaterOpacity = 0.55) and the faint translucent wireframe overlay (SetOpacity(0.35)). The DepthSorted / vsg::Bin::add crash does not reproduce against the documented Chrono 10.0.0 baseline. Chrono 10.0.0 has no wrapIfTransparent() helper and does not wrap runtime-added nodes in vsg::DepthSorted, so a sub-1.0 material opacity never reaches the bin-10 path described in 2172d0b. That code was added on Chrono main after the 10.0.0 release, which is the most likely reason the crash was seen. Validated on Ubuntu 22.04.5 + RTX 3060 against Chrono 10.0.0 built with Chrono's pinned VSG stack (vsg 1.1.11, vsgXchange 1.1.7, vsgImGui 0.7.0, glslang 15.4.0): the 5SA bimodal GUI runs with translucent water and the wireframe toggle without any FATAL or renderer crash. Please retest on your Linux machine against Chrono 10.0.0 specifically. If the crash returns there, the VSG stack version is the thing to compare first, and we should fix the runtime compile traversal rather than force opacity to 1.0. --- apps/seastack/gui/vsg_config.h | 9 +-------- apps/seastack/gui/vsg_water_surface.cpp | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/apps/seastack/gui/vsg_config.h b/apps/seastack/gui/vsg_config.h index bfe5bad..99d237d 100644 --- a/apps/seastack/gui/vsg_config.h +++ b/apps/seastack/gui/vsg_config.h @@ -25,14 +25,7 @@ inline constexpr int kColorVariationCycle = 8; inline constexpr float kWaterR = 0.01f; inline constexpr float kWaterG = 0.20f; inline constexpr float kWaterB = 0.35f; -// NOTE: Material opacity must stay at 1.0 on Linux. -// With opacity < 1.0, Chrono's wrapIfTransparent() wraps the runtime-added -// water node in vsg::DepthSorted (bin 10), which crashes the VSG renderer -// at vsg::Bin::add during the first record traversal. The animated water -// surface is added to the scene after pVis->Initialize(), bypassing the -// BindAll() compile path that built-in Chrono demos rely on. -// TODO: enable proper translucency via a runtime compile traversal. -inline constexpr float kWaterOpacity = 1.0f; +inline constexpr float kWaterOpacity = 0.55f; inline constexpr float kWaterSpecular = 0.6f; inline constexpr float kWaterRoughness = 0.05f; inline constexpr float kWaterMetallic = 0.0f; diff --git a/apps/seastack/gui/vsg_water_surface.cpp b/apps/seastack/gui/vsg_water_surface.cpp index 6c86e50..ecc097a 100644 --- a/apps/seastack/gui/vsg_water_surface.cpp +++ b/apps/seastack/gui/vsg_water_surface.cpp @@ -501,7 +501,7 @@ void AnimatedWaterSurface::InitializeWireframe() { // Faint blue-gray material. auto wire_material = ::chrono_types::make_shared<::chrono::ChVisualMaterial>(); wire_material->SetDiffuseColor(::chrono::ChColor(0.1f, 0.2f, 0.3f)); - wire_material->SetOpacity(1.0f); + wire_material->SetOpacity(0.35f); wire_material->SetRoughness(0.9f); wire_material->SetMetallic(0.0f); From 4861a0fc7dbfb3f7377d77c4c313f681edb29a1f Mon Sep 17 00:00:00 2001 From: dav-og <12831266+dav-og@users.noreply.github.com> Date: Fri, 28 Aug 2026 11:12:23 +0100 Subject: [PATCH 3/3] fix(linux): allow HydroIO when HDF5Dir is unset On Ubuntu, scripts/unix/build.sh treated an empty HDF5Dir in build-config.json as "HDF5 missing" and forced SEASTACK_ENABLE_HYDRO_IO=OFF. CMake was therefore never given a chance to find the apt libhdf5-dev package, and builds that did want HydroIO failed later on a missing h5_reader.h rather than at configure time. The only workaround was an undocumented manual HDF5Dir entry. Two small changes: * scripts/unix/build.sh - leave HydroIO ON when HDF5Dir is unset and print an INFO note instead. CMake's FindHDF5 then runs normally, and a genuinely missing HDF5 fails at configure time with a clear error. * CMakeLists.txt - Chrono's ChronoConfig can leave HDF5_DIR cached as NOTFOUND when Chrono itself found HDF5 via module mode. Clear that stale value, then probe module-mode find_package(HDF5 COMPONENTS CXX) when HydroIO is enabled and HDF5 is not yet found. Validated on Ubuntu 22.04.5 with "HDF5Dir": "" and Chrono 10.0.0 + VSG: configure reports HydroIO ON, libseastack_hydro_io.a builds, and run_seastack links libhdf5_serial 1.10.7 via module mode while HDF5_DIR stays NOTFOUND. --- CMakeLists.txt | 7 ++++++- scripts/unix/build.sh | 15 ++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c0bb271..72ff2e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -183,13 +183,18 @@ if(SEASTACK_ENABLE_CHRONO) " (or /usr/local/opt/libomp on Intel Homebrew).") endif() - # If Chrono set HDF5_DIR, retry the find + # If Chrono set HDF5_DIR to NOTFOUND (common when Chrono itself found HDF5 + # via module mode, not hdf5-config.cmake), clear it so later FindHDF5 + # module-mode discovery (e.g. Ubuntu libhdf5-dev) can succeed. if(NOT HDF5_FOUND AND DEFINED CACHE{HDF5_DIR}) if("${HDF5_DIR}" MATCHES "NOTFOUND") unset(HDF5_DIR CACHE) find_package(HDF5 CONFIG QUIET) endif() endif() + if(SEASTACK_ENABLE_HYDRO_IO AND NOT HDF5_FOUND) + find_package(HDF5 QUIET COMPONENTS CXX) + endif() # Use same C++ standard as Chrono for ABI compatibility if(DEFINED CHRONO_CXX_STANDARD) diff --git a/scripts/unix/build.sh b/scripts/unix/build.sh index f0170f8..4cfbf31 100755 --- a/scripts/unix/build.sh +++ b/scripts/unix/build.sh @@ -318,14 +318,15 @@ else USE_VSG=0 fi +# HydroIO / HDF5: +# Do not force HydroIO OFF merely because build-config.json leaves HDF5Dir empty. +# On Ubuntu/Debian, libhdf5-dev is discovered by CMake FindHDF5 (module mode) +# without a config-mode HDF5_DIR. Passing -DHDF5_DIR is optional; Chrono's +# ChronoConfig may even set HDF5_DIR to NOTFOUND when it used module-mode HDF5. +# Only --no-hydro-io disables HydroIO here. If CMake cannot find HDF5, configure +# fails with a clear FindHDF5 error instead of a later missing-header failure. if [[ -z "${SEASTACK_HDF5_DIR:-}" && "${NO_HYDRO_IO}" -eq 0 ]]; then - echo " [WARN] HDF5 not found; HydroIO will be disabled." >&2 - if [[ "${USE_CHRONO}" -eq 1 ]]; then - echo " If Chrono was built without HDF5, set HDF5Dir in build-config.json." >&2 - else - echo " For Chrono-free builds, set HDF5Dir or use --no-hydro-io." >&2 - fi - NO_HYDRO_IO=1 + echo " [INFO] HDF5Dir unset; HydroIO left ON for CMake HDF5 discovery (module/config)." >&2 fi if [[ "${MOORDYN}" -eq 1 && ! -f "${REPO_ROOT}/extern/MoorDyn/CMakeLists.txt" ]]; then