Update ESMF from JCSDA/NOAA-EMC spack fork (esmf@8.3.0 with external parallelio) (#32222)
* Update ESMF package from JCSDA/NOAA-EMC spack fork * Update var/spack/repos/builtin/packages/esmf/package.py Fix url_for_version Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> * [@spackbot] updating style on behalf of climbfuji Co-authored-by: Jim Edwards <jedwards@ucar.edu> Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Co-authored-by: climbfuji <climbfuji@users.noreply.github.com>
This commit is contained in:
parent
bea8936e02
commit
560b6432cc
@ -17,21 +17,59 @@ class Esmf(MakefilePackage):
|
||||
|
||||
homepage = "https://www.earthsystemcog.org/projects/esmf/"
|
||||
url = "https://github.com/esmf-org/esmf/archive/ESMF_8_0_1.tar.gz"
|
||||
git = "https://github.com/esmf-org/esmf.git"
|
||||
|
||||
maintainers = ["climbfuji"]
|
||||
|
||||
version("8.2.0", sha256="3693987aba2c8ae8af67a0e222bea4099a48afe09b8d3d334106f9d7fc311485")
|
||||
version("8.1.1", sha256="58c2e739356f21a1b32673aa17a713d3c4af9d45d572f4ba9168c357d586dc75")
|
||||
version("8.0.1", sha256="9172fb73f3fe95c8188d889ee72fdadb4f978b1d969e1d8e401e8d106def1d84")
|
||||
version("8.0.0", sha256="051dca45f9803d7e415c0ea146df15ce487fb55f0fce18ca61d96d4dba0c8774")
|
||||
version("7.1.0r", sha256="ae9a5edb8d40ae97a35cbd4bd00b77061f995c77c43d36334dbb95c18b00a889")
|
||||
# Develop is a special name for spack and is always considered the newest version
|
||||
version("develop", branch="develop")
|
||||
version(
|
||||
"8.3.0",
|
||||
sha256="0ff43ede83d1ac6beabd3d5e2a646f7574174b28a48d1b9f2c318a054ba268fd",
|
||||
)
|
||||
version("8.3.0b09", commit="5b7e546c4b")
|
||||
version(
|
||||
"8.2.0",
|
||||
sha256="3693987aba2c8ae8af67a0e222bea4099a48afe09b8d3d334106f9d7fc311485",
|
||||
)
|
||||
version(
|
||||
"8.1.1",
|
||||
sha256="58c2e739356f21a1b32673aa17a713d3c4af9d45d572f4ba9168c357d586dc75",
|
||||
)
|
||||
version(
|
||||
"8.0.1",
|
||||
sha256="9172fb73f3fe95c8188d889ee72fdadb4f978b1d969e1d8e401e8d106def1d84",
|
||||
)
|
||||
version(
|
||||
"8.0.0",
|
||||
sha256="051dca45f9803d7e415c0ea146df15ce487fb55f0fce18ca61d96d4dba0c8774",
|
||||
)
|
||||
version(
|
||||
"7.1.0r",
|
||||
sha256="ae9a5edb8d40ae97a35cbd4bd00b77061f995c77c43d36334dbb95c18b00a889",
|
||||
)
|
||||
|
||||
variant("mpi", default=True, description="Build with MPI support")
|
||||
variant("external-lapack", default=False, description="Build with external LAPACK support")
|
||||
variant(
|
||||
"external-lapack",
|
||||
default=False,
|
||||
description="Build with external LAPACK support",
|
||||
)
|
||||
variant("netcdf", default=True, description="Build with NetCDF support")
|
||||
variant("pnetcdf", default=True, description="Build with pNetCDF support")
|
||||
variant("xerces", default=True, description="Build with Xerces support")
|
||||
variant("pio", default=True, description="Enable ParallelIO support")
|
||||
variant(
|
||||
"parallelio",
|
||||
default=True,
|
||||
description="Build with external parallelio library",
|
||||
when="@8.3:",
|
||||
)
|
||||
variant(
|
||||
"pio",
|
||||
default=True,
|
||||
description="Enable Internal ParallelIO support",
|
||||
when="@:8.2.99",
|
||||
)
|
||||
variant("debug", default=False, description="Make a debuggable version of the library")
|
||||
|
||||
# Required dependencies
|
||||
@ -45,6 +83,7 @@ class Esmf(MakefilePackage):
|
||||
depends_on("netcdf-fortran@3.6:", when="+netcdf")
|
||||
depends_on("parallel-netcdf@1.2.0:", when="+pnetcdf")
|
||||
depends_on("xerces-c@3.1.0:", when="+xerces")
|
||||
depends_on("parallelio@2.5.8:", when="+parallelio")
|
||||
|
||||
# Testing dependencies
|
||||
depends_on("perl", type="test")
|
||||
@ -79,10 +118,15 @@ def url_for_version(self, version):
|
||||
return "http://www.earthsystemmodeling.org/esmf_releases/public/ESMF_{0}/esmf_{0}_src.tar.gz".format(
|
||||
version.underscored
|
||||
)
|
||||
else:
|
||||
elif version < Version("8.2.1"):
|
||||
return "https://github.com/esmf-org/esmf/archive/ESMF_{0}.tar.gz".format(
|
||||
version.underscored
|
||||
)
|
||||
else:
|
||||
# Starting with ESMF 8.2.1 releases are now in the form vx.y.z
|
||||
return "https://github.com/esmf-org/esmf/archive/refs/tags/v{0}.tar.gz".format(
|
||||
version.dotted
|
||||
)
|
||||
|
||||
def edit(self, spec, prefix):
|
||||
# Installation instructions can be found at:
|
||||
@ -117,10 +161,10 @@ def edit(self, spec, prefix):
|
||||
# ESMF will simply not build with Intel using backing GCC 8, in that
|
||||
# case you need to point to something older, below is commented but is
|
||||
# an example
|
||||
# os.environ['ESMF_CXXCOMPILEOPTS'] = \
|
||||
# '-O2 -std=c++11 -gcc-name=/usr/bin/gcc'
|
||||
# os.environ['ESMF_F90COMPILEOPTS'] = \
|
||||
# '-O2 -gcc-name=/usr/bin/gcc'
|
||||
# os.environ["ESMF_CXXCOMPILEOPTS"] = \
|
||||
# "-O2 -std=c++11 -gcc-name=/usr/bin/gcc"
|
||||
# os.environ["ESMF_F90COMPILEOPTS"] = \
|
||||
# "-O2 -gcc-name=/usr/bin/gcc"
|
||||
|
||||
############
|
||||
# Compiler #
|
||||
@ -150,7 +194,7 @@ def edit(self, spec, prefix):
|
||||
os.environ["ESMF_COMPILER"] = "pgi"
|
||||
else:
|
||||
msg = "The compiler you are building with, "
|
||||
msg += "'{0}', is not supported by ESMF."
|
||||
msg += '"{0}", is not supported by ESMF.'
|
||||
raise InstallError(msg.format(self.compiler.name))
|
||||
|
||||
if "+mpi" in spec:
|
||||
@ -205,6 +249,9 @@ def edit(self, spec, prefix):
|
||||
or "^intel-oneapi-mpi" in spec
|
||||
):
|
||||
os.environ["ESMF_COMM"] = "intelmpi"
|
||||
elif "^mpt" in spec:
|
||||
# MPT is the HPE (SGI) variant of mpich
|
||||
os.environ["ESMF_COMM"] = "mpt"
|
||||
else:
|
||||
# Force use of the single-processor MPI-bypass library.
|
||||
os.environ["ESMF_COMM"] = "mpiuni"
|
||||
@ -221,11 +268,11 @@ def edit(self, spec, prefix):
|
||||
|
||||
# FIXME: determine whether or not we need to set this
|
||||
# Specifies the path where the LAPACK library is located.
|
||||
# os.environ['ESMF_LAPACK_LIBPATH'] = spec['lapack'].prefix.lib
|
||||
# os.environ["ESMF_LAPACK_LIBPATH"] = spec["lapack"].prefix.lib
|
||||
|
||||
# Specifies the linker directive needed to link the LAPACK library
|
||||
# to the application.
|
||||
os.environ["ESMF_LAPACK_LIBS"] = spec["lapack"].libs.link_flags
|
||||
os.environ["ESMF_LAPACK_LIBS"] = spec["lapack"].libs.link_flags # noqa
|
||||
else:
|
||||
os.environ["ESMF_LAPACK"] = "internal"
|
||||
|
||||
@ -236,20 +283,8 @@ def edit(self, spec, prefix):
|
||||
if "+netcdf" in spec:
|
||||
# ESMF provides the ability to read Grid and Mesh data in
|
||||
# NetCDF format.
|
||||
if spec.satisfies("^netcdf-c@4.2:"):
|
||||
# ESMF_NETCDF_LIBS will be set to "-lnetcdff -lnetcdf".
|
||||
# This option is useful for systems which have the Fortran
|
||||
# and C bindings archived in seperate library files.
|
||||
os.environ["ESMF_NETCDF"] = "split"
|
||||
else:
|
||||
# ESMF_NETCDF_LIBS will be set to "-lnetcdf".
|
||||
# This option is useful when the Fortran and C bindings
|
||||
# are archived together in the same library file.
|
||||
os.environ["ESMF_NETCDF"] = "standard"
|
||||
|
||||
# FIXME: determine whether or not we need to set these.
|
||||
# ESMF_NETCDF_INCLUDE
|
||||
# ESMF_NETCDF_LIBPATH
|
||||
os.environ["ESMF_NETCDF"] = "nc-config"
|
||||
os.environ["ESMF_NFCONFIG"] = "nf-config"
|
||||
|
||||
###################
|
||||
# Parallel-NetCDF #
|
||||
@ -261,7 +296,7 @@ def edit(self, spec, prefix):
|
||||
|
||||
# When defined, enables the use of Parallel-NetCDF.
|
||||
# ESMF_PNETCDF_LIBS will be set to "-lpnetcdf".
|
||||
os.environ["ESMF_PNETCDF"] = "standard"
|
||||
os.environ["ESMF_PNETCDF"] = "pnetcdf-config"
|
||||
|
||||
# FIXME: determine whether or not we need to set these.
|
||||
# ESMF_PNETCDF_INCLUDE
|
||||
@ -270,12 +305,14 @@ def edit(self, spec, prefix):
|
||||
##############
|
||||
# ParallelIO #
|
||||
##############
|
||||
|
||||
if "+pio" in spec and "+mpi" in spec:
|
||||
if "+parallelio" in spec and "+mpi" in spec:
|
||||
os.environ["ESMF_PIO"] = "external"
|
||||
os.environ["ESMF_PIO_LIBPATH"] = spec["parallelio"].prefix.lib
|
||||
os.environ["ESMF_PIO_INCLUDE"] = spec["parallelio"].prefix.include
|
||||
elif "+pio" in spec and "+mpi" in spec:
|
||||
# ESMF provides the ability to read and write data in both binary
|
||||
# and NetCDF formats through ParallelIO (PIO), a third-party IO
|
||||
# software library that is integrated in the ESMF library.
|
||||
|
||||
# PIO-dependent features will be enabled and will use the
|
||||
# PIO library that is included and built with ESMF.
|
||||
os.environ["ESMF_PIO"] = "internal"
|
||||
@ -298,6 +335,10 @@ def edit(self, spec, prefix):
|
||||
# ESMF_XERCES_INCLUDE
|
||||
# ESMF_XERCES_LIBPATH
|
||||
|
||||
@run_after("install")
|
||||
def install_findesmf(self):
|
||||
install_tree("cmake", self.prefix.cmake)
|
||||
|
||||
def check(self):
|
||||
make("check", parallel=False)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user