Skip to content

Commit

Permalink
geant4: add v11.3.0 (spack#47961)
Browse files Browse the repository at this point in the history
* geant4: add v11.3.0
* geant4: rm deprecated 11.3.0.beta
* geant4: add 11.3.0 and associated data library versions
   - Data library versions taken from:
     - https://gitlab.cern.ch/geant4/geant4/-/blob/v11.3.0/cmake/Modules/G4DatasetDefinitions.cmake?ref_type=tags
   - Variants etc otherwise unchanged.
   - 11.3.0-beta version removed, release version marked as preffered.
* g4channeling: f-strings

---------

Co-authored-by: Ben Morgan <ben.morgan@warwick.ac.uk>
Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>
  • Loading branch information
3 people authored Dec 9, 2024
1 parent 728c5e0 commit 12dd120
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 15 deletions.
38 changes: 38 additions & 0 deletions var/spack/repos/builtin/packages/g4channeling/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2013-2024 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.package import *


class G4channeling(Package):
"""Geant4 data for solid state crystal channeling"""

homepage = "https://geant4.web.cern.ch"
url = "https://geant4-data.web.cern.ch/geant4-data/datasets/G4CHANNELING.1.0.tar.gz"

tags = ["hep"]

maintainers("drbenmorgan")

# Only versions relevant to Geant4 releases built by spack are added
version("1.0", sha256="203e3c69984ca09acd181a1d31a9b0efafad4bc12e6c608f0b05e695120d67f2")

def install(self, spec, prefix):
mkdirp(join_path(prefix.share, "data"))
install_path = join_path(prefix.share, "data", self.g4datasetname)
install_tree(self.stage.source_path, install_path)

def setup_dependent_run_environment(self, env, dependent_spec):
install_path = join_path(self.prefix.share, "data", self.g4datasetname)
env.set("G4CHANNELINGDATA", install_path)

def url_for_version(self, version):
"""Handle version string."""
return f"http://geant4-data.web.cern.ch/geant4-data/datasets/G4CHANNELING.{version}.tar.gz"

@property
def g4datasetname(self):
return f"G4CHANNELING{self.spec.version}"
1 change: 1 addition & 0 deletions var/spack/repos/builtin/packages/g4emlow/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class G4emlow(Package):
maintainers("drbenmorgan")

# Only versions relevant to Geant4 releases built by spack are added
version("8.6.1", sha256="4a93588d26080ce1d336b94f76fadabe4905fb8f1cba2415795023d6cd8f4a8a")
version("8.6", sha256="fb7abed0d1db1d8b9ea364279b95e228d7bf3e3a5dc8d449b81665cada4a1a9e")
version("8.5", sha256="66baca49ac5d45e2ac10c125b4fb266225e511803e66981909ce9cd3e9bcef73")
version("8.4", sha256="d87de4d2a364cb0a1e1846560525ffc3f735ccdeea8bc426d61775179aebbe8e")
Expand Down
1 change: 1 addition & 0 deletions var/spack/repos/builtin/packages/g4ensdfstate/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class G4ensdfstate(Package):
maintainers("drbenmorgan")

# Only versions relevant to Geant4 releases built by spack are added
version("3.0", sha256="4bdc3bd40b31d43485bf4f87f055705e540a6557d64ed85c689c59c9a4eba7d6")
version("2.3", sha256="9444c5e0820791abd3ccaace105b0e47790fadce286e11149834e79c4a8e9203")
version("2.2", sha256="dd7e27ef62070734a4a709601f5b3bada6641b111eb7069344e4f99a01d6e0a6")
version("2.1", sha256="933e7f99b1c70f24694d12d517dfca36d82f4e95b084c15d86756ace2a2790d9")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class G4photonevaporation(Package):
maintainers("drbenmorgan")

# Only versions relevant to Geant4 releases built by spack are added
version("6.1", sha256="5ffc1f99a81d50c9020186d59874af73c53ba24c1842b3b82b3188223bb246f2")
version("5.7", sha256="761e42e56ffdde3d9839f9f9d8102607c6b4c0329151ee518206f4ee9e77e7e5")
version("5.5", sha256="5995dda126c18bd7f68861efde87b4af438c329ecbe849572031ceed8f5e76d7")
version("5.3", sha256="d47ababc8cbe548065ef644e9bd88266869e75e2f9e577ebc36bc55bf7a92ec8")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class G4radioactivedecay(Package):
maintainers("drbenmorgan")

# Only versions relevant to Geant4 releases built by spack are added
version("6.1.2", sha256="a40d7e3ebc64d35555c4a49d0ff1e0945cd605d84354d053121293914caea13a")
version("5.6", sha256="3886077c9c8e5a98783e6718e1c32567899eeb2dbb33e402d4476bc2fe4f0df1")
version("5.4", sha256="240779da7d13f5bf0db250f472298c3804513e8aca6cae301db97f5ccdcc4a61")
version("5.3", sha256="5c8992ac57ae56e66b064d3f5cdfe7c2fee76567520ad34a625bfb187119f8c1")
Expand Down
1 change: 1 addition & 0 deletions var/spack/repos/builtin/packages/g4urrpt/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class G4urrpt(Package):
maintainers("drbenmorgan")

# Only versions relevant to Geant4 releases built by spack are added
version("1.1", sha256="6a3432db80bc088aee19c504b9c0124913005d6357ea14870451400ab20d9c11")
version("1.0", sha256="278eb6c4086e919d2c2a718eb44d4897b7e06d2a32909f6ed48eb8590b3f9977")

def install(self, spec, prefix):
Expand Down
11 changes: 6 additions & 5 deletions var/spack/repos/builtin/packages/geant4-data/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,19 @@ class Geant4Data(BundlePackage):
_datasets = {
"11.3.0:11.3": [
"g4ndl@4.7.1",
"g4emlow@8.6",
"g4photonevaporation@5.7",
"g4radioactivedecay@5.6",
"g4emlow@8.6.1",
"g4photonevaporation@6.1",
"g4radioactivedecay@6.1.2",
"g4particlexs@4.1",
"g4pii@1.3",
"g4realsurface@2.2",
"g4saiddata@2.0",
"g4abla@3.3",
"g4incl@1.2",
"g4ensdfstate@2.3",
"g4ensdfstate@3.0",
"g4channeling@1.0",
"g4nudexlib@1.0",
"g4urrpt@1.0",
"g4urrpt@1.1",
],
"11.2.2:11.2": [
"g4ndl@4.7.1",
Expand Down
12 changes: 2 additions & 10 deletions var/spack/repos/builtin/packages/geant4/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,8 @@ class Geant4(CMakePackage):
executables = ["^geant4-config$"]

maintainers("drbenmorgan", "sethrj")
version(
"11.3.0.beta",
sha256="572ba1570ca3b5b6f2a28ccbffa459901f6a986b79da1ebfdbf2f6f3dc5e14bf",
deprecated=True,
)
version(
"11.2.2",
sha256="3a8d98c63fc52578f6ebf166d7dffaec36256a186d57f2520c39790367700c8d",
preferred=True,
)
version("11.3.0", sha256="d9d71daff8890a7b5e0e33ea9a65fe6308ad6713000b43ba6705af77078e7ead")
version("11.2.2", sha256="3a8d98c63fc52578f6ebf166d7dffaec36256a186d57f2520c39790367700c8d")
version("11.2.1", sha256="76c9093b01128ee2b45a6f4020a1bcb64d2a8141386dea4674b5ae28bcd23293")
version("11.2.0", sha256="9ff544739b243a24dac8f29a4e7aab4274fc0124fd4e1c4972018213dc6991ee")
version("11.1.3", sha256="5d9a05d4ccf8b975649eab1d615fc1b8dce5937e01ab9e795bffd04149240db6")
Expand Down

0 comments on commit 12dd120

Please sign in to comment.