2023-01-18 23:30:17 +01:00
|
|
|
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
2018-10-07 13:52:23 -07:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2016-08-29 16:58:19 +02:00
|
|
|
#
|
2018-10-07 13:52:23 -07:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
|
2022-05-28 09:55:44 -07:00
|
|
|
from spack.package import *
|
2016-06-26 22:00:10 +02:00
|
|
|
|
|
|
|
|
|
2017-03-04 08:53:50 -05:00
|
|
|
class Adios(AutotoolsPackage):
|
2016-08-24 10:32:29 -05:00
|
|
|
"""The Adaptable IO System (ADIOS) provides a simple,
|
2016-06-26 22:00:10 +02:00
|
|
|
flexible way for scientists to describe the
|
|
|
|
|
data in their code that may need to be written,
|
2016-08-30 16:28:55 -05:00
|
|
|
read, or processed outside of the running simulation.
|
|
|
|
|
"""
|
2016-06-26 22:00:10 +02:00
|
|
|
|
2021-09-02 00:46:27 -06:00
|
|
|
homepage = "https://www.olcf.ornl.gov/center-projects/adios/"
|
2018-07-23 00:00:15 -07:00
|
|
|
url = "https://github.com/ornladios/ADIOS/archive/v1.12.0.tar.gz"
|
|
|
|
|
git = "https://github.com/ornladios/ADIOS.git"
|
|
|
|
|
|
2023-02-02 06:07:25 +01:00
|
|
|
maintainers("ax3l")
|
2016-08-29 16:58:19 +02:00
|
|
|
|
2018-07-23 00:00:15 -07:00
|
|
|
version("develop", branch="master")
|
2019-10-10 22:44:41 -07:00
|
|
|
version("1.13.1", sha256="b1c6949918f5e69f701cabfe5987c0b286793f1057d4690f04747852544e157b")
|
|
|
|
|
version("1.13.0", sha256="7b5ee8ff7a5f7215f157c484b20adb277ec0250f87510513edcc25d2c4739f50")
|
|
|
|
|
version("1.12.0", sha256="22bc22c157322abec2d1a0817a259efd9057f88c2113e67d918a9a5ebcb3d88d")
|
|
|
|
|
version("1.11.1", sha256="9f5c10b9471a721ba57d1cf6e5a55a7ad139a6c12da87b4dc128539e9eef370e")
|
|
|
|
|
version("1.11.0", sha256="e89d14ccbe7181777225e0ba6c272c0941539b8ccd440e72ed5a9457441dae83")
|
|
|
|
|
version("1.10.0", sha256="6713069259ee7bfd4d03f47640bf841874e9114bab24e7b0c58e310c42a0ec48")
|
|
|
|
|
version("1.9.0", sha256="23b2bb70540d51ab0855af0b205ca484fd1bd963c39580c29e3133f9e6fffd46")
|
2016-08-29 16:58:19 +02:00
|
|
|
|
|
|
|
|
variant("shared", default=True, description="Builds a shared version of the library")
|
2015-11-05 13:42:50 -08:00
|
|
|
|
2016-08-29 16:58:19 +02:00
|
|
|
variant("fortran", default=False, description="Enable Fortran bindings support")
|
|
|
|
|
|
2017-09-14 19:08:03 +02:00
|
|
|
variant("mpi", default=True, description="Enable MPI support")
|
|
|
|
|
variant("infiniband", default=False, description="Enable infiniband support")
|
2016-08-29 16:58:19 +02:00
|
|
|
|
2016-09-21 09:55:54 +02:00
|
|
|
# transforms
|
2017-09-14 19:08:03 +02:00
|
|
|
variant("zlib", default=True, description="Enable zlib transform support")
|
|
|
|
|
variant("bzip2", default=False, description="Enable bzip2 transform support")
|
|
|
|
|
variant("szip", default=False, description="Enable szip transform support")
|
|
|
|
|
variant("zfp", default=True, description="Enable ZFP transform support")
|
|
|
|
|
variant("sz", default=True, description="Enable SZ transform support")
|
2017-12-05 15:28:44 +01:00
|
|
|
variant("lz4", default=True, description="Enable LZ4 transform support")
|
|
|
|
|
variant("blosc", default=True, description="Enable Blosc transform support")
|
2016-09-21 09:55:54 +02:00
|
|
|
# transports and serial file converters
|
2017-09-14 19:08:03 +02:00
|
|
|
variant(
|
|
|
|
|
"hdf5",
|
|
|
|
|
default=False,
|
|
|
|
|
description="Enable parallel HDF5 transport and serial bp2h5 " + "converter",
|
|
|
|
|
)
|
2017-08-07 15:36:16 -04:00
|
|
|
variant("netcdf", default=False, description="Enable netcdf support")
|
2017-09-12 01:20:49 +02:00
|
|
|
|
|
|
|
|
variant(
|
Multi-valued variants: better support for combinations (#9481)
This enforces conventions that allow for correct handling of
multi-valued variants where specifying no value is an option,
and adds convenience functionality for specifying multi-valued
variants with conflicting sets of values. This also adds a notion
of "feature values" for variants, which are those that are understood
by the build system (e.g. those that would appear as configure
options). In more detail:
* Add documentation on variants to the packaging guide
* Forbid usage of '' or None as a possible variant value, in
particular as a default. To indicate choosing no value, the user
must explicitly define an option like 'none'. Without this,
multi-valued variants with default set to None were not parsable
from the command line (Fixes #6314)
* Add "disjoint_sets" function to support the declaration of
multi-valued variants with conflicting sets of options. For example
a variant "foo" with possible values "a", "b", and "c" where "c"
is exclusive of the other values ("foo=a,b" and "foo=c" are
valid but "foo=a,c" is not).
* Add "any_combination_of" function to support the declaration of
multi-valued variants where it is valid to choose none of the
values. This automatically defines "none" as an option (exclusive
with all other choices); this value does not appear when iterating
over the variant's values, for example in "with_or_without" (which
constructs autotools option strings from variant values).
* The "disjoint_sets" and "any_combination_of" methods return an
object which tracks the possible values. It is also possible to
indicate that some of these values do not correspond to options
understood by the package's build system, such that methods like
"with_or_without" will not define options for those values (this
occurs automatically for "none")
* Add documentation for usage of new functions for specifying
multi-valued variants
2019-01-05 04:02:34 +01:00
|
|
|
"staging",
|
|
|
|
|
values=any_combination_of("flexpath", "dataspaces"),
|
2017-09-12 01:20:49 +02:00
|
|
|
description="Enable dataspaces and/or flexpath staging transports",
|
|
|
|
|
)
|
2016-08-29 16:58:19 +02:00
|
|
|
|
2016-08-29 23:01:20 +02:00
|
|
|
depends_on("autoconf", type="build")
|
|
|
|
|
depends_on("automake", type="build")
|
2017-09-11 01:18:55 +02:00
|
|
|
depends_on("m4", type="build")
|
2020-08-19 02:49:54 -04:00
|
|
|
depends_on("libtool", type="build")
|
2016-08-29 23:01:20 +02:00
|
|
|
depends_on("python", type="build")
|
2016-08-29 18:42:07 +02:00
|
|
|
|
2016-08-29 16:58:19 +02:00
|
|
|
depends_on("mpi", when="+mpi")
|
|
|
|
|
# optional transformations
|
2023-08-09 15:22:58 +02:00
|
|
|
depends_on("zlib-api", when="+zlib")
|
2017-04-18 14:00:39 +02:00
|
|
|
depends_on("bzip2", when="+bzip2")
|
2016-08-29 16:58:19 +02:00
|
|
|
depends_on("szip", when="+szip")
|
2017-12-05 12:50:22 +01:00
|
|
|
depends_on("sz@:1.4.10", when="@:1.12.0 +sz")
|
2021-10-03 15:09:02 +02:00
|
|
|
depends_on("sz@1.4.11.0:1.4.11", when="@1.13.0 +sz")
|
|
|
|
|
depends_on("sz@1.4.12.3:1.4.12", when="@1.13.1: +sz")
|
|
|
|
|
depends_on("zfp@0.5.1:0.5", when="+zfp")
|
2017-12-05 15:28:44 +01:00
|
|
|
depends_on("lz4", when="+lz4")
|
|
|
|
|
depends_on("c-blosc@1.12.0:", when="+blosc")
|
2016-09-21 09:55:54 +02:00
|
|
|
# optional transports & file converters
|
2017-11-02 20:41:25 +01:00
|
|
|
depends_on("hdf5@1.8:+hl+mpi", when="+hdf5")
|
2019-10-28 20:27:54 -05:00
|
|
|
depends_on("netcdf-c", when="+netcdf")
|
2017-09-19 14:13:26 +02:00
|
|
|
depends_on("libevpath", when="staging=flexpath")
|
|
|
|
|
depends_on("dataspaces+mpi", when="staging=dataspaces")
|
2017-08-07 15:36:16 -04:00
|
|
|
|
2017-09-19 14:13:26 +02:00
|
|
|
for p in ["+hdf5", "+netcdf", "staging=flexpath", "staging=dataspaces"]:
|
2017-08-07 15:36:16 -04:00
|
|
|
conflicts(p, when="~mpi")
|
2016-09-21 09:55:54 +02:00
|
|
|
|
2017-03-04 08:53:50 -05:00
|
|
|
build_directory = "spack-build"
|
|
|
|
|
|
2017-03-02 19:44:43 +01:00
|
|
|
# ADIOS uses the absolute Python path, which is too long and results in
|
2017-04-18 14:00:39 +02:00
|
|
|
# "bad interpreter" errors - but not applicable for 1.9.0
|
|
|
|
|
patch("python.patch", when="@1.10.0:")
|
2016-09-21 09:55:54 +02:00
|
|
|
# Fix ADIOS <=1.10.0 compile error on HDF5 1.10+
|
|
|
|
|
# https://github.com/ornladios/ADIOS/commit/3b21a8a41509
|
2017-11-04 17:08:04 -07:00
|
|
|
# https://github.com/spack/spack/issues/1683
|
2016-09-21 09:55:54 +02:00
|
|
|
patch("adios_1100.patch", when="@:1.10.0^hdf5@1.10:")
|
2016-08-29 16:58:19 +02:00
|
|
|
|
2019-10-01 23:28:36 -07:00
|
|
|
# ADIOS 1.13.1 is written for ZFP 0.5.0 interfaces
|
|
|
|
|
# https://github.com/ornladios/ADIOS/pull/204
|
|
|
|
|
patch("zfp051.patch", when="@1.11.0:1.13.1")
|
|
|
|
|
|
2020-08-13 19:20:05 -04:00
|
|
|
# Fix a bug in configure.ac that causes automake issues on RHEL 7.7
|
2022-03-23 02:50:00 -05:00
|
|
|
patch(
|
|
|
|
|
"https://github.com/ornladios/ADIOS/pull/207.patch?full_index=1",
|
|
|
|
|
when="@1.12.0: +mpi",
|
|
|
|
|
sha256="aea47e56013b57c2d5d36e23e0ae6010541c3333a84003784437768c2e350b05",
|
|
|
|
|
)
|
2020-08-13 19:20:05 -04:00
|
|
|
|
2016-08-29 16:58:19 +02:00
|
|
|
def validate(self, spec):
|
2017-09-12 01:20:49 +02:00
|
|
|
"""Checks if incompatible variants have been activated at the same time
|
|
|
|
|
|
|
|
|
|
Args:
|
|
|
|
|
spec: spec of the package
|
|
|
|
|
|
|
|
|
|
Raises:
|
|
|
|
|
RuntimeError: in case of inconsistencies
|
2016-08-29 16:58:19 +02:00
|
|
|
"""
|
|
|
|
|
if "+fortran" in spec and not self.compiler.fc:
|
|
|
|
|
msg = "cannot build a fortran variant without a fortran compiler"
|
|
|
|
|
raise RuntimeError(msg)
|
2016-01-08 11:48:59 -08:00
|
|
|
|
2017-09-12 01:20:49 +02:00
|
|
|
def with_or_without_hdf5(self, activated):
|
|
|
|
|
if activated:
|
2023-10-11 10:47:42 -07:00
|
|
|
return f"--with-phdf5={self.spec['hdf5'].prefix}"
|
2017-09-12 01:20:49 +02:00
|
|
|
|
|
|
|
|
return "--without-phdf5"
|
|
|
|
|
|
2020-05-11 23:54:08 +02:00
|
|
|
def setup_build_environment(self, env):
|
|
|
|
|
# https://github.com/ornladios/ADIOS/issues/206
|
|
|
|
|
if self.spec.satisfies("%gcc@10: +fortran"):
|
|
|
|
|
env.set("FCFLAGS", "-fallow-argument-mismatch")
|
|
|
|
|
|
2017-03-04 08:53:50 -05:00
|
|
|
def configure_args(self):
|
|
|
|
|
spec = self.spec
|
2016-08-29 16:58:19 +02:00
|
|
|
self.validate(spec)
|
2017-03-04 08:53:50 -05:00
|
|
|
|
2017-08-04 18:21:43 +02:00
|
|
|
extra_args = [
|
|
|
|
|
# required, otherwise building its python bindings will fail
|
2023-10-11 10:47:42 -07:00
|
|
|
f"CFLAGS={self.compiler.cc_pic_flag}"
|
2017-08-04 18:21:43 +02:00
|
|
|
]
|
2016-08-29 16:58:19 +02:00
|
|
|
|
2017-09-12 01:20:49 +02:00
|
|
|
extra_args += self.enable_or_disable("shared")
|
|
|
|
|
extra_args += self.enable_or_disable("fortran")
|
2016-08-29 16:58:19 +02:00
|
|
|
|
|
|
|
|
if "+mpi" in spec:
|
2017-09-11 01:18:55 +02:00
|
|
|
env["MPICC"] = spec["mpi"].mpicc
|
|
|
|
|
env["MPICXX"] = spec["mpi"].mpicxx
|
2017-09-12 01:20:49 +02:00
|
|
|
|
2017-09-14 19:08:03 +02:00
|
|
|
extra_args += self.with_or_without("mpi", activation_value="prefix")
|
2017-09-12 01:20:49 +02:00
|
|
|
extra_args += self.with_or_without("infiniband")
|
2016-08-29 16:58:19 +02:00
|
|
|
|
2023-08-09 15:22:58 +02:00
|
|
|
if "+zlib" in spec:
|
2023-10-11 10:47:42 -07:00
|
|
|
extra_args.append(f"--with-zlib={spec['zlib-api'].prefix}")
|
2023-08-09 15:22:58 +02:00
|
|
|
else:
|
|
|
|
|
extra_args.append("--without-zlib")
|
|
|
|
|
|
2017-08-07 15:36:16 -04:00
|
|
|
# Transforms
|
2023-08-09 15:22:58 +02:00
|
|
|
variants = ["bzip2", "szip"]
|
2017-12-05 15:28:44 +01:00
|
|
|
if spec.satisfies("@1.11.0:"):
|
|
|
|
|
variants += ["zfp"]
|
|
|
|
|
if spec.satisfies("@1.12.0:"):
|
|
|
|
|
variants += ["sz", "lz4"]
|
|
|
|
|
if spec.satisfies("@1.13.0:"):
|
|
|
|
|
extra_args += self.with_or_without(
|
|
|
|
|
"blosc", activation_value=lambda x: spec["c-blosc"].prefix
|
|
|
|
|
)
|
2017-08-07 15:36:16 -04:00
|
|
|
|
|
|
|
|
# External I/O libraries
|
2017-09-12 01:20:49 +02:00
|
|
|
variants += ["hdf5", "netcdf"]
|
|
|
|
|
|
|
|
|
|
for x in variants:
|
2017-09-14 19:08:03 +02:00
|
|
|
extra_args += self.with_or_without(x, activation_value="prefix")
|
2017-08-07 15:36:16 -04:00
|
|
|
|
|
|
|
|
# Staging transports
|
2017-09-12 01:20:49 +02:00
|
|
|
def with_staging(name):
|
|
|
|
|
if name == "flexpath":
|
|
|
|
|
return spec["libevpath"].prefix
|
|
|
|
|
return spec[name].prefix
|
|
|
|
|
|
2017-09-14 19:08:03 +02:00
|
|
|
extra_args += self.with_or_without("staging", activation_value=with_staging)
|
2015-12-01 11:59:19 -08:00
|
|
|
|
2017-03-04 08:53:50 -05:00
|
|
|
return extra_args
|