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 Jana2(CMakePackage, CudaPackage):
0010     """Multi-threaded HENP Event Reconstruction."""
0011 
0012     homepage = "https://jeffersonlab.github.io/JANA2/"
0013     url = "https://github.com/JeffersonLab/JANA2/archive/refs/tags/v2.0.3.tar.gz"
0014     list_url = "https://github.com/JeffersonLab/JANA2/tags"
0015     git = "https://github.com/JeffersonLab/JANA2.git"
0016 
0017     maintainer = ["wdconinc"]
0018 
0019     tags = ["eic"]
0020 
0021     version("master", branch="master")
0022     version("2.3.3", sha256="9cbb805e041ba54aea2c178f367ddf7b584b652cdbfa9f9be4d5ad7a22561861")
0023     version("2.3.2", sha256="26c5b521087cf526e9a498c9d1235531fdc28690f538221e422b79cc5fd0a87c")
0024     version("2.3.1", sha256="860e1f5019fbc9deed8768724e4d42956dc10ee55583852febde8dd7bf2b616e")
0025     version("2.3.0", sha256="7ebc914f1dafbd50d7296c92d67658b64f80e309e9812653413b525d84320b1d")
0026     version("2.2.1-rc1", sha256="7b65ce967d9c0690e22f4450733ead4acebf8fa510f792e0e4a6def14fb739b1")
0027     version("2.2.0", sha256="60940e182593dafddaa76d582d3270ac47694fa3f20257493e1017b34f624ba9")
0028     version("2.1.2", sha256="81b5b323289113d0fe666927afa3f81e76b3fcee0df7bff2c3fc1cb72fb240ce")
0029     version(
0030         "2.1.1",
0031         sha256="ea9926e0fb2fa1fa1f22acb6411d5bd521733f25031df114f118fa7fe2272a14",
0032     )
0033     version(
0034         "2.1.0",
0035         sha256="111f7a3c3a2357a4bbf54370740b22f641a99c83ec649d4ea9899c143371cf35",
0036     )
0037     version(
0038         "2.0.9",
0039         sha256="d8df3dc3390a239eae64eb58f6a5745608405b8aa91fb247965aaf2e321d269b",
0040         deprecated=True,
0041     )
0042     version(
0043         "2.0.8",
0044         sha256="b0c91a2780a66cd51cfeaf2ddbe44e2264afb4b2b2a91bc2d001802fb40c3a1b",
0045     )
0046     version(
0047         "2.0.7",
0048         sha256="56b4d1858d0f84e655b903eef07f5c6e23a9ed62219cd083ae279549dd051eb1",
0049     )
0050     version(
0051         "2.0.6",
0052         sha256="dc0bec6a63b6973171a714cb9eb2044b96c28f7aa5dd198e5be5858e5ec7ce7c",
0053     )
0054     version(
0055         "2.0.5",
0056         sha256="2e7297dfb0bd7f4a2f2fa3bca6b1c10b2553d321dec6060e48b0d75a5ed6717d",
0057     )
0058     version(
0059         "2.0.4",
0060         sha256="848adffcb881beb7835d01ce47a58991bb4f92664c9477196960ce8cfd94a3ca",
0061     )
0062     version(
0063         "2.0.3",
0064         sha256="fd34c40e2d6660ec08aca9208999dd9c8fe17de21c144ac68b6211070463e415",
0065     )
0066     version(
0067         "2.0.2",
0068         sha256="161d29c2b1efbfb36ec783734b45dff178b0c6bd77a2044d5a8829ba5b389b14",
0069     )
0070     version(
0071         "2.0.1",
0072         sha256="1471cc9c3f396dc242f8bd5b9c8828b68c3c0b72dbd7f0cfb52a95e7e9a8cf31",
0073     )
0074 
0075     variant(
0076         "podio", default=False, description="Build with PODIO support.", when="@2.1.0:"
0077     )
0078     variant("python", default=True, description="Build with Python bindings.")
0079     variant("root", default=False, description="Use ROOT for janarate.")
0080     variant("xerces", default=True, description="Build with XML support.")
0081     variant("zmq", default=False, description="Use zeroMQ for janacontrol.")
0082 
0083     depends_on("cxx", type="build")
0084     depends_on("cmake@3.16:", type="build")
0085     depends_on("cppzmq", when="+zmq")
0086     depends_on("py-pybind11@2.6.1:", when="+python")
0087     depends_on("root", when="+root")
0088     depends_on("xerces-c")
0089 
0090     with when("+podio"):
0091         depends_on("podio@0.16.3:")
0092         depends_on("podio@:0.17.3", when="@:2.1.2")  # uses podio/EventStore.h
0093         depends_on("py-jinja2")
0094         depends_on("py-pyyaml")
0095 
0096     conflicts("+cuda", when="@:2.0", msg="CUDA support only available in 2.1 and later")
0097 
0098     # JFactoryPodioT.h: ClearData (https://github.com/JeffersonLab/JANA2/pull/243)
0099     patch(
0100         "https://github.com/JeffersonLab/JANA2/pull/243.patch?full_index=1",
0101         sha256="f1b89fe245ac44fec815b7cf97d40924acf1281cd2aeb31ee33ad76a13e0abd4",
0102         when="@2.1.1",
0103     )
0104     # JResourcePool.h: alignas (https://github.com/JeffersonLab/JANA2/pull/239)
0105     patch(
0106         "https://github.com/JeffersonLab/JANA2/pull/239.patch?full_index=1",
0107         sha256="a32220ba30f18f30c196a604c9ccf9ed01676a81aadfad0028214b42a4363e25",
0108         when="@2.0.6:2.1.1",
0109     )
0110     # JBacktrace.h: free after use (https://github.com/JeffersonLab/JANA2/pull/224)
0111     patch(
0112         "https://github.com/JeffersonLab/JANA2/pull/224.patch?full_index=1",
0113         sha256="cc3820e391caae8f4fe08d96f49fa2b38e454aaf37edde7dbd6fb4537a01af61",
0114         when="@2.0.2:2.1.0",
0115     )
0116     # Stop printing the component summary
0117     patch(
0118         "https://github.com/JeffersonLab/JANA2/commit/8ed069da7f307d12cafd6b075eae8401aec6f5aa.diff?full_index=1",
0119         sha256="65f4b71d5cbf40ca5ece32ebab20a2da651201cf8dc89a09ab656dec2075f1f3",
0120         when="@2.3.2",
0121     )
0122 
0123     def cmake_args(self):
0124         args = [
0125             self.define_from_variant("USE_CUDA", "cuda"),
0126             self.define_from_variant("USE_ROOT", "root"),
0127             self.define_from_variant("USE_ZEROMQ", "zmq"),
0128             self.define_from_variant("USE_PYTHON", "python"),
0129         ]
0130 
0131         # Podio
0132         if "+podio" in self.spec:
0133             args.append("-DUSE_PODIO=On")
0134 
0135         # ZeroMQ directory
0136         if "+zmq" in self.spec:
0137             args.append("-DZEROMQ_DIR=%s" % self.spec["cppzmq"].prefix)
0138 
0139         # C++ standard (defined by ROOT)
0140         if "+root" in self.spec:
0141             args.append(
0142                 "-DCMAKE_CXX_STANDARD=%s" % self.spec["root"].variants["cxxstd"].value
0143             )
0144 
0145         return args
0146 
0147     def setup_run_environment(self, env):
0148         env.append_path("JANA_PLUGIN_PATH", join_path(self.prefix, "plugins"))
0149         env.set("JANA_HOME", self.prefix)