summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authoriarspider <iarspider@gmail.com>2021-10-04 14:06:49 +0200
committerGitHub <noreply@github.com>2021-10-04 14:06:49 +0200
commit50b1b654c93731f775ffc1b10cc49acd29b3a983 (patch)
treeef50c0643add411916d1f047b9a2e0e4366abd48 /var
parente9accaaca117c5e5cf2f8429e2fd83a1ab957e59 (diff)
downloadspack-50b1b654c93731f775ffc1b10cc49acd29b3a983.tar.gz
spack-50b1b654c93731f775ffc1b10cc49acd29b3a983.tar.bz2
spack-50b1b654c93731f775ffc1b10cc49acd29b3a983.tar.xz
spack-50b1b654c93731f775ffc1b10cc49acd29b3a983.zip
evtgen: fix mac build and version 2.0.0 with pythia >= 8.304. (#25933)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/evtgen/evtgen-2.0.0.patch39
-rw-r--r--var/spack/repos/builtin/packages/evtgen/package.py11
2 files changed, 50 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/evtgen/evtgen-2.0.0.patch b/var/spack/repos/builtin/packages/evtgen/evtgen-2.0.0.patch
new file mode 100644
index 0000000000..b5670c4a30
--- /dev/null
+++ b/var/spack/repos/builtin/packages/evtgen/evtgen-2.0.0.patch
@@ -0,0 +1,39 @@
+--- a/src/EvtGenExternal/EvtPythiaEngine.cpp.orig 2020-04-24 18:27:48.000000000 +0200
++++ b/src/EvtGenExternal/EvtPythiaEngine.cpp 2021-04-14 09:17:55.660743600 +0200
+@@ -36,7 +36,13 @@
+
+ #include <cmath>
+ #include <iostream>
+-#include <sstream>
++#include <sstream>
++
++#if PYTHIA_VERSION_INTEGER < 8304
++typedef Pythia8::ParticleDataEntry* ParticleDataEntryPtr;
++#else
++typedef Pythia8::ParticleDataEntryPtr ParticleDataEntryPtr;
++#endif
+
+ using std::endl;
+
+@@ -430,9 +436,9 @@
+ // or assignment will give it a different memory address and it will no longer refer to
+ // the original particleData information from the generator pointer.
+
+- Pythia8::ParticleDataEntry* entry_generic =
++ ParticleDataEntryPtr entry_generic =
+ _genericPythiaGen->particleData.particleDataEntryPtr( PDGCode );
+- Pythia8::ParticleDataEntry* entry_alias =
++ ParticleDataEntryPtr entry_alias =
+ _aliasPythiaGen->particleData.particleDataEntryPtr( PDGCode );
+
+ // Check that the PDG code is not zero/null and exclude other
+--- a/EvtGenBase/EvtMatrix.hh.orig 2021-04-13 23:20:29.588804900 +0200
++++ b/EvtGenBase/EvtMatrix.hh 2021-04-13 23:20:36.663547400 +0200
+@@ -23,6 +23,7 @@
+
+ #include <sstream>
+ #include <vector>
++#include <cmath>
+
+ template <class T>
+ class EvtMatrix {
diff --git a/var/spack/repos/builtin/packages/evtgen/package.py b/var/spack/repos/builtin/packages/evtgen/package.py
index 4e01e0953b..0809a4ba1a 100644
--- a/var/spack/repos/builtin/packages/evtgen/package.py
+++ b/var/spack/repos/builtin/packages/evtgen/package.py
@@ -27,6 +27,7 @@ class Evtgen(CMakePackage):
variant('hepmc3', default=False, description='Link with hepmc3 (instead of hepmc)')
patch("g2c.patch", when='@01.07.00')
+ patch("evtgen-2.0.0.patch", when='@02.00.00 ^pythia@8.304:')
depends_on('hepmc', when='~hepmc3')
depends_on('hepmc3', when='+hepmc3')
@@ -54,6 +55,16 @@ class Evtgen(CMakePackage):
return args
+ def patch(self):
+ # gcc on MacOS doesn't recognize `-shared`, should use `-dynamiclib`;
+ # the `-undefined dynamic_lookup` flag enables weak linking on Mac
+ # Patch taken from CMS recipe:
+ # https://github.com/cms-sw/cmsdist/blob/IB/CMSSW_12_1_X/master/evtgen.spec#L48
+ if not self.spec.satisfies("platform=darwin"):
+ return
+
+ filter_file('-shared', '-dynamiclib -undefined dynamic_lookup', 'make.inc')
+
# Taken from AutotoolsPackage
def configure(self, spec, prefix):
"""Runs configure with the arguments specified in