summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorRichard Berger <rberger@lanl.gov>2023-11-30 13:55:25 -0700
committerGitHub <noreply@github.com>2023-11-30 12:55:25 -0800
commit5be3ca396b1b312df3c23a9b2f1a2f598e0a0cb0 (patch)
tree54cc250ebe6d765278352509d92fd354911cff97 /var
parente420441bc2a4690aaf9223965acb1cd67e465e38 (diff)
downloadspack-5be3ca396b1b312df3c23a9b2f1a2f598e0a0cb0.tar.gz
spack-5be3ca396b1b312df3c23a9b2f1a2f598e0a0cb0.tar.bz2
spack-5be3ca396b1b312df3c23a9b2f1a2f598e0a0cb0.tar.xz
spack-5be3ca396b1b312df3c23a9b2f1a2f598e0a0cb0.zip
Singularity-EOS update (#41333)
* singularity-eos: deprecate v1.6 versions and remove unused code * singularity-eos: add v1.8.0
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/singularity-eos/package.py94
1 files changed, 50 insertions, 44 deletions
diff --git a/var/spack/repos/builtin/packages/singularity-eos/package.py b/var/spack/repos/builtin/packages/singularity-eos/package.py
index b11dd607db..4e9cdb3470 100644
--- a/var/spack/repos/builtin/packages/singularity-eos/package.py
+++ b/var/spack/repos/builtin/packages/singularity-eos/package.py
@@ -19,9 +19,18 @@ class SingularityEos(CMakePackage, CudaPackage):
maintainers("rbberger")
version("main", branch="main")
+ version("1.8.0", sha256="1f1ec496f714aa23cc7003c88a85bd10d0e53e37659ba7310541248e48a66558")
version("1.7.0", sha256="ce0825db2e9d079503e98cecf1c565352be696109042b3a0941762b35f36dc49")
- version("1.6.2", sha256="9c85fca679139a40cc9c72fcaeeca78a407cc1ca184734785236042de364b942")
- version("1.6.1", sha256="c6d92dfecf9689ffe2df615791c039f7e527e9f47799a862e26fa4e3420fe5d7")
+ version(
+ "1.6.2",
+ sha256="9c85fca679139a40cc9c72fcaeeca78a407cc1ca184734785236042de364b942",
+ deprecated=True,
+ )
+ version(
+ "1.6.1",
+ sha256="c6d92dfecf9689ffe2df615791c039f7e527e9f47799a862e26fa4e3420fe5d7",
+ deprecated=True,
+ )
# build with kokkos, kokkos-kernels for offloading support
variant("kokkos", default=False, description="Enable kokkos")
@@ -47,20 +56,36 @@ class SingularityEos(CMakePackage, CudaPackage):
# build the Python bindings
variant("python", default=False, description="Enable building Python bindings")
- variant("eospac", default=True, description="Pull in EOSPAC")
+ variant("eospac", default=True, description="Enable EOSPAC for table reads")
+
+ variant("hdf5", default=False, description="Enable HDF5 support")
+
+ variant("spiner", default=True, description="Use Spiner")
+
+ variant("closure", default=True, description="Build closure module")
# building/testing/docs
- depends_on("cmake@3.14:", type="build")
- depends_on("catch2@2.13.7", type="test")
+ depends_on("cmake@3.19:", type="build")
depends_on("python@3:", when="+python")
depends_on("py-pybind11@2.9.1:", when="+python")
+ depends_on("catch2@2.13.7", type="test")
+ depends_on("py-numpy", type="test")
# linear algebra when not using GPUs
- depends_on("eigen@3.3.8", when="~cuda")
+ depends_on("eigen@3.3.8", when="~kokkos-kernels~cuda")
depends_on("eospac", when="+eospac")
- depends_on("spiner")
- depends_on("spiner +kokkos", when="+kokkos")
+
+ depends_on("ports-of-call@1.4.2,1.5.2:", when="@:1.7.0")
+ depends_on("ports-of-call@1.5.2:", when="@1.7.1:")
+ depends_on("ports-of-call@main", when="@main")
+
+ depends_on("spiner +kokkos", when="+kokkos+spiner")
+ depends_on("spiner +hdf5", when="+hdf5+spiner")
+
+ depends_on("spiner@:1.6.0", when="@:1.7.0 +spiner")
+ depends_on("spiner@1.6.1:", when="@1.8.0: +spiner")
+ depends_on("spiner@main", when="@main +spiner")
depends_on("mpark-variant")
depends_on(
@@ -72,14 +97,18 @@ class SingularityEos(CMakePackage, CudaPackage):
when="+cuda",
)
+ for _myver, _kver in zip(("@:1.6.2", "@1.7.0:"), ("@3.2:", "@3.3:")):
+ depends_on("kokkos" + _kver, when=_myver + "+kokkos")
+ depends_on("kokkos-kernels" + _kver, when=_myver + "+kokkos-kernels")
+
# set up kokkos offloading dependencies
for _flag in ("~cuda", "+cuda", "~openmp", "+openmp"):
- depends_on("kokkos@3.2: ~shared" + _flag, when="+kokkos" + _flag)
- depends_on("kokkos-kernels@3.2:" + _flag, when="+kokkos-kernels" + _flag)
+ depends_on("kokkos ~shared" + _flag, when="+kokkos" + _flag)
+ depends_on("kokkos-kernels" + _flag, when="+kokkos-kernels" + _flag)
depends_on("spiner" + _flag, when="+kokkos" + _flag)
# specfic specs when using GPU/cuda offloading
- depends_on("kokkos +wrapper+cuda_lambda+cuda_relocatable_device_code", when="+cuda+kokkos")
+ depends_on("kokkos +wrapper+cuda_lambda", when="+cuda+kokkos")
# fix for older spacks
if spack.version.Version(spack.spack_version) >= spack.version.Version("0.17"):
@@ -92,19 +121,21 @@ class SingularityEos(CMakePackage, CudaPackage):
conflicts("cuda_arch=none", when="+cuda", msg="CUDA architecture is required")
- # NOTE: we can do depends_on("libfoo cppflags='-fPIC -O2'") for compiler options
-
# these are mirrored in the cmake configuration
conflicts("+cuda", when="~kokkos")
conflicts("+openmp", when="~kokkos")
conflicts("+kokkos-kernels", when="~kokkos")
+ conflicts("+hdf5", when="~spiner")
+
+ conflicts("+fortran", when="~closure")
# NOTE: these are set so that dependencies in downstream projects share
# common MPI dependence
for _flag in ("~mpi", "+mpi"):
- depends_on("hdf5~cxx+hl" + _flag, when=_flag)
+ depends_on("hdf5~cxx+hl" + _flag, when="+hdf5" + _flag)
depends_on("py-h5py" + _flag, when="@:1.6.2 " + _flag)
+ # can be removed once <1.8.0 versions have been removed
def flag_handler(self, name, flags):
if name == "fflags":
if self.spec.satisfies("%cce+fortran"):
@@ -122,8 +153,10 @@ class SingularityEos(CMakePackage, CudaPackage):
self.define_from_variant("SINGULARITY_USE_KOKKOS", "kokkos"),
self.define_from_variant("SINGULARITY_USE_KOKKOSKERNELS", "kokkos-kernels"),
self.define_from_variant("SINGULARITY_USE_FORTRAN", "fortran"),
- self.define_from_variant("SINGULARITY_BUILD_CLOSURE", "fortran"),
+ self.define_from_variant("SINGULARITY_BUILD_CLOSURE", "closure"),
self.define_from_variant("SINGULARITY_BUILD_PYTHON", "python"),
+ self.define_from_variant("SINGULARITY_USE_SPINER", "spiner"),
+ self.define_from_variant("SINGULARITY_USE_SPINER_WITH_HDF5", "hdf5"),
self.define("SINGULARITY_BUILD_TESTS", self.run_tests),
self.define(
"SINGULARITY_BUILD_SESAME2SPINER",
@@ -142,8 +175,8 @@ class SingularityEos(CMakePackage, CudaPackage):
("stellarcollapse" in self.spec.variants["build_extra"].value and self.run_tests),
),
self.define("SINGULARITY_TEST_PYTHON", ("+python" in self.spec and self.run_tests)),
- self.define("SINGULARITY_USE_HDF5", "^hdf5" in self.spec),
- self.define("SINGULARITY_USE_EOSPAC", "^eospac" in self.spec),
+ self.define_from_variant("SINGULARITY_USE_HDF5", "hdf5"),
+ self.define_from_variant("SINGULARITY_USE_EOSPAC", "eospac"),
]
if "+kokkos+cuda" in self.spec:
@@ -151,34 +184,7 @@ class SingularityEos(CMakePackage, CudaPackage):
return args
- # specify the name of the auto-generated cmake cache config
- @property
- def cmake_config_fname(self):
- return "singularity-eos_spackconfig.cmake"
-
- # generate the pre-configured cmake cache file that reflects the spec options
- # NOTE: this file isn't replaced if the same spec is already installed -
- # you may need to uninstall the old spec first
- @run_after("cmake")
- def generate_cmake_configuration(self):
- config_fname = self.cmake_config_fname
- cmake_config = self.cmake_args()
-
- with working_dir("cmake-gen", create=True):
- with open(config_fname, "w") as cmc:
- for arg in cmake_config:
- kt, v = arg.replace("-D", "").split("=")
- k, t = kt.split(":")
- cmc.write('set({} "{}" CACHE {} "" FORCE)\n'.format(k, v, t))
- install(config_fname, join_path(prefix, config_fname))
-
- # run when loaded
- # NOTE: to use:
- # cmake -C $SINGULARITY_SPACK_CMAKE_CONFIG ...
def setup_run_environment(self, env):
- env.set(
- "SINGULARITY_SPACK_CMAKE_CONFIG", os.path.join(self.prefix, self.cmake_config_fname)
- )
if os.path.isdir(self.prefix.lib64):
lib_dir = self.prefix.lib64
else: