From 6e10fac7aed47f20ee9147011f8c35378a96f155 Mon Sep 17 00:00:00 2001 From: Stephen Sachs Date: Fri, 21 Mar 2025 16:23:33 +0100 Subject: [PATCH] openfoam: restrict the CGAL version compatible with C++14 (#47689) * openfoam: restrict the CGAL version compatible with C++14 CGAL throws an [error](https://github.com/CGAL/cgal/blob/50219fc33bc53b5846e9a4257befc6baef3f395a/Installation/include/CGAL/config.h#L147) if C++ lower than 17 is used, while OpenFOAM [forces C++14](https://develop.openfoam.com/Development/openfoam/-/blob/develop/wmake/rules/General/Gcc/c++?ref_type=heads#L9). This hard C++17 dependency was [introduced](https://github.com/CGAL/cgal/commit/e54408370b2583153dc923884a5ec1587bc7898e) to CGAL version 6. * Add upper bound since openfoam now uses c++17 https://develop.openfoam.com/Development/openfoam/-/commit/44f7a7268a5aec9e6e2ab519dd8f554c97c540d6 --- var/spack/repos/builtin/packages/openfoam/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/openfoam/package.py b/var/spack/repos/builtin/packages/openfoam/package.py index 898d8498b37..3bfddc1f765 100644 --- a/var/spack/repos/builtin/packages/openfoam/package.py +++ b/var/spack/repos/builtin/packages/openfoam/package.py @@ -373,7 +373,8 @@ class Openfoam(Package): # Earlier versions of OpenFOAM may not work with CGAL 5.6. I do # not know which OpenFOAM added support for 5.x and conservatively # use 2312 in the check. - depends_on("cgal", when="@2312:") + # cgal@6 needs c++17, but OpenFOAM forces c++14 + depends_on("cgal@:5", when="@2312:2412") depends_on("cgal@:4", when="@:2306") # The flex restriction is ONLY to deal with a spec resolution clash