Fix recipe for evtgen 2.0; add variant for hepmc3 (#21814)
This commit is contained in:
parent
3c26084d2e
commit
22539f443e
@ -6,37 +6,68 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class Evtgen(AutotoolsPackage):
|
class Evtgen(CMakePackage):
|
||||||
""" EvtGen is a Monte Carlo event generator that simulates
|
""" EvtGen is a Monte Carlo event generator that simulates
|
||||||
the decays of heavy flavour particles, primarily B and D mesons. """
|
the decays of heavy flavour particles, primarily B and D mesons. """
|
||||||
|
|
||||||
homepage = "https://evtgen.hepforge.org/"
|
homepage = "https://evtgen.hepforge.org/"
|
||||||
url = "http://lcgpackages.web.cern.ch/lcgpackages/tarFiles/sources/MCGeneratorsTarFiles/evtgen-R01-07-00.tar.gz"
|
url = "https://evtgen.hepforge.org/downloads?f=EvtGen-02.00.00.tar.gz"
|
||||||
|
|
||||||
tags = ['hep']
|
tags = ['hep']
|
||||||
|
|
||||||
maintainers = ['vvolkl']
|
maintainers = ['vvolkl']
|
||||||
|
|
||||||
version('02-00-00', sha256='02372308e1261b8369d10538a3aa65fe60728ab343fcb64b224dac7313deb719')
|
version('02.00.00', sha256='02372308e1261b8369d10538a3aa65fe60728ab343fcb64b224dac7313deb719')
|
||||||
version('01-07-00', sha256='2648f1e2be5f11568d589d2079f22f589c283a2960390bbdb8d9d7f71bc9c014', preferred=True)
|
# switched to cmake in 02.00.00
|
||||||
|
version('01.07.00', sha256='2648f1e2be5f11568d589d2079f22f589c283a2960390bbdb8d9d7f71bc9c014', deprecated=True)
|
||||||
|
|
||||||
variant('pythia8', default=True, description='Build with pythia8')
|
variant('pythia8', default=True, description='Build with pythia8')
|
||||||
variant('tauola', default=False, description='Build with tauola')
|
variant('tauola', default=False, description='Build with tauola')
|
||||||
variant('photos', default=False, description='Build with photos')
|
variant('photos', default=False, description='Build with photos')
|
||||||
|
variant('hepmc3', default=False, description='Link with hepmc3 (instead of hepmc)')
|
||||||
|
|
||||||
patch("g2c.patch")
|
patch("g2c.patch", when='@01.07.00')
|
||||||
|
|
||||||
depends_on('hepmc@:2.99.99')
|
depends_on('hepmc', when='~hepmc3')
|
||||||
|
depends_on('hepmc3', when='+hepmc3')
|
||||||
depends_on("pythia8", when="+pythia8")
|
depends_on("pythia8", when="+pythia8")
|
||||||
depends_on("tauola", when="+tauola")
|
depends_on("tauola~hepmc3", when="+tauola~hepmc3")
|
||||||
depends_on("photos", when="+photos")
|
depends_on("photos~hepmc3", when="+photos~hepmc3")
|
||||||
|
depends_on("tauola+hepmc3", when="+tauola+hepmc3")
|
||||||
|
depends_on("photos+hepmc3", when="+photos+hepmc3")
|
||||||
|
|
||||||
conflicts("^pythia8+evtgen", when="+pythia8",
|
conflicts("^pythia8+evtgen", when="+pythia8",
|
||||||
msg="Building pythia with evtgen bindings and "
|
msg="Building pythia with evtgen bindings and "
|
||||||
"evtgen with pythia bindings results in a circular dependency "
|
"evtgen with pythia bindings results in a circular dependency "
|
||||||
"that cannot be resolved at the moment! "
|
"that cannot be resolved at the moment! "
|
||||||
"Use evtgen+pythia8^pythia8~evtgen.")
|
"Use evtgen+pythia8^pythia8~evtgen.")
|
||||||
|
conflicts('+hepmc3', when='@:01.99.99',
|
||||||
|
msg='hepmc3 support was added in 02.00.00')
|
||||||
|
|
||||||
|
def cmake_args(self):
|
||||||
|
args = []
|
||||||
|
|
||||||
|
args.append(self.define_from_variant('EVTGEN_PYTHIA', 'pythia8'))
|
||||||
|
args.append(self.define_from_variant('EVTGEN_TAUOLA', 'tauola'))
|
||||||
|
args.append(self.define_from_variant('EVTGEN_PHOTOS', 'photos'))
|
||||||
|
args.append(self.define_from_variant('EVTGEN_HEPMC3', 'hepmc3'))
|
||||||
|
|
||||||
|
return args
|
||||||
|
|
||||||
|
# Taken from AutotoolsPackage
|
||||||
|
def configure(self, spec, prefix):
|
||||||
|
"""Runs configure with the arguments specified in
|
||||||
|
:py:meth:`~.AutotoolsPackage.configure_args`
|
||||||
|
and an appropriately set prefix.
|
||||||
|
"""
|
||||||
|
options = getattr(self, 'configure_flag_args', [])
|
||||||
|
options += ['--prefix={0}'.format(prefix)]
|
||||||
|
options += self.configure_args()
|
||||||
|
|
||||||
|
with working_dir(self.build_directory, create=True):
|
||||||
|
inspect.getmodule(self).configure(*options)
|
||||||
|
|
||||||
|
@when('@:01.99.99')
|
||||||
def configure_args(self):
|
def configure_args(self):
|
||||||
args = []
|
args = []
|
||||||
|
|
||||||
@ -50,11 +81,23 @@ def configure_args(self):
|
|||||||
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
@when('@:01.99.99')
|
||||||
|
def cmake(self, spec, prefix):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@when('@:01.99.99')
|
||||||
def build(self, spec, prefix):
|
def build(self, spec, prefix):
|
||||||
|
self.configure(spec, prefix)
|
||||||
# avoid parallel compilation errors
|
# avoid parallel compilation errors
|
||||||
# due to libext_shared depending on lib_shared
|
# due to libext_shared depending on lib_shared
|
||||||
make('lib_shared')
|
with working_dir(self.build_directory):
|
||||||
make('all')
|
make('lib_shared')
|
||||||
|
make('all')
|
||||||
|
|
||||||
|
@when('@:01.99.99')
|
||||||
|
def install(self, spec, prefix):
|
||||||
|
with working_dir(self.build_directory):
|
||||||
|
make('install')
|
||||||
|
|
||||||
def setup_run_environment(self, env):
|
def setup_run_environment(self, env):
|
||||||
env.set("EVTGEN", self.prefix.share)
|
env.set("EVTGEN", self.prefix.share)
|
||||||
|
Loading…
Reference in New Issue
Block a user