diff --git a/var/spack/repos/builtin/packages/cdo/add_algorithm_header.patch b/var/spack/repos/builtin/packages/cdo/add_algorithm_header.patch new file mode 100644 index 00000000000..2e9e6803ae8 --- /dev/null +++ b/var/spack/repos/builtin/packages/cdo/add_algorithm_header.patch @@ -0,0 +1,22 @@ +diff --git a/src/cdo_module.cc b/src/cdo_module_patched.cc +index dc408d9..f50c2d3 100644 +--- a/src/cdo_module.cc ++++ b/src/cdo_module_patched.cc +@@ -1,4 +1,5 @@ + #include "cdo_module.h" ++#include + + oper_t::oper_t() : help(default_help) {} + +diff --git a/src/cdo_options.cc b/src/cdo_options_patched.cc +index 465f1f9..0684e78 100644 +--- a/src/cdo_options.cc ++++ b/src/cdo_options_patched.cc +@@ -12,6 +12,7 @@ + #include "cdo_output.h" + + #include ++#include + + namespace cdo + { diff --git a/var/spack/repos/builtin/packages/cdo/add_algorithm_header_222.patch b/var/spack/repos/builtin/packages/cdo/add_algorithm_header_222.patch new file mode 100644 index 00000000000..319e140ef43 --- /dev/null +++ b/var/spack/repos/builtin/packages/cdo/add_algorithm_header_222.patch @@ -0,0 +1,23 @@ +diff --git a/src/cdo_options.cc b/src/cdo_options_patched.cc +index 465f1f9..0684e78 100644 +--- a/src/cdo_options.cc ++++ b/src/cdo_options_patched.cc +@@ -12,6 +12,7 @@ + #include "cdo_output.h" + + #include ++#include + + namespace cdo + { +diff -u src/cdo_options.h src/cdo_options_patched.h +--- a/src/cdo_options.h ++++ b/src/cdo_options_patched.h +@@ -3,6 +3,7 @@ + + #include + #include ++#include + + #ifdef HAVE_CONFIG_H + #include "config.h" /* _FILE_OFFSET_BITS influence off_t */ diff --git a/var/spack/repos/builtin/packages/cdo/package.py b/var/spack/repos/builtin/packages/cdo/package.py index 9f6910fa049..2c399592073 100644 --- a/var/spack/repos/builtin/packages/cdo/package.py +++ b/var/spack/repos/builtin/packages/cdo/package.py @@ -170,6 +170,20 @@ class Cdo(AutotoolsPackage): depends_on("cxx", type="build") # generated depends_on("fortran", type="build") # generated + # patches + # see https://code.mpimet.mpg.de/boards/1/topics/15594 + patch( + "add_algorithm_header.patch", + when="@2.4.0:2.4.2 %gcc@14:", + sha256="0bc20d2fcb14d8e4010d4222297f259eb7b4220effd97555ed3f027e63cf8b30", + ) + patch( + "add_algorithm_header_222.patch", + when="@2.2.2:2.3.0 %gcc@14:", + sha256="db0d9bd32bbee01d914c1dbebd751403e9c918fafd540fd6ecc6a2f27e0900cf", + ) + conflicts("%gcc@14:", when="@:2.2.0", msg="Compilation with gcc@14: requires cdo@2.2.2:") + variant("netcdf", default=True, description="Enable NetCDF support") variant( "grib2",