Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:15:26

0001 # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
0002 # Spack Project Developers. See the top-level COPYRIGHT file for details.
0003 #
0004 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
0005 
0006 from spack.package import *
0007 
0008 
0009 class G4e(CMakePackage):
0010     """Geant for EIC."""
0011 
0012     homepage = "https://g4e.readthedocs.io/en/latest/"
0013     url = "https://gitlab.com/eic/escalate/g4e/-/archive/v1.3.2/g4e-v1.3.2.tar.gz"
0014     git = "https://gitlab.com/eic/escalate/g4e.git"
0015     list_url = "https://gitlab.com/eic/escalate/g4e/-/tags"
0016 
0017     maintainer = ["DraTeots"]
0018 
0019     tags = ["eic"]
0020 
0021     version("master", branch="master")
0022     version(
0023         "1.4.2",
0024         sha256="252928a819541fdffc70e522f5cf9160ed219f7be02d9dcd507ae958e9d376b3",
0025     )
0026     version(
0027         "1.4.1",
0028         sha256="2986100c30b061c267306fb73e5709b28609ee00ec686b2c1de3398acbc9ccd6",
0029     )
0030     version(
0031         "1.3.8",
0032         sha256="451dee2ae8e1f0824d4f0ed7672aaad5e2b76dd3a5a95e38f2820eb51ec216c6",
0033     )
0034     version(
0035         "1.3.7",
0036         sha256="98f5387f8169ec922a162d6073544c231e3989fe7a8e5cc2e3582cbc8f312095",
0037     )
0038     version(
0039         "1.3.6",
0040         sha256="051ce2b1ff87df314a6395c22b33da19e1555caddd94d3863687101cdafad72b",
0041     )
0042     version(
0043         "1.3.5",
0044         sha256="e92d95df4b873bff3dff9fcff8a5535410a19004ae00c4a166f3adab8bd90279",
0045     )
0046     version(
0047         "1.3.4",
0048         sha256="9958a08a7cb8a8ce8b44d96e5e3c9b0bf45b2cb7bb9736f73a00cd907b73ffc8",
0049     )
0050     version(
0051         "1.3.2",
0052         sha256="bf0c035e6e213d71aafd5851e35210f2c70742b82b7d3222b2f2fdf05c09c8f8",
0053     )
0054     version(
0055         "1.3.1",
0056         sha256="98afe3c3efe3dbad5b13b6d33964c600155a8a6684786a81181a987c0a358f50",
0057     )
0058 
0059     # This compatibility variant allows to use g4e with older root and geant versions
0060     variant(
0061         "validated",
0062         default=False,
0063         description="Validated working version with fixed dependencies",
0064     )
0065 
0066     depends_on("cxx", type="build")
0067     depends_on("cmake@3.0.0:", type="build", when="~validated")
0068     depends_on("root@6.00.00:", when="~validated")
0069     depends_on("geant4@10.6:", when="~validated")
0070     depends_on("vgm@4-7:", when="~validated")
0071     depends_on("hepmc@2.06:", when="~validated")
0072     depends_on("python", when="~validated")
0073 
0074     # This uses the latest versions consistent over escalate
0075     depends_on("cmake@3.0.0:", type="build", when="+validated")
0076     depends_on(
0077         "root@6.20.04 +vmc +pythia6 +pythia8 +root7 cxxstd=17", when="+validated"
0078     )
0079     depends_on("geant4@10.6.2 +opengl +python +qt cxxstd=17", when="+validated")
0080     depends_on("vgm@4-8", when="+validated")
0081     depends_on("hepmc@2.06.10", when="+validated")
0082 
0083     def cmake_args(self):
0084         args = []
0085         # >oO debug: from ppretty import ppretty
0086         # >oO debug: print(ppretty(self, seq_length=20))
0087 
0088         args.append(
0089             "-DCMAKE_CXX_STANDARD={}".format(self.spec["root"].variants["cxxstd"].value)
0090         )
0091         args.append("-DGEANT4_DIR={0}".format(self.spec["geant4"].prefix))
0092         args.append("-DVGM_DIRECTORY={0}".format(self.spec["vgm"].prefix))
0093         args.append("-DHEPMC_DIRECTORY={0}".format(self.spec["hepmc"].prefix))
0094         args.append("-DCERN_ROOT_DIRECTORY={0}".format(self.spec["root"].prefix))
0095 
0096         return args
0097 
0098     def setup_run_environment(self, env):
0099         env.append_path("G4E_MACRO_PATH", self.prefix)
0100         env.prepend_path("PYTHONPATH", self.prefix.python)
0101         env.set("G4E_HOME", self.prefix)