summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorThomas Madlener <thomas.madlener@desy.de>2023-12-19 11:12:27 +0100
committerGitHub <noreply@github.com>2023-12-19 11:12:27 +0100
commit1ddf4ee6ba18a5fab291280e1fb7213987096b99 (patch)
treeef5f1566e6e1ee3ec0f215678e53f9a1077e61dc /var
parent12d0507cb74a7ef3dac80234d3d867fddd5ac52e (diff)
downloadspack-1ddf4ee6ba18a5fab291280e1fb7213987096b99.tar.gz
spack-1ddf4ee6ba18a5fab291280e1fb7213987096b99.tar.bz2
spack-1ddf4ee6ba18a5fab291280e1fb7213987096b99.tar.xz
spack-1ddf4ee6ba18a5fab291280e1fb7213987096b99.zip
whizard: fix support for building with hepmc output (#41538)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/whizard/package.py38
1 files changed, 21 insertions, 17 deletions
diff --git a/var/spack/repos/builtin/packages/whizard/package.py b/var/spack/repos/builtin/packages/whizard/package.py
index 3297c2eddb..a7ca1bf61d 100644
--- a/var/spack/repos/builtin/packages/whizard/package.py
+++ b/var/spack/repos/builtin/packages/whizard/package.py
@@ -99,12 +99,21 @@ class Whizard(AutotoolsPackage):
)
def setup_build_environment(self, env):
+ # whizard uses some environment variables to detect dependencies at
+ # configure time if they are not installed to standard system prefixes
+ if self.spec.satisfies("+lcio"):
+ env.set("LCIO", self.spec["lcio"].prefix)
+ if self.spec.satisfies("hepmc=2"):
+ env.set("HEPMC_DIR", self.spec["hepmc"].prefix)
+ if self.spec.satisfies("hepmc=3"):
+ env.set("HEPMC_DIR", self.spec["hepmc3"].prefix)
+ if self.spec.satisfies("+openloops"):
+ env.set("OPENLOOPS_DIR", self.spec["openloops"].prefix)
+
# whizard uses the compiler during runtime,
# and seems incompatible with
# filter_compiler_wrappers, thus the
# actual compilers need to be used to build
- if self.spec.satisfies("+lcio"):
- env.set("LCIO", self.spec["lcio"].prefix)
env.set("CC", self.compiler.cc)
env.set("CXX", self.compiler.cxx)
env.set("FC", self.compiler.fc)
@@ -112,30 +121,25 @@ class Whizard(AutotoolsPackage):
def configure_args(self):
spec = self.spec
+ enable_hepmc = "no" if "hepmc=off" in spec else "yes"
args = [
- "TIRPC_CFLAGS=-I%s" % spec["libtirpc"].prefix.include.tirpc,
- f"TIRPC_LIBS= -L{spec['libtirpc'].prefix.lib} -ltirpc",
- "--enable-hepmc=%s" % ("no" if "hepmc=off" in spec else "yes"),
- "--enable-fastjet=%s" % ("yes" if "+fastjet" in spec else "no"),
- "--enable-pythia8=%s" % ("yes" if "+pythia8" in spec else "no"),
- "--enable-lcio=%s" % ("yes" if "+lcio" in spec else "no"),
- "--enable-lhapdf=%s" % ("yes" if "+lhapdf" in spec else "no"),
- "--enable-openloops=%s" % ("yes" if "+openloops" in spec else "no"),
+ f"TIRPC_CFLAGS=-I{spec['libtirpc'].prefix.include.tirpc}",
+ f"TIRPC_LIBS=-L{spec['libtirpc'].prefix.lib} -ltirpc",
+ f"--enable-hepmc={enable_hepmc}",
# todo: hoppet
# todo: recola
# todo: looptools
# todo: gosam
# todo: pythia6
]
+ args.extend(self.enable_or_disable("fastjet"))
+ args.extend(self.enable_or_disable("pythia8"))
+ args.extend(self.enable_or_disable("lcio"))
+ args.extend(self.enable_or_disable("lhapdf"))
+ args.extend(self.enable_or_disable("openloops"))
if "+openloops" in spec:
- args.append("--with-openloops=%s" % spec["openloops"].prefix)
- if "+lcio" in spec:
- args.append("--with-lcio=%s" % spec["lcio"].prefix)
- if "hepmc=3" in spec:
- args.append("--with-hepmc=%s" % spec["hepmc3"].prefix)
- if "hepmc=2" in spec:
- args.append("--with-hepmc=%s" % spec["hepmc"].prefix)
+ args.append(f"--with-openloops={spec['openloops'].prefix}")
if "+openmp" not in spec:
args.append("--disable-openmp")
return args