From 9d98b3fe095f9242605ac3806d2949e0b5021fe5 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 23 Apr 2024 21:36:43 +0200 Subject: [PATCH 1/3] Add k4Reco --- packages/k4reco/package.py | 45 +++++++++++++++++++++++++++++++ packages/key4hep-stack/package.py | 1 + scripts/fetch_nightly_versions.py | 1 + 3 files changed, 47 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..52a56871 --- /dev/null +++ b/packages/k4reco/package.py @@ -0,0 +1,45 @@ +from spack.pkg.k4.key4hep_stack import Ilcsoftpackage +from spack.pkg.k4.key4hep_stack import k4_setup_env_for_framework_tests + +class K4reco(CMakePackage, Ilcsoftpackage): + """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("lcio") + 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) + + def setup_build_environment(self, env): + env.prepend_path("LD_LIBRARY_PATH", self.spec["gaudi"].prefix.lib) + env.prepend_path("LD_LIBRARY_PATH", self.spec["gaudi"].prefix.lib64) + # k4_setup_env_for_framework_tests(self.spec, env) 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"), From d747c049627e96baa20ca0d225eedba164f90981 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 23 Apr 2024 21:37:28 +0200 Subject: [PATCH 2/3] Fix recipe --- packages/k4reco/package.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/k4reco/package.py b/packages/k4reco/package.py index 52a56871..14eca8fe 100644 --- a/packages/k4reco/package.py +++ b/packages/k4reco/package.py @@ -1,7 +1,7 @@ -from spack.pkg.k4.key4hep_stack import Ilcsoftpackage +from spack.pkg.k4.key4hep_stack import Key4hepPackage from spack.pkg.k4.key4hep_stack import k4_setup_env_for_framework_tests -class K4reco(CMakePackage, Ilcsoftpackage): +class K4reco(CMakePackage, Key4hepPackage): """Reconstruction algorithms using Gaudi in native key4hep""" homepage = "https://github.com/key4hep/k4Reco" @@ -15,7 +15,6 @@ class K4reco(CMakePackage, Ilcsoftpackage): depends_on("k4fwcore") depends_on("gaudi") depends_on("dd4hep") - depends_on("lcio") depends_on("k4simgeant4") def cmake_args(self): @@ -38,8 +37,3 @@ 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) - - def setup_build_environment(self, env): - env.prepend_path("LD_LIBRARY_PATH", self.spec["gaudi"].prefix.lib) - env.prepend_path("LD_LIBRARY_PATH", self.spec["gaudi"].prefix.lib64) - # k4_setup_env_for_framework_tests(self.spec, env) From 000df245f84339cd0d780a751a478b639d590b84 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 23 Apr 2024 21:37:52 +0200 Subject: [PATCH 3/3] Fix style --- packages/k4reco/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/k4reco/package.py b/packages/k4reco/package.py index 14eca8fe..5b9ccfbf 100644 --- a/packages/k4reco/package.py +++ b/packages/k4reco/package.py @@ -1,6 +1,7 @@ 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"""