From 6f2afa0b377ac7e24aef2f84f57bc402bad5b5a1 Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Wed, 20 Nov 2024 11:52:00 +0100 Subject: [PATCH 1/6] Add a base package that bundles a bunch of common deps --- environments/key4hep-dev-base/spack.yaml | 18 +++++++ packages/key4hep-base-stack/package.py | 66 ++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 environments/key4hep-dev-base/spack.yaml create mode 100644 packages/key4hep-base-stack/package.py diff --git a/environments/key4hep-dev-base/spack.yaml b/environments/key4hep-dev-base/spack.yaml new file mode 100644 index 00000000..bd1e3520 --- /dev/null +++ b/environments/key4hep-dev-base/spack.yaml @@ -0,0 +1,18 @@ +spack: + packages: + all: + variants: + - build_type=RelWithDebInfo + - 'cxxstd=20' + target: [] + compiler: [] + + boost: + require: +context+exception+fiber+filesystem+graph+log+multithreaded+program_options+python+regex+system+shared+test+thread + + view: false + include: + - ../key4hep-common/packages.yaml + + specs: + - key4hep-base-stack diff --git a/packages/key4hep-base-stack/package.py b/packages/key4hep-base-stack/package.py new file mode 100644 index 00000000..d9c7cdad --- /dev/null +++ b/packages/key4hep-base-stack/package.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 + +from datetime import datetime + +from spack.pkg.k4.key4hep_stack import Key4hepPackage, install_setup_script + + +class Key4hepBaseStack(BundlePackage, Key4hepPackage): + """Bundle package that contains a base software stack upon which Key4hep can + be built + + The packages in this base stack are mainly + """ + + homepage = "https://cern.ch/key4hep" + + version(datetime.today().strftime("%Y-%m-%d")) + + # this bundle package installs a custom setup script, so + # need to add the install phase (which normally does not + # exist for a bundle package) + phases = ["install"] + + # Some generally useful development tools + depends_on("cmake") + depends_on("ninja") + depends_on("python") + depends_on("gdb") + depends_on("catch2@3:") + depends_on("boost") + depends_on("py-pytest") + + # general hep packages + depends_on("root") + depends_on("geant4") + depends_on("pythia8") + depends_on("hepmc3") + depends_on("evtgen +photos+tauola+pythia8+hepmc3") + depends_on("heppdt") + depends_on("fastjet") + + # podio dependencies + depends_on("py-pyyaml") + depends_on("py-tabulate") + depends_on("py-jinja2") + depends_on("py-graphviz") + + # other general deps + depends_on("py-numpy") + depends_on("py-scipy") + + # gaudi dependencies + depends_on("py-nose") + depends_on("cppgsl") + depends_on("fmt") + depends_on("cppunit") + depends_on("gperftools") + depends_on("py-networkx") + depends_on("py-six") + depends_on("range-v3") + depends_on("py-pytest-cov") + depends_on("jemalloc") + depends_on("aida") + + def install(self, spec, prefix): + return install_setup_script(self, spec, prefix, "K4_BASE_STACK") From 934ae29871bccaa8a40728232acfb159162c9b42 Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Thu, 21 Nov 2024 12:25:03 +0100 Subject: [PATCH 2/6] Require +atomic for boost since something wants that --- environments/key4hep-dev-base/spack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environments/key4hep-dev-base/spack.yaml b/environments/key4hep-dev-base/spack.yaml index bd1e3520..31cd198f 100644 --- a/environments/key4hep-dev-base/spack.yaml +++ b/environments/key4hep-dev-base/spack.yaml @@ -8,7 +8,7 @@ spack: compiler: [] boost: - require: +context+exception+fiber+filesystem+graph+log+multithreaded+program_options+python+regex+system+shared+test+thread + require: +atomic+context+exception+fiber+filesystem+graph+log+multithreaded+program_options+python+regex+system+shared+test+thread view: false include: From c8f64dc5ca6d889bb651b76d1f6ea0d53db5a293 Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Thu, 21 Nov 2024 13:18:39 +0100 Subject: [PATCH 3/6] Add all boost variants that are required --- environments/key4hep-dev-base/spack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environments/key4hep-dev-base/spack.yaml b/environments/key4hep-dev-base/spack.yaml index 31cd198f..1bdd0d9f 100644 --- a/environments/key4hep-dev-base/spack.yaml +++ b/environments/key4hep-dev-base/spack.yaml @@ -8,7 +8,7 @@ spack: compiler: [] boost: - require: +atomic+context+exception+fiber+filesystem+graph+log+multithreaded+program_options+python+regex+system+shared+test+thread + require: +atomic+chrono+context+date_time+exception+fiber+filesystem+graph+iostreams+locale+log+math+multithreaded+program_options+python+random+regex+serialization+shared+signals+system+test+thread+timer+wave view: false include: From 9cbe54c05afd92a91425e57af5c8ab59d08d8fe8 Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Fri, 22 Nov 2024 14:48:07 +0100 Subject: [PATCH 4/6] Make sure we have a suitable fmt version --- environments/key4hep-common/packages.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/environments/key4hep-common/packages.yaml b/environments/key4hep-common/packages.yaml index 69587c5d..e2ffc74b 100644 --- a/environments/key4hep-common/packages.yaml +++ b/environments/key4hep-common/packages.yaml @@ -53,6 +53,8 @@ packages: xrootd: require: +krb5 cxxstd=20 + fmt: + require: "@:10" # Use the system OpenGL as recommended by spack # See https://github.com/key4hep/key4hep-spack/issues/318 and # https://github.com/key4hep/key4hep-spack/issues/516 From 9b672351d1eb7bdd3c06943ea4164d5df2dd2d86 Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Tue, 17 Dec 2024 19:21:48 +0100 Subject: [PATCH 5/6] Rename base stack to external stack --- .../{key4hep-dev-base => key4hep-dev-external}/spack.yaml | 2 +- .../package.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename environments/{key4hep-dev-base => key4hep-dev-external}/spack.yaml (94%) rename packages/{key4hep-base-stack => key4hep-external-stack}/package.py (90%) diff --git a/environments/key4hep-dev-base/spack.yaml b/environments/key4hep-dev-external/spack.yaml similarity index 94% rename from environments/key4hep-dev-base/spack.yaml rename to environments/key4hep-dev-external/spack.yaml index 1bdd0d9f..510d7e0f 100644 --- a/environments/key4hep-dev-base/spack.yaml +++ b/environments/key4hep-dev-external/spack.yaml @@ -15,4 +15,4 @@ spack: - ../key4hep-common/packages.yaml specs: - - key4hep-base-stack + - key4hep-external-stack diff --git a/packages/key4hep-base-stack/package.py b/packages/key4hep-external-stack/package.py similarity index 90% rename from packages/key4hep-base-stack/package.py rename to packages/key4hep-external-stack/package.py index d9c7cdad..c4878b6d 100644 --- a/packages/key4hep-base-stack/package.py +++ b/packages/key4hep-external-stack/package.py @@ -5,9 +5,9 @@ from spack.pkg.k4.key4hep_stack import Key4hepPackage, install_setup_script -class Key4hepBaseStack(BundlePackage, Key4hepPackage): - """Bundle package that contains a base software stack upon which Key4hep can - be built +class Key4hepExternalStack(BundlePackage, Key4hepPackage): + """Bundle package that contains a basic external software stack upon which + Key4hep can be built The packages in this base stack are mainly """ From 334aa25cf90cbbaf693ac29509d4d7b790effecb Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Tue, 17 Dec 2024 19:30:26 +0100 Subject: [PATCH 6/6] Make sure to explicitly import from spack --- packages/key4hep-external-stack/package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/key4hep-external-stack/package.py b/packages/key4hep-external-stack/package.py index c4878b6d..e1f9f4f2 100644 --- a/packages/key4hep-external-stack/package.py +++ b/packages/key4hep-external-stack/package.py @@ -4,6 +4,8 @@ from spack.pkg.k4.key4hep_stack import Key4hepPackage, install_setup_script +from common import * + class Key4hepExternalStack(BundlePackage, Key4hepPackage): """Bundle package that contains a basic external software stack upon which