From 87c76859fb44a805a83fbaa600fec50e9ff7dc1c Mon Sep 17 00:00:00 2001 From: Juan Miguel Carceller <22276694+jmcarcell@users.noreply.github.com> Date: Tue, 19 Mar 2024 23:11:24 +0100 Subject: [PATCH] Add the DDFastShowerML package (#572) --- environments/key4hep-nightly/packages.yaml | 2 ++ packages/ddfastshowerml/package.py | 33 ++++++++++++++++++++++ packages/ilcsoft/package.py | 1 + scripts/fetch_nightly_versions.py | 1 + 4 files changed, 37 insertions(+) create mode 100644 packages/ddfastshowerml/package.py diff --git a/environments/key4hep-nightly/packages.yaml b/environments/key4hep-nightly/packages.yaml index 1fe3dbf1..d7603429 100644 --- a/environments/key4hep-nightly/packages.yaml +++ b/environments/key4hep-nightly/packages.yaml @@ -15,6 +15,8 @@ packages: variants: build_type=RelWithDebInfo dd4hep: variants: build_type=RelWithDebInfo + ddfastshowerml: + variants: build_type=RelWithDebInfo ddkaltest: variants: build_type=RelWithDebInfo ddmarlinpandora: diff --git a/packages/ddfastshowerml/package.py b/packages/ddfastshowerml/package.py new file mode 100644 index 00000000..dd024236 --- /dev/null +++ b/packages/ddfastshowerml/package.py @@ -0,0 +1,33 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.pkg.k4.key4hep_stack import Ilcsoftpackage + + +class Ddfastshowerml(CMakePackage, Ilcsoftpackage): + """Package with utilities and plugins that allow to run fast simulation in Geant4 from ML inference within ddsim (DDG4)""" + + homepage = "https://gitlab.desy.de/ilcsoft/ddfastshowerml" + git = "https://gitlab.desy.de/ilcsoft/ddfastshowerml.git" + url = "https://gitlab.desy.de/ilcsoft/ddfastshowerml" + + maintainers = ["jmcarcell"] + + version("main", branch="main") + + variant("inference", values=("onnxruntime", "torch", "both"), default="both") + + depends_on("py-onnxruntime", when="inference=onnxruntime") + depends_on("py-onnxruntime", when="inference=both") + depends_on("py-torch", when="inference=torch") + depends_on("py-torch", when="inference=both") + depends_on("dd4hep") + + def cmake_args(self): + args = [] + args.append( + f"-DCMAKE_CXX_STANDARD={self.spec['root'].variants['cxxstd'].value}" + ) + return args diff --git a/packages/ilcsoft/package.py b/packages/ilcsoft/package.py index 343e9f38..24756d26 100644 --- a/packages/ilcsoft/package.py +++ b/packages/ilcsoft/package.py @@ -46,6 +46,7 @@ class Ilcsoft(BundlePackage, Key4hepPackage): depends_on("clicperformance") depends_on("clupatra") depends_on("ced") + depends_on("ddfastshowerml") depends_on("ddkaltest") depends_on("ddmarlinpandora") depends_on("fcalclusterer") diff --git a/scripts/fetch_nightly_versions.py b/scripts/fetch_nightly_versions.py index cf81ca49..526f572e 100755 --- a/scripts/fetch_nightly_versions.py +++ b/scripts/fetch_nightly_versions.py @@ -91,6 +91,7 @@ def get_latest_commit( ("clicperformance", "ilcsoft/clicperformance"), ("conformaltracking", "ilcsoft/conformaltracking"), ("dd4hep", "aidasoft/dd4hep"), + ("ddfastshowerml", "ilcsoft/ddfastshowerml"), ("ddkaltest", "ilcsoft/ddkaltest"), ("ddmarlinpandora", "ilcsoft/ddmarlinpandora"), ("delphes", "delphes/delphes"),