diff options
author | Paul Gessinger <paul.gessinger@cern.ch> | 2024-11-05 03:34:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-04 20:34:47 -0600 |
commit | f8da72cffe07d8836159c7bc6984c13fa4bb2656 (patch) | |
tree | 0b3917450fb9f8e17415bbf50c5cd0bf62807fe8 /var | |
parent | 8650ba3cea6cfd15713f6f76898ef4e0d53e2abe (diff) | |
download | spack-f8da72cffe07d8836159c7bc6984c13fa4bb2656.tar.gz spack-f8da72cffe07d8836159c7bc6984c13fa4bb2656.tar.bz2 spack-f8da72cffe07d8836159c7bc6984c13fa4bb2656.tar.xz spack-f8da72cffe07d8836159c7bc6984c13fa4bb2656.zip |
pythia8: Include patch for C++20 / Clang (#47400)
* pythia8: Include patch for C++20 / Clang
Pythia8 vendors some FJCore sources that are as of Pythia8 312
incompatible with C++20 on clang. This adds a patch that makes it
compatible in these scenarios
* Add issue link
* rename setup_cxxstd function
* Remove an accidental printout
* Apply patch to all compilers, add lower bound
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/pythia8/package.py | 17 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/pythia8/pythia8-cpp20-fjcore-forward-decl.patch | 37 |
2 files changed, 47 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/pythia8/package.py b/var/spack/repos/builtin/packages/pythia8/package.py index 7bf7494b7d..d70cc40d3f 100644 --- a/var/spack/repos/builtin/packages/pythia8/package.py +++ b/var/spack/repos/builtin/packages/pythia8/package.py @@ -132,17 +132,20 @@ class Pythia8(AutotoolsPackage): filter_compiler_wrappers("Makefile.inc", relative_root="share/Pythia8/examples") @run_before("configure") - def setup_cxxstd(self): + def setup_configure(self): filter_file( r"-std=c\+\+[0-9][0-9]", f"-std=c++{self.spec.variants['cxxstd'].value}", "configure" ) - # Fix for https://gitlab.com/Pythia8/releases/-/issues/428 - @when("@:8.311") - def patch(self): - filter_file( - r"[/]examples[/]Makefile[.]inc\|;n' \\", "/examples/Makefile.inc|' \\", "configure" - ) + # Fix for https://gitlab.com/Pythia8/releases/-/issues/428 + with when("@:8.311"): + filter_file( + r"[/]examples[/]Makefile[.]inc\|;n' \\", "/examples/Makefile.inc|' \\", "configure" + ) + + # Fix for https://gitlab.com/Pythia8/releases/-/issues/523 + with when("@8.307:8.312 cxxstd=20"): + patch("pythia8-cpp20-fjcore-forward-decl.patch") def configure_args(self): args = [] diff --git a/var/spack/repos/builtin/packages/pythia8/pythia8-cpp20-fjcore-forward-decl.patch b/var/spack/repos/builtin/packages/pythia8/pythia8-cpp20-fjcore-forward-decl.patch new file mode 100644 index 0000000000..447e73cba5 --- /dev/null +++ b/var/spack/repos/builtin/packages/pythia8/pythia8-cpp20-fjcore-forward-decl.patch @@ -0,0 +1,37 @@ +diff --git a/src/FJcore.cc b/src/FJcore.cc +index c60108e2..afd32eee 100644 +--- a/src/FJcore.cc ++++ b/src/FJcore.cc +@@ -730,14 +730,10 @@ FJCORE_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh + class ClosestPair2D : public ClosestPair2DBase { + public: + ClosestPair2D(const std::vector<Coord2D> & positions, +- const Coord2D & left_corner, const Coord2D & right_corner) { +- _initialize(positions, left_corner, right_corner, positions.size()); +- }; ++ const Coord2D & left_corner, const Coord2D & right_corner); + ClosestPair2D(const std::vector<Coord2D> & positions, + const Coord2D & left_corner, const Coord2D & right_corner, +- const unsigned int max_size) { +- _initialize(positions, left_corner, right_corner, max_size); +- }; ++ const unsigned int max_size); + void closest_pair(unsigned int & ID1, unsigned int & ID2, + double & distance2) const; + void remove(unsigned int ID); +@@ -808,6 +804,15 @@ public: + return coord.distance2(other.coord); + }; + }; ++inline ClosestPair2D::ClosestPair2D(const std::vector<Coord2D> & positions, ++ const Coord2D & left_corner, const Coord2D & right_corner) { ++ _initialize(positions, left_corner, right_corner, positions.size()); ++}; ++inline ClosestPair2D::ClosestPair2D(const std::vector<Coord2D> & positions, ++ const Coord2D & left_corner, const Coord2D & right_corner, ++ const unsigned int max_size) { ++ _initialize(positions, left_corner, right_corner, max_size); ++}; + inline bool floor_ln2_less(unsigned x, unsigned y) { + if (x>y) return false; + return (x < (x^y)); // beware of operator precedence... |