From 928447c8a25641db5d96d47367709f27ab5c5ff8 Mon Sep 17 00:00:00 2001 From: Juan Miguel Carceller <22276694+jmcarcell@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:42:53 +0200 Subject: [PATCH] Add the new k4Reco package (#532) --- packages/k4reco/package.py | 40 +++++++++++++++++++++++++++++++ packages/key4hep-stack/package.py | 1 + scripts/fetch_nightly_versions.py | 1 + 3 files changed, 42 insertions(+) create mode 100644 packages/k4reco/package.py diff --git a/packages/k4reco/package.py b/packages/k4reco/package.py new file mode 100644 index 00000000..5b9ccfbf --- /dev/null +++ b/packages/k4reco/package.py @@ -0,0 +1,40 @@ +from spack.pkg.k4.key4hep_stack import Key4hepPackage +from spack.pkg.k4.key4hep_stack import k4_setup_env_for_framework_tests + + +class K4reco(CMakePackage, Key4hepPackage): + """Reconstruction algorithms using Gaudi in native key4hep""" + + homepage = "https://github.com/key4hep/k4Reco" + url = "https://github.com/key4hep/k4Reco/archive/v00-01.tar.gz" + git = "https://github.com/key4hep/k4Reco.git" + + version("master", branch="main") + + depends_on("root") + depends_on("edm4hep") + depends_on("k4fwcore") + depends_on("gaudi") + depends_on("dd4hep") + depends_on("k4simgeant4") + + def cmake_args(self): + args = [] + # C++ Standard + args.append( + self.define( + "CMAKE_CXX_STANDARD", self.spec["root"].variants["cxxstd"].value + ) + ) + return args + + def setup_dependent_build_environment(self, env, dependent_spec): + # needed to set up the runtime dependencies for tests + env.prepend_path("PYTHONPATH", self.prefix.python) + env.prepend_path("LD_LIBRARY_PATH", self.spec["k4reco"].prefix.lib) + env.prepend_path("LD_LIBRARY_PATH", self.spec["k4reco"].prefix.lib64) + + def setup_run_environment(self, env): + env.prepend_path("PYTHONPATH", self.prefix.python) + env.prepend_path("LD_LIBRARY_PATH", self.spec["k4reco"].prefix.lib) + env.prepend_path("LD_LIBRARY_PATH", self.spec["k4reco"].prefix.lib64) diff --git a/packages/key4hep-stack/package.py b/packages/key4hep-stack/package.py index c57a6dcc..376407d4 100644 --- a/packages/key4hep-stack/package.py +++ b/packages/key4hep-stack/package.py @@ -62,6 +62,7 @@ class Key4hepStack(BundlePackage, Key4hepPackage): depends_on("k4fwcore") depends_on("k4gen") depends_on("k4projecttemplate") + depends_on("k4reco") depends_on("k4simdelphes") depends_on("k4simgeant4") depends_on("kkmcee") diff --git a/scripts/fetch_nightly_versions.py b/scripts/fetch_nightly_versions.py index b3df5099..5e5f9bd5 100755 --- a/scripts/fetch_nightly_versions.py +++ b/scripts/fetch_nightly_versions.py @@ -110,6 +110,7 @@ def get_latest_commit( ("k4fwcore", "key4hep/k4fwcore"), ("k4gen", "hep-fcc/k4Gen"), ("k4geo", "key4hep/k4geo"), + ("k4reco", "key4hep/k4reco"), ("k4marlinwrapper", "key4hep/k4marlinwrapper"), ("k4projecttemplate", "key4hep/k4-project-template"), ("k4reccalorimeter", "hep-fcc/k4reccalorimeter"),