Skip to content

Commit

Permalink
Move NEPTUNE Python dependencies into its their own package neptune-p…
Browse files Browse the repository at this point in the history
…ython-env, remove legacy environment variables for NEPTUNE (#1343)

This PR moves the full NEPTUNE Python dependencies into their own package neptune-python-dev. Only the basic dependencies on f90nml and python-dateutil remain in neptune-env (needed by NUOPC).

The espc variant is turned off by default in neptune-env, but the neptune-dev template enables it. Likewise, the xnrl variant is turned off by default in neptune-python-env, but the neptune-dev template enables it.

Several legacy environment variables for hdf5, libyaml, p4est are removed from configs/common/modules_*.yaml.
  • Loading branch information
climbfuji authored Oct 16, 2024
1 parent 7db4517 commit 2b363ea
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 61 deletions.
16 changes: 0 additions & 16 deletions configs/common/modules_lmod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,10 @@ modules:
environment:
set:
'ESMFMKFILE': '{prefix}/lib/esmf.mk'
hdf5:
environment:
set:
'HDF5_DIR': '{prefix}'
libpng:
environment:
set:
'PNG_ROOT': '{prefix}'
libyaml:
environment:
set:
'YAML_DIR': '{prefix}'
'YAML_LIB': '{prefix}/lib'
'YAML_INC': '{prefix}/include'
madis:
environment:
set:
Expand All @@ -151,12 +141,6 @@ modules:
set:
'OMPI_MCA_rmaps_base_oversubscribe': '1'
'PRTE_MCA_rmaps_default_mapping_policy': ':oversubscribe'
p4est:
environment:
set:
'P4EST_API_DIR': '{prefix}'
'P4EST_API_LIB': '{prefix}/lib'
'P4EST_API_INC': '{prefix}/include'
bacio:
environment:
set:
Expand Down
16 changes: 0 additions & 16 deletions configs/common/modules_tcl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,10 @@ modules:
environment:
set:
'ESMFMKFILE': '{prefix}/lib/esmf.mk'
hdf5:
environment:
set:
'HDF5_DIR': '{prefix}'
libpng:
environment:
set:
'PNG_ROOT': '{prefix}'
libyaml:
environment:
set:
'YAML_DIR': '{prefix}'
'YAML_LIB': '{prefix}/lib'
'YAML_INC': '{prefix}/include'
madis:
environment:
set:
Expand All @@ -153,12 +143,6 @@ modules:
set:
'OMPI_MCA_rmaps_base_oversubscribe': '1'
'PRTE_MCA_rmaps_default_mapping_policy': ':oversubscribe'
p4est:
environment:
set:
'P4EST_API_DIR': '{prefix}'
'P4EST_API_LIB': '{prefix}/lib'
'P4EST_API_INC': '{prefix}/include'
bacio:
environment:
set:
Expand Down
3 changes: 2 additions & 1 deletion configs/templates/neptune-dev/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ spack:
definitions:
- compilers: ['%aocc', '%apple-clang', '%gcc', '%intel', '%oneapi']
- packages:
- neptune-env +espc +python +xnrl ^[email protected] snapshot=b11
- neptune-env +espc ^[email protected] snapshot=b11
- neptune-python-env +xnrl ^[email protected] snapshot=b11

specs:
- matrix:
Expand Down
3 changes: 2 additions & 1 deletion configs/templates/skylab-dev/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ spack:
- jedi-neptune-env ^esmf@=8.7.0b11 snapshot=b11
- jedi-ufs-env ^esmf@=8.6.1
- jedi-um-env
- neptune-env ~espc +python ~xnrl ^esmf@=8.7.0b11 snapshot=b11
- neptune-env ^esmf@=8.7.0b11 snapshot=b11
- neptune-python-env ^esmf@=8.7.0b11 snapshot=b11
- soca-env

# Various crtm tags (list all to avoid duplicate packages)
Expand Down
3 changes: 2 additions & 1 deletion configs/templates/unified-dev/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ spack:
- jedi-tools-env
- jedi-ufs-env ^esmf@=8.6.1
- jedi-um-env
- neptune-env ~espc +python ~xnrl ^esmf@=8.7.0b11 snapshot=b11
- neptune-env ^esmf@=8.7.0b11 snapshot=b11
- neptune-python-env ^esmf@=8.7.0b11 snapshot=b11
- soca-env
- ufs-srw-app-env ^esmf@=8.6.1
- ufs-weather-model-env ^esmf@=8.6.1
Expand Down
33 changes: 7 additions & 26 deletions spack-ext/repos/spack-stack/packages/neptune-env/package.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
Expand All @@ -9,19 +9,17 @@


class NeptuneEnv(BundlePackage):
"""Development environment for neptune standalone"""
"""Development environment for NEPTUNE standalone"""

# Fake URL
homepage = "https://github.com/notavalidaccount/neptune"
git = "https://github.com/notavalidaccount/neptune.git"

maintainers("climbfuji", "areinecke")

version("1.4.0")
version("1.5.0")

variant("python", default=True, description="Build Python dependencies")
variant("espc", default=True, description="Build ESPC dependencies")
variant("xnrl", default=True, description="Build XNRL and its extra Python dependencies")
variant("espc", default=False, description="Build ESPC dependencies")

depends_on("base-env", type="run")

Expand All @@ -33,7 +31,6 @@ class NeptuneEnv(BundlePackage):
depends_on("libyaml", type="run")
depends_on("p4est", type="run")
depends_on("w3emc", type="run")
depends_on("w3nco", type="run")
depends_on("sp", type="run", when="%aocc")
depends_on("ip@5:", type="run", when="%apple-clang")
depends_on("ip@5:", type="run", when="%gcc")
Expand All @@ -43,28 +40,12 @@ class NeptuneEnv(BundlePackage):
depends_on("nco", type="run")
depends_on("mct", type="run")

conflicts("+xnrl", when="~python", msg="Variant xnrl requires variant python")

with when("+espc"):
depends_on("fftw", type="build")
depends_on("netlib-lapack", type="build")

with when("+python"):
depends_on("py-f90nml", type="run")
depends_on("py-h5py", type="run")
depends_on("py-netcdf4", type="run")
depends_on("py-pandas", type="run")
depends_on("py-pycodestyle", type="run")
depends_on("py-pybind11", type="run")
depends_on("py-pyhdf", type="run")
depends_on("py-python-dateutil", type="run")
depends_on("py-pyyaml", type="run")
depends_on("py-scipy", type="run")
depends_on("py-xarray", type="run")
depends_on("py-pytest", type="run")
depends_on("py-fortranformat", type="run")

with when("+xnrl"):
depends_on("py-xnrl", type="run")
# Basic Python dependencies that are always needed
depends_on("py-f90nml", type="run")
depends_on("py-python-dateutil", type="run")

# There is no need for install() since there is no code.
41 changes: 41 additions & 0 deletions spack-ext/repos/spack-stack/packages/neptune-python-env/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

import sys

from spack.package import *


class NeptunePythonEnv(BundlePackage):
"""Development environment for NEPTUNE standalone with all Python dependencies"""

# Fake URL
homepage = "https://github.com/notavalidaccount/neptune"
git = "https://github.com/notavalidaccount/neptune.git"

maintainers("climbfuji", "areinecke")

version("1.5.0")

variant("xnrl", default=False, description="Build non-pulic XNRL")

depends_on("neptune-env", type="run")

depends_on("py-h5py", type="run")
depends_on("py-netcdf4", type="run")
depends_on("py-pandas", type="run")
depends_on("py-pycodestyle", type="run")
depends_on("py-pybind11", type="run")
depends_on("py-pyhdf", type="run")
depends_on("py-pyyaml", type="run")
depends_on("py-scipy", type="run")
depends_on("py-xarray", type="run")
depends_on("py-pytest", type="run")
depends_on("py-fortranformat", type="run")

with when("+xnrl"):
depends_on("py-xnrl", type="run")

# There is no need for install() since there is no code.

0 comments on commit 2b363ea

Please sign in to comment.