Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6cd2074
Current progress (see full commit message for details)
zachcran Oct 7, 2025
df0cc88
Add depends_on() 'when' kwarg to pluginplay
zachcran Oct 7, 2025
6700810
Merge branch 'master' into python_packages
zachcran Oct 7, 2025
40f4bff
Add dependency on numpy for the build tests to pass
zachcran Oct 13, 2025
7111cea
prefix.lib64 does not properly get loaded in the PYTHONPATH
zachcran Oct 13, 2025
b233a11
python conditional depends_on statements; decouple python version
jwaldrop107 Oct 21, 2025
b443bcf
Require pybind >= 3.0
zachcran Oct 23, 2025
6c0aa1f
various updates to packages
jwaldrop107 Oct 23, 2025
730cd19
add dependencies for FriendZone
jwaldrop107 Oct 23, 2025
8131721
remove reference to unused variant in NUX
jwaldrop107 Oct 23, 2025
b39493a
molssi dependencies
jwaldrop107 Oct 28, 2025
4d1305f
molssi patches
jwaldrop107 Oct 28, 2025
0f14c5c
FriendZone deps patch
jwaldrop107 Oct 28, 2025
055e8e3
FriendZone and NWX updates
jwaldrop107 Oct 29, 2025
221f997
Add base class for NWChemEx Python-only packages
zachcran Nov 3, 2025
e8656e2
Progress on switching friendzone and nwchemex packages to PythonPackage
zachcran Nov 3, 2025
25cfac1
remove stale references to experimental features
jwaldrop107 Nov 4, 2025
f68ef5e
FriendZon and NWX updates; some cleaning on various packages
jwaldrop107 Nov 10, 2025
430e541
Python is default
jwaldrop107 Nov 12, 2025
611dfe0
update FriendZone
jwaldrop107 Nov 14, 2025
6af16e3
remove cxx standard from NWChemExBaseCXX
jwaldrop107 Nov 20, 2025
41ab705
dependency updates; checksum update for qcengine
jwaldrop107 Nov 21, 2025
184edc1
ChemCache: Add minimum version constraint to py-requests
zachcran Nov 24, 2025
d7258b7
Remove stale FriendZone version
jwaldrop107 Nov 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions spack_repo/nwchemex/common/mixins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
from .cmaize import CMaizePackage
from .nwchemex import NWChemExBaseCXX, NWChemExBasePybindings
from .nwchemex import (
NWChemExBaseCXX,
NWChemExBasePybindings,
NWChemExBasePython,
)

__all__ = ["CMaizePackage", "NWChemExBaseCXX", "NWChemExBasePybindings"]
__all__ = [
"CMaizePackage",
"NWChemExBaseCXX",
"NWChemExBasePybindings",
"NWChemExBasePython",
]
64 changes: 32 additions & 32 deletions spack_repo/nwchemex/common/mixins/nwchemex.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from spack import package as pkg
from spack.package_base import PackageBase
from spack_repo.builtin.build_systems.python import PythonPackage

from .cmaize import CMaizePackage

Expand Down Expand Up @@ -29,17 +30,6 @@ class NWChemExBaseCXX(NWChemExBaseGit, CMaizePackage):
sticky=True,
)

pkg.variant(
"cxxstd",
default="17",
# NOTE: Comma after "17" is necessary so Spack doesn't split it into
# individual characters
values=("17",),
multi=False,
description="Use the specified C++ standard when building",
sticky=True,
)

pkg.depends_on("cxx", type="build")

# Test dependencies
Expand All @@ -55,7 +45,6 @@ def cmake_args(self):
),
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
self.define_from_variant("BUILD_DOCS", "docs"),
self.define_from_variant("CMAKE_CXX_STANDARD", "cxxstd"),
self.define("BUILD_TESTING", self.run_tests),
]
)
Expand Down Expand Up @@ -87,39 +76,50 @@ def cmake_args(self):
class NWChemExBasePybindings(NWChemExBaseCXX):

pkg.variant(
"pybindings",
default=False,
description="Build the Python bindings with Pybind11",
sticky=True,
"python",
default=True,
description="Build the Python bindings",
# sticky=True,
)

pkg.depends_on("py-pybind11", when="+pybindings")
# https://spack.readthedocs.io/en/latest/build_systems/pythonpackage.html#extends-vs-depends-on
pkg.extends("python", when="+python")
pkg.depends_on(
"py-pybind11@3:",
type=("build", "link", "run", "test"),
when="+python",
)
pkg.depends_on(
"python@3:",
type=("build", "link", "run", "test"),
when="+python",
)

def cmake_args(self):
args = super().cmake_args()

args.extend(
[
self.define_from_variant(
"BUILD_PYBIND11_PYBINDINGS", "pybindings"
"BUILD_PYBIND11_PYBINDINGS", "python"
),
self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"),
self.define_from_variant("PYBIND11_FINDPYTHON", "python"),
]
)

if self.spec.satisfies("+pybindings"):
if "NWX_MODULE_DIRECTORY" in os.environ:
args.append(
self.define(
"NWX_MODULE_DIRECTORY",
os.environ["NWX_MODULE_DIRECTORY"],
)
if self.spec.satisfies("+python"):
args.append(
self.define(
"NWX_MODULE_DIRECTORY",
# lib64 is used for platlib from Python package
self.prefix.lib.join(
"python{}".format(self.spec["python"].version[:-1])
).join("site-packages"),
)
# TODO: Allow the user to configure this?
# args.append(
# "-DNWX_MODULE_DIRECTORY={}".format(
# self.prefix.lib.join(self.project.lower()).join("python")
# )
# )
)

return args


class NWChemExBasePython(NWChemExBaseGit, PythonPackage):
pass
42 changes: 12 additions & 30 deletions spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,27 @@ class NwchemexChemcache(NWChemExBasePybindings):
pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran")
pkg.license("Apache-2.0", checked_by="zachcran")

pkg.version("generated_data", branch="generated_data")
pkg.version("generated_data", branch="generated_data", preferred=True)

# Versions from git tags
pkg.version(
"1.1.2",
sha256="5efb2a60d75aaa57e08e8b2a0b84a24e502083fa5bacae416406ec59bd2839b8",
)

# TODO: Are we sure this shouldn't be here to propagate down to SimDE?
# pkg.variant(
# "sigma",
# default=False,
# description="Enable Sigma for uncertainty tracking",
# sticky=True,
# )
pkg.variant(
"experimental",
default=False,
description="Enable experimental features",
sticky=False,
)

# Runtime dependencies
pkg.depends_on("[email protected]:")

# First-party
pkg.depends_on("nwchemex-simde")
pkg.depends_on(
"nwchemex-simde+python",
type=("build", "link", "run"),
when="+python",
)
pkg.depends_on(
"nwchemex-simde~python",
type=("build", "link", "run"),
when="~python",
)

# Start with CMaize sanity check locations
sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs(
Expand All @@ -83,16 +78,3 @@ class NwchemexChemcache(NWChemExBasePybindings):
project.lower()
)
# Append more sanity checks as needed

def cmake_args(self):
args = super().cmake_args()

args.extend(
[
self.define_from_variant(
"ENABLE_EXPERIMENTAL_FEATURES", "experimental"
),
]
)

return args
23 changes: 21 additions & 2 deletions spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,27 @@ class NwchemexChemist(NWChemExBasePybindings):

# First-party
pkg.depends_on("nwchemex-utilities")
pkg.depends_on("nwchemex-parallelzone")
pkg.depends_on("nwchemex-tensorwrapper")
pkg.depends_on(
"nwchemex-parallelzone+python",
type=("build", "link", "run"),
when="+python",
)
pkg.depends_on(
"nwchemex-parallelzone~python",
type=("build", "link", "run"),
when="~python",
)

pkg.depends_on(
"nwchemex-tensorwrapper+python",
type=("build", "link", "run"),
when="+python",
)
pkg.depends_on(
"nwchemex-tensorwrapper~python",
type=("build", "link", "run"),
when="~python",
)

# Although we have a variant, technically it is not a direct dependency
# of this package
Expand Down
109 changes: 109 additions & 0 deletions spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# 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)

# ----------------------------------------------------------------------------
# If you submit this package back to Spack as a pull request,
# please first remove this boilerplate and all FIXME comments.
#
# This is a template package file for Spack. We've put "FIXME"
# next to all the things you'll want to change. Once you've handled
# them, you can save this file and test your package like this:
#
# spack install nwchemex-simde
#
# You can edit this file again by typing:
#
# spack edit nwchemex-simde
#
# See the Spack documentation for more information on packaging.
# ----------------------------------------------------------------------------

from spack import package as pkg

from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings


class NwchemexFriendzone(NWChemExBasePybindings):
"""Generic, helpful C++ classes used by the NWChemEx project."""

project = "FriendZone"

homepage = f"https://github.com/NWChemEx/{project}"
url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v1.0.9.tar.gz"
git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit

# Versions are hosted under GitHub tags right now
list_url = f"https://github.com/NWChemEx/{project}/tags"
# To get older versions, uncomment 'list_depth' below and set it to a
# value >0 to get list_depth + 1 pages of versions.
# WARNING: This increases the number of links that the search spider will
# follow, meaning even 'list_depth = 1' may increase the search time
# significantly!
# list_depth = 1

pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran")
pkg.license("Apache-2.0", checked_by="zachcran")

# Versions from git tags
pkg.version(
"1.0.9",
sha256="fbf3b4a8f392e88e675696976d4d4927af1f158a2602f761796d415c1fbaeab1",
)

# TODO: Should this still be here for SimDE propagation?
# pkg.variant(
# "sigma",
# default=False,
# description="Enable Sigma for uncertainty tracking",
# sticky=True,
# )

pkg.depends_on("py-pip", when="+python", type=("build", "link"))
pkg.depends_on(
"py-pydantic", when="+python", type=("build", "link", "run")
)
pkg.depends_on(
"py-networkx~default", when="+python", type=("build", "link", "run")
)
pkg.depends_on(
"py-qcelemental", when="+python", type=("build", "link", "run")
)
pkg.depends_on(
"py-qcengine", when="+python", type=("build", "link", "run")
)
# pkg.depends_on("py-ase", when="+python", type=("build", "link", "run"))
pkg.depends_on("nwchem", when="+python", type=("build", "link", "run"))

# First-party
pkg.depends_on(
"nwchemex-simde+python",
type=("build", "link", "run"),
when="+python",
)
pkg.depends_on(
"nwchemex-simde~python",
type=("build", "link", "run"),
when="~python",
)

# Start with CMaize sanity check locations
# sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs(
# project.lower()
# )
# sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files(
# project.lower()
# )
# Append more sanity checks as needed

def cmake_args(self):
args = super().cmake_args()

args.extend(
[
self.define("ENABLE_ASE", "OFF"),
]
)

return args
Loading