From 6cd20748e844eea36684e7b2394746287881d39c Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 7 Oct 2025 13:17:11 -0600 Subject: [PATCH 01/23] Current progress (see full commit message for details) - NWX_MODULE_DIRECTORY is set correctly for all NWChemExBasePybindings-based packages - ParallelZone and PluginPlay bindings appear to be working - TensorWrapper and above are in-progress - The value of NWX_MODULE_DIRECTORY needs to be generalized to any Python version. It currently only works for Python 3.13. --- spack_repo/nwchemex/common/mixins/nwchemex.py | 41 +++++++++++-------- .../packages/nwchemex_chemcache/package.py | 3 +- .../core/packages/nwchemex_chemist/package.py | 4 +- .../packages/nwchemex_pluginplay/package.py | 2 +- .../core/packages/nwchemex_simde/package.py | 4 +- .../nwchemex_tensorwrapper/package.py | 11 ++++- 6 files changed, 39 insertions(+), 26 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index f9f41ea..dbc71ac 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -74,6 +74,12 @@ def cmake_args(self): args.append(self.define("CMAKE_POLICY_DEFAULT_CMP0152", "NEW")) # DEBUG REMOVE ME + args.append( + self.define( + "FETCHCONTENT_SOURCE_DIR_NWX_CMAKE", + "/home/zachcran/workspaces/nwchemex/repos_dev/nwxcmake", + ) + ) args.append( self.define( "CMAKE_VERBOSE_MAKEFILE", @@ -87,13 +93,17 @@ def cmake_args(self): class NWChemExBasePybindings(NWChemExBaseCXX): pkg.variant( - "pybindings", + "python", default=False, - description="Build the Python bindings with Pybind11", + 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") + # TODO: decouple from python 3.13 + pkg.depends_on("python@3.13", when="+python") + pkg.depends_on("py-pybind11", when="+python") def cmake_args(self): args = super().cmake_args() @@ -101,25 +111,20 @@ def cmake_args(self): 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 + # TODO: Decouple this from Python 3.13 + self.prefix.lib64.join("python3.13").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 diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py index c366f5c..d59a36b 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -21,7 +21,6 @@ # ---------------------------------------------------------------------------- from spack import package as pkg - from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings @@ -48,7 +47,7 @@ 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( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py index e6e3bb5..67d4f50 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py @@ -63,8 +63,8 @@ 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", type=("build", "link", "run")) + pkg.depends_on("nwchemex-tensorwrapper", type=("build", "link", "run")) # Although we have a variant, technically it is not a direct dependency # of this package diff --git a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py index f8c5006..cbd52d4 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py @@ -63,7 +63,7 @@ class NwchemexPluginplay(NWChemExBasePybindings): pkg.depends_on("rocksdb", when="+rocksdb") # First-party pkg.depends_on("nwchemex-utilities") - pkg.depends_on("nwchemex-parallelzone") + pkg.depends_on("nwchemex-parallelzone", type=("build", "link", "run")) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py b/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py index 809253b..ae3303a 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py @@ -59,8 +59,8 @@ class NwchemexSimde(NWChemExBasePybindings): ) # First-party - pkg.depends_on("nwchemex-chemist") - pkg.depends_on("nwchemex-pluginplay") + pkg.depends_on("nwchemex-chemist", type=("build", "link", "run")) + pkg.depends_on("nwchemex-pluginplay", type=("build", "link", "run")) pkg.depends_on("sigma+eigen", when="+sigma") diff --git a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py index 43c8bd4..642c819 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py @@ -64,7 +64,16 @@ class NwchemexTensorwrapper(NWChemExBasePybindings): # First-party pkg.depends_on("nwchemex-utilities") - pkg.depends_on("nwchemex-parallelzone") + 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("sigma+eigen", when="+sigma") From df0cc8820fb92d9ad28ba2794d73d0f41c31c09e Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 7 Oct 2025 13:42:37 -0600 Subject: [PATCH 02/23] Add depends_on() 'when' kwarg to pluginplay --- .../core/packages/nwchemex_pluginplay/package.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py index cbd52d4..2fcd7ff 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py @@ -21,6 +21,7 @@ # ---------------------------------------------------------------------------- from spack import package as pkg + from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings @@ -63,7 +64,16 @@ class NwchemexPluginplay(NWChemExBasePybindings): pkg.depends_on("rocksdb", when="+rocksdb") # First-party pkg.depends_on("nwchemex-utilities") - pkg.depends_on("nwchemex-parallelzone", type=("build", "link", "run")) + pkg.depends_on( + "nwchemex-parallelzone+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-parallelzone~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( From 40f4bff9315afcbb6ecae2e7d4c1bca7dc0505d5 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 13 Oct 2025 12:45:03 -0600 Subject: [PATCH 03/23] Add dependency on numpy for the build tests to pass --- .../nwchemex/core/packages/nwchemex_tensorwrapper/package.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py index 642c819..67f4118 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py @@ -74,6 +74,11 @@ class NwchemexTensorwrapper(NWChemExBasePybindings): type=("build", "link", "run"), when="+python", ) + pkg.depends_on( + "py-numpy", + type=("build", "link", "run"), + when="+python", + ) pkg.depends_on("sigma+eigen", when="+sigma") From 7111ceafd4a2e7fcd45f6e51dded1e1fea225c3d Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 13 Oct 2025 12:46:38 -0600 Subject: [PATCH 04/23] prefix.lib64 does not properly get loaded in the PYTHONPATH --- spack_repo/nwchemex/common/mixins/nwchemex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index dbc71ac..d2de7b2 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -123,7 +123,7 @@ def cmake_args(self): "NWX_MODULE_DIRECTORY", # lib64 is used for platlib from Python package # TODO: Decouple this from Python 3.13 - self.prefix.lib64.join("python3.13").join("site-packages"), + self.prefix.lib.join("python3.13").join("site-packages"), ) ) From b233a11207b0d9071207edf32efe6b22b6d5547d Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Tue, 21 Oct 2025 14:06:44 -0500 Subject: [PATCH 05/23] python conditional depends_on statements; decouple python version --- spack_repo/nwchemex/common/mixins/nwchemex.py | 8 +-- .../packages/nwchemex_chemcache/package.py | 11 +++- .../core/packages/nwchemex_chemist/package.py | 23 +++++++- .../packages/nwchemex_friendzone/package.py | 11 +++- .../packages/nwchemex_integrals/package.py | 11 +++- .../core/packages/nwchemex_nux/package.py | 11 +++- .../packages/nwchemex_nwchemex/package.py | 55 +++++++++++++++++-- .../core/packages/nwchemex_scf/package.py | 11 +++- .../core/packages/nwchemex_simde/package.py | 22 +++++++- 9 files changed, 145 insertions(+), 18 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index d2de7b2..6f96ce4 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -101,8 +101,7 @@ class NWChemExBasePybindings(NWChemExBaseCXX): # https://spack.readthedocs.io/en/latest/build_systems/pythonpackage.html#extends-vs-depends-on pkg.extends("python", when="+python") - # TODO: decouple from python 3.13 - pkg.depends_on("python@3.13", when="+python") + pkg.depends_on("python@3:", when="+python") pkg.depends_on("py-pybind11", when="+python") def cmake_args(self): @@ -122,8 +121,9 @@ def cmake_args(self): self.define( "NWX_MODULE_DIRECTORY", # lib64 is used for platlib from Python package - # TODO: Decouple this from Python 3.13 - self.prefix.lib.join("python3.13").join("site-packages"), + self.prefix.lib.join( + "python{}".format(self.spec["python"].version[:-1]) + ).join("site-packages"), ) ) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py index d59a36b..b2f09d7 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -72,7 +72,16 @@ class NwchemexChemcache(NWChemExBasePybindings): # Runtime dependencies # 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( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py index 67d4f50..b075f91 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py @@ -63,8 +63,27 @@ class NwchemexChemist(NWChemExBasePybindings): # First-party pkg.depends_on("nwchemex-utilities") - pkg.depends_on("nwchemex-parallelzone", type=("build", "link", "run")) - pkg.depends_on("nwchemex-tensorwrapper", type=("build", "link", "run")) + 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 diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 1203f76..d840e79 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -70,7 +70,16 @@ class NwchemexFriendzone(NWChemExBasePybindings): pkg.depends_on("nwchem") # 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( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py b/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py index 295ce03..a2ca584 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py @@ -67,7 +67,16 @@ class NwchemexIntegrals(NWChemExBasePybindings): # pkg.depends_on("sigma+eigen", when="+sigma") # 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( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py index bb85011..ef68e91 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py @@ -61,7 +61,16 @@ class NwchemexNux(NWChemExBasePybindings): # ) # 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( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py index b4e2de4..ed364c2 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py @@ -80,11 +80,56 @@ class NwchemexNwchemex(NWChemExBasePybindings): # pkg.depends_on("exachem", when="+tamm") # First-party - pkg.depends_on("nwchemex-friendzone") - pkg.depends_on("nwchemex-scf") - pkg.depends_on("nwchemex-nux") - pkg.depends_on("nwchemex-chemcache") - pkg.depends_on("nwchemex-integrals") + pkg.depends_on( + "nwchemex-friendzone+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-friendzone~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-scf+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-scf~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-nux+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-nux~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-chemcache+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-chemcache~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-integrals+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-integrals~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py index ce7b1b9..c59921b 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -90,7 +90,16 @@ class NwchemexScf(NWChemExBasePybindings): # pkg.depends_on("sigma+eigen", when="+sigma") # 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( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py b/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py index ae3303a..6abe88f 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py @@ -59,8 +59,26 @@ class NwchemexSimde(NWChemExBasePybindings): ) # First-party - pkg.depends_on("nwchemex-chemist", type=("build", "link", "run")) - pkg.depends_on("nwchemex-pluginplay", type=("build", "link", "run")) + pkg.depends_on( + "nwchemex-chemist+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-chemist~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-pluginplay+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-pluginplay~python", + type=("build", "link", "run"), + when="~python", + ) pkg.depends_on("sigma+eigen", when="+sigma") From b443bcfa49d6f4b69d0727c025e9f4e1e9a296c1 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Thu, 23 Oct 2025 10:42:42 -0600 Subject: [PATCH 06/23] Require pybind >= 3.0 --- spack_repo/nwchemex/common/mixins/nwchemex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 6f96ce4..4a85e26 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -102,7 +102,7 @@ class NWChemExBasePybindings(NWChemExBaseCXX): # https://spack.readthedocs.io/en/latest/build_systems/pythonpackage.html#extends-vs-depends-on pkg.extends("python", when="+python") pkg.depends_on("python@3:", when="+python") - pkg.depends_on("py-pybind11", when="+python") + pkg.depends_on("py-pybind11@3:", when="+python") def cmake_args(self): args = super().cmake_args() From 6c0aa1f107600595f98cf9174aa60984e067e993 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Thu, 23 Oct 2025 12:23:33 -0500 Subject: [PATCH 07/23] various updates to packages --- spack_repo/nwchemex/common/mixins/nwchemex.py | 12 ++++++++++-- .../core/packages/nwchemex_chemcache/package.py | 2 +- .../core/packages/nwchemex_friendzone/package.py | 4 ++-- .../core/packages/nwchemex_nwchemex/package.py | 7 ------- .../nwchemex/core/packages/nwchemex_scf/package.py | 10 +--------- 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 4a85e26..7546096 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -101,8 +101,16 @@ class NWChemExBasePybindings(NWChemExBaseCXX): # https://spack.readthedocs.io/en/latest/build_systems/pythonpackage.html#extends-vs-depends-on pkg.extends("python", when="+python") - pkg.depends_on("python@3:", when="+python") - pkg.depends_on("py-pybind11@3:", 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() diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py index b2f09d7..5b3370e 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -69,7 +69,7 @@ class NwchemexChemcache(NWChemExBasePybindings): sticky=False, ) - # Runtime dependencies + pkg.depends_on("py-requests") # First-party pkg.depends_on( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index d840e79..c053fb0 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -66,8 +66,8 @@ class NwchemexFriendzone(NWChemExBasePybindings): sticky=False, ) - pkg.depends_on("py-ase") - pkg.depends_on("nwchem") + pkg.depends_on("py-ase", type=("build", "link", "run")) + pkg.depends_on("nwchem", type=("build", "link", "run")) # First-party pkg.depends_on( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py index ed364c2..897dcfb 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py @@ -72,13 +72,6 @@ class NwchemexNwchemex(NWChemExBasePybindings): sticky=False, ) - # TODO: Create this package - # pkg.depends_on("gauxc") - pkg.depends_on("eigen") - pkg.depends_on("libint", when="+tamm") - # pkg.depends_on("tamm", when="+tamm") - # pkg.depends_on("exachem", when="+tamm") - # First-party pkg.depends_on( "nwchemex-friendzone+python", diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py index c59921b..fdd1aba 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -63,12 +63,6 @@ class NwchemexScf(NWChemExBasePybindings): default=False, description="Build modules that rely on TAMM/Exachem", ) - pkg.variant( - "experimental", - default=False, - description="Enable experimental features", - sticky=False, - ) # For building GauXC, I think pkg.depends_on("c", type="build") @@ -82,6 +76,7 @@ class NwchemexScf(NWChemExBasePybindings): pkg.depends_on("libint@2.6:", when="+tamm") pkg.depends_on("mpi") pkg.depends_on("py-numpy") + pkg.depends_on("libxc") # pkg.depends_on("tamm", when="+tamm") # pkg.depends_on("exachem", when="+tamm") @@ -115,9 +110,6 @@ def cmake_args(self): args.extend( [ - self.define_from_variant( - "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - ), self.define_from_variant("ENABLE_SIGMA", "sigma"), ] ) From 730cd196c14d0f4bafd1e8f887fc18882e56b44a Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Thu, 23 Oct 2025 15:07:39 -0500 Subject: [PATCH 08/23] add dependencies for FriendZone --- .../nwchemex/core/packages/nwchemex_friendzone/package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index c053fb0..645e423 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -66,6 +66,8 @@ class NwchemexFriendzone(NWChemExBasePybindings): sticky=False, ) + pkg.depends_on("py-pydantic", type=("build", "link", "run")) + pkg.depends_on("py-networkx", type=("build", "link", "run")) pkg.depends_on("py-ase", type=("build", "link", "run")) pkg.depends_on("nwchem", type=("build", "link", "run")) From 81317211704595ca9f1025f6a45862a793fa8ff9 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Thu, 23 Oct 2025 15:07:57 -0500 Subject: [PATCH 09/23] remove reference to unused variant in NUX --- .../core/packages/nwchemex_nux/package.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py index ef68e91..dccc8e3 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py @@ -81,13 +81,13 @@ class NwchemexNux(NWChemExBasePybindings): ) # Append more sanity checks as needed - def cmake_args(self): - args = super().cmake_args() + # def cmake_args(self): + # args = super().cmake_args() - args.extend( - [ - self.define_from_variant("ENABLE_SIGMA", "sigma"), - ] - ) + # args.extend( + # [ + # self.define_from_variant("ENABLE_SIGMA", "sigma"), + # ] + # ) - return args + # return args From b39493a6e0a93a4456b61a0a5fa752d68b5e7902 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Tue, 28 Oct 2025 11:41:00 -0500 Subject: [PATCH 10/23] molssi dependencies --- .../packages/nwchemex_friendzone/package.py | 1 + .../core/packages/py_qcelemental/package.py | 90 +++++++++++++++++++ .../core/packages/py_qcengine/package.py | 88 ++++++++++++++++++ 3 files changed, 179 insertions(+) create mode 100644 spack_repo/nwchemex/core/packages/py_qcelemental/package.py create mode 100644 spack_repo/nwchemex/core/packages/py_qcengine/package.py diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 645e423..c34b9af 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -68,6 +68,7 @@ class NwchemexFriendzone(NWChemExBasePybindings): pkg.depends_on("py-pydantic", type=("build", "link", "run")) pkg.depends_on("py-networkx", type=("build", "link", "run")) + pkg.depends_on("py-qcengine", type=("build", "link", "run")) pkg.depends_on("py-ase", type=("build", "link", "run")) pkg.depends_on("nwchem", type=("build", "link", "run")) diff --git a/spack_repo/nwchemex/core/packages/py_qcelemental/package.py b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py new file mode 100644 index 0000000..00f2ee8 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py @@ -0,0 +1,90 @@ +# Copyright Spack Project Developers. See 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 py-qcelemental +# +# You can edit this file again by typing: +# +# spack edit py-qcelemental +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack_repo.builtin.build_systems.python import PythonPackage + +from spack import package as pkg + + +class PyQcelemental(PythonPackage): + """FIXME: Put a proper description of your package here.""" + + homepage = "https://github.com/MolSSI/QCElemental" + pypi = "qcelemental/qcelemental-0.29.0.tar.gz" + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + + pkg.license("BSD-3-Clause") + + pkg.version( + "0.29.0", + sha256="3571b9bc6c67faba8ea9d988948fd8efc593bf3b5d533486f84ee2e423d60c1e", + ) + pkg.version( + "0.28.0", + sha256="59f2104095b2d5bd78b02149c50c06fa884cde9fc2f49272edd0ec2e7f5fdd3d", + ) + pkg.version( + "0.27.1", + sha256="10686a022e7e85259d6ee1730c29cedff1b67c8a21d753b336fb4c42529922b1", + ) + pkg.version( + "0.27.0", + sha256="bf9ce6d6e134e905a5818c5907a3b8fa9fd8754eeb6b7519bd58c1a6a8177f1a", + ) + pkg.version( + "0.26.0", + sha256="fe198b92298c2a922b5e780757c055a522b31e46178851594185924df82bc00a", + ) + pkg.version( + "0.25.1", + sha256="87decd18ff6fffbbded4c77fe974c332a12573b9075247f461d57ec88301ac8b", + ) + pkg.version( + "0.25.0", + sha256="aad969fb10ac803a659f400a8ffd452f8bfa98409c092a136761dc99eb8374a8", + ) + pkg.version( + "0.24.0", + sha256="154367a7afa0a532325972caa16fd55b27c711fc4520a371eb9db56f4c2c62d1", + ) + pkg.version( + "0.23.0", + sha256="a6c9b77e66241b0862bcad8507aa94c40d5f54d299f46484363e3413caa93185", + ) + pkg.version( + "0.22.0", + sha256="e8d5e2cb00e5d8cd996157150e7270b304760c8a2bb569c68ad8ce279d5702d0", + ) + + pkg.depends_on("python@3.7:", type=("build", "run")) + + pkg.depends_on("py-poetry-core", type="build") + + pkg.depends_on("py-numpy@1.26:", type=("build", "run")) + pkg.depends_on("py-packaging@24.1:", type=("build", "run")) + pkg.depends_on("py-pint@0.24:", type=("build", "run")) + pkg.depends_on("py-pydantic@1.8.2:", type=("build", "run")) + pkg.depends_on("py-importlib-metadata@4.8:", type=("build", "run")) + pkg.depends_on("py-networkx", type=("build", "run")) + pkg.depends_on("py-scipy@1.9.0:", type=("build", "run")) + pkg.depends_on("py-setuptools@68.0.0:", type=("build", "run")) + pkg.depends_on("py-pytest@7.2.2:", type=("build", "run")) diff --git a/spack_repo/nwchemex/core/packages/py_qcengine/package.py b/spack_repo/nwchemex/core/packages/py_qcengine/package.py new file mode 100644 index 0000000..b57e1a5 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/py_qcengine/package.py @@ -0,0 +1,88 @@ +# Copyright Spack Project Developers. See 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 py-qcengine +# +# You can edit this file again by typing: +# +# spack edit py-qcengine +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack_repo.builtin.build_systems.python import PythonPackage + +from spack import package as pkg + + +class PyQcengine(PythonPackage): + """QCEngine provides a wrapper to ingest and produce QCSchema for a variety + of quantum chemistry programs.""" + + homepage = "https://github.com/MolSSI/QCEngine" + pypi = "qcengine/qcengine-0.33.0.tar.gz" + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + + pkg.license("BSD-3-Clause") + + pkg.version( + "0.33.0", + sha256="1d83cda4d1b3214f5710f84ba8ad8586fb9b7949236ed6699f4b036bbd4c077b", + ) + pkg.version( + "0.32.0", + sha256="666ae2eeec6758904548ac72199964c2141a1fcd2f14fed5dbe8bc324e43e4ac", + ) + pkg.version( + "0.31.0", + sha256="1d220c32efa813191a95a5c6a7aa8035551e4126230b60dccea4af236eeff810", + ) + pkg.version( + "0.30.0", + sha256="896c690fa82a5f65b6d702775ac61606dc54050f8642f0c04b6497c5f9bdca62", + ) + pkg.version( + "0.29.0", + sha256="a790f733d9132675636216011286415872ce815e6a4e7f7029ccde8c90293bfc", + ) + pkg.version( + "0.28.1", + sha256="11555cfc475fe6d048da6335fc1e2150a6c5f8082a415c45fe596e4fc96588ee", + ) + pkg.version( + "0.28.0", + sha256="c4b27a7a2f06e02e0ddfabf9b9b95adcc4f92acdd9a55678ae603d79a8464e60", + ) + pkg.version( + "0.27.0", + sha256="d339976c880c79cfe2da7cdb8458895a97322ca2abd134734b0b15031f5e3eeb", + ) + pkg.version( + "0.26.0", + sha256="0659fc6e92d0b8bd2252e4d0290543fdbf6fd5361943b4a43d429fe3074ab2dc", + ) + pkg.version( + "0.25.0", + sha256="2b651ed588c606cb9a734d4cfe04f8dfdee5ce7ccc64885c38f1a4e7798dadea", + ) + + pkg.depends_on("python@3.7:", type=("build", "run")) + + pkg.depends_on("py-setuptools", type="build") + + pkg.depends_on("py-pyyaml", type=("build", "run")) + pkg.depends_on("py-py-cpuinfo", type=("build", "run")) + pkg.depends_on("py-psutil", type=("build", "run")) + pkg.depends_on("py-pydantic@1.8.2:", type=("build", "run")) + pkg.depends_on("py-packaging", type=("build", "run")) + pkg.depends_on("py-qcelemental", type=("build", "run")) From 4d1305f47e37d1d473b58aeba8e07e5c6d488a76 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Tue, 28 Oct 2025 16:11:11 -0500 Subject: [PATCH 11/23] molssi patches --- .../core/packages/nwchemex_friendzone/package.py | 13 ++++++++----- .../core/packages/py_qcelemental/package.py | 6 ++++-- .../nwchemex/core/packages/py_qcengine/package.py | 4 +++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index c34b9af..5fbb81f 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -67,9 +67,9 @@ class NwchemexFriendzone(NWChemExBasePybindings): ) pkg.depends_on("py-pydantic", type=("build", "link", "run")) - pkg.depends_on("py-networkx", type=("build", "link", "run")) + pkg.depends_on("py-networkx~default", type=("build", "link", "run")) pkg.depends_on("py-qcengine", type=("build", "link", "run")) - pkg.depends_on("py-ase", type=("build", "link", "run")) + # pkg.depends_on("py-ase", type=("build", "link", "run")) pkg.depends_on("nwchem", type=("build", "link", "run")) # First-party @@ -97,9 +97,12 @@ def cmake_args(self): args = super().cmake_args() args.extend( - self.define_from_variant( - "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - ), + [ + self.define_from_variant( + "ENABLE_EXPERIMENTAL_FEATURES", "experimental" + ), + self.define("ENABLE_ASE", "OFF"), + ] ) return args diff --git a/spack_repo/nwchemex/core/packages/py_qcelemental/package.py b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py index 00f2ee8..963d564 100644 --- a/spack_repo/nwchemex/core/packages/py_qcelemental/package.py +++ b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py @@ -28,7 +28,9 @@ class PyQcelemental(PythonPackage): """FIXME: Put a proper description of your package here.""" homepage = "https://github.com/MolSSI/QCElemental" - pypi = "qcelemental/qcelemental-0.29.0.tar.gz" + url = "https://github.com/MolSSI/QCElemental/archive/refs/tags/v0.29.0.tar.gz" + git = "https://github.com/MolSSI/QCElemental.git" + # pypi = "qcelemental/qcelemental-0.29.0.tar.gz" pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") @@ -84,7 +86,7 @@ class PyQcelemental(PythonPackage): pkg.depends_on("py-pint@0.24:", type=("build", "run")) pkg.depends_on("py-pydantic@1.8.2:", type=("build", "run")) pkg.depends_on("py-importlib-metadata@4.8:", type=("build", "run")) - pkg.depends_on("py-networkx", type=("build", "run")) + pkg.depends_on("py-networkx~default", type=("build", "run")) pkg.depends_on("py-scipy@1.9.0:", type=("build", "run")) pkg.depends_on("py-setuptools@68.0.0:", type=("build", "run")) pkg.depends_on("py-pytest@7.2.2:", type=("build", "run")) diff --git a/spack_repo/nwchemex/core/packages/py_qcengine/package.py b/spack_repo/nwchemex/core/packages/py_qcengine/package.py index b57e1a5..8c5d3bd 100644 --- a/spack_repo/nwchemex/core/packages/py_qcengine/package.py +++ b/spack_repo/nwchemex/core/packages/py_qcengine/package.py @@ -29,7 +29,9 @@ class PyQcengine(PythonPackage): of quantum chemistry programs.""" homepage = "https://github.com/MolSSI/QCEngine" - pypi = "qcengine/qcengine-0.33.0.tar.gz" + url = "https://github.com/MolSSI/QCEngine/archive/refs/tags/v0.29.0.tar.gz" + git = "https://github.com/MolSSI/QCEngine.git" + # pypi = "qcengine/qcengine-0.33.0.tar.gz" pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") From 0f14c5ce6b861704a4540afe80bcf66262a45cc9 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Tue, 28 Oct 2025 17:45:51 -0500 Subject: [PATCH 12/23] FriendZone deps patch --- .../nwchemex/core/packages/nwchemex_friendzone/package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 5fbb81f..7aedbba 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -66,8 +66,10 @@ class NwchemexFriendzone(NWChemExBasePybindings): sticky=False, ) + pkg.depends_on("py-pip", type=("build", "link")) pkg.depends_on("py-pydantic", type=("build", "link", "run")) pkg.depends_on("py-networkx~default", type=("build", "link", "run")) + pkg.depends_on("py-qcelemental", type=("build", "link", "run")) pkg.depends_on("py-qcengine", type=("build", "link", "run")) # pkg.depends_on("py-ase", type=("build", "link", "run")) pkg.depends_on("nwchem", type=("build", "link", "run")) From 055e8e38e312251c8acb37205435436f08c8ac6c Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Wed, 29 Oct 2025 12:44:03 -0500 Subject: [PATCH 13/23] FriendZone and NWX updates --- .../packages/nwchemex_friendzone/package.py | 34 ++++++++++++------- .../packages/nwchemex_nwchemex/package.py | 33 ++++++++---------- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 7aedbba..4c48266 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -66,13 +66,21 @@ class NwchemexFriendzone(NWChemExBasePybindings): sticky=False, ) - pkg.depends_on("py-pip", type=("build", "link")) - pkg.depends_on("py-pydantic", type=("build", "link", "run")) - pkg.depends_on("py-networkx~default", type=("build", "link", "run")) - pkg.depends_on("py-qcelemental", type=("build", "link", "run")) - pkg.depends_on("py-qcengine", type=("build", "link", "run")) - # pkg.depends_on("py-ase", type=("build", "link", "run")) - pkg.depends_on("nwchem", type=("build", "link", "run")) + 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( @@ -87,12 +95,12 @@ class NwchemexFriendzone(NWChemExBasePybindings): ) # 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() - ) + # 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): diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py index 897dcfb..adcc9ba 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py @@ -78,11 +78,6 @@ class NwchemexNwchemex(NWChemExBasePybindings): type=("build", "link", "run"), when="+python", ) - pkg.depends_on( - "nwchemex-friendzone~python", - type=("build", "link", "run"), - when="~python", - ) pkg.depends_on( "nwchemex-scf+python", type=("build", "link", "run"), @@ -125,21 +120,21 @@ class NwchemexNwchemex(NWChemExBasePybindings): ) # 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() - ) + # 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() + # def cmake_args(self): + # args = super().cmake_args() - args.extend( - self.define_from_variant( - "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - ), - ) + # args.extend( + # self.define_from_variant( + # "ENABLE_EXPERIMENTAL_FEATURES", "experimental" + # ), + # ) - return args + # return args From 221f99780e9d4765eec46f18165c153abc9f0c37 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:06:11 -0700 Subject: [PATCH 14/23] Add base class for NWChemEx Python-only packages --- spack_repo/nwchemex/common/mixins/__init__.py | 13 +++++++++++-- spack_repo/nwchemex/common/mixins/nwchemex.py | 7 ++++++- .../core/packages/nwchemex_friendzone/package.py | 4 ++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/__init__.py b/spack_repo/nwchemex/common/mixins/__init__.py index 63c84d2..5d82e1a 100644 --- a/spack_repo/nwchemex/common/mixins/__init__.py +++ b/spack_repo/nwchemex/common/mixins/__init__.py @@ -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", +] diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 7546096..2e2f1e6 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -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 @@ -96,7 +97,7 @@ class NWChemExBasePybindings(NWChemExBaseCXX): "python", default=False, description="Build the Python bindings", - sticky=True, + # sticky=True, ) # https://spack.readthedocs.io/en/latest/build_systems/pythonpackage.html#extends-vs-depends-on @@ -136,3 +137,7 @@ def cmake_args(self): ) return args + + +class NWChemExBasePython(NWChemExBaseGit, PythonPackage): + pass diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 4c48266..8a92bc0 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -11,11 +11,11 @@ # 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 +# spack install nwchemex-friendzone # # You can edit this file again by typing: # -# spack edit nwchemex-simde +# spack edit nwchemex-friendzone # # See the Spack documentation for more information on packaging. # ---------------------------------------------------------------------------- From e8656e27dd2edabfce62eafa6d1fe84a532ad3b5 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:56:59 -0700 Subject: [PATCH 15/23] Progress on switching friendzone and nwchemex packages to PythonPackage --- .../packages/nwchemex_friendzone/_package.py | 118 +++++++++++++++ .../packages/nwchemex_friendzone/package.py | 80 +++++----- .../packages/nwchemex_nwchemex/_package.py | 140 ++++++++++++++++++ .../packages/nwchemex_nwchemex/package.py | 63 +++----- 4 files changed, 318 insertions(+), 83 deletions(-) create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py new file mode 100644 index 0000000..4c48266 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py @@ -0,0 +1,118 @@ +# 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.variant( + "experimental", + default=False, + description="Enable experimental features", + sticky=False, + ) + + 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_from_variant( + "ENABLE_EXPERIMENTAL_FEATURES", "experimental" + ), + self.define("ENABLE_ASE", "OFF"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 8a92bc0..a9dc1eb 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -22,11 +22,11 @@ from spack import package as pkg -from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings +from spack_repo.nwchemex.common.mixins import NWChemExBasePython -class NwchemexFriendzone(NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" +class NwchemexFriendzone(NWChemExBasePython): + """Provides SimDE-compatible APIs so that NWChemEx can play nicely with its friends.""" project = "FriendZone" @@ -48,8 +48,8 @@ class NwchemexFriendzone(NWChemExBasePybindings): # Versions from git tags pkg.version( - "1.0.9", - sha256="fbf3b4a8f392e88e675696976d4d4927af1f158a2602f761796d415c1fbaeab1", + "1.0.14", + sha256="b504cb1f20ed5839a1fc926650b2f4114b8ff985f2295f81980e05281c74d652", ) # TODO: Should this still be here for SimDE propagation? @@ -59,41 +59,47 @@ class NwchemexFriendzone(NWChemExBasePybindings): # description="Enable Sigma for uncertainty tracking", # sticky=True, # ) + # Not currently available in the Python package + # pkg.variant( + # "experimental", + # default=False, + # description="Enable experimental features", + # sticky=False, + # ) pkg.variant( - "experimental", - default=False, - description="Enable experimental features", - sticky=False, + "friends", + values=pkg.any_combination_of("nwchem", "ase"), + # pkg.any_combination_of() automatically adds a "none" option and sets + # the following two options + # default="none", + # multi=True, + description=( + "Which friends to include. For multiple friends, use a " + "comma-separated list " + "(e.g. `spack install friendzone friends=nwchem,ase`)" + ), ) - 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")) + # TODO: Many of these may be able to be switched to ("build", "run") + # instead of ("build", "link", "run") + pkg.depends_on("python@3.10:", type=("build", "run")) + pkg.depends_on("py-pip", type=("build", "link")) + pkg.depends_on("py-pydantic", type=("build", "link", "run")) + with pkg.when("friends=nwchem"): + pkg.depends_on("py-networkx~default", type=("build", "link", "run")) + pkg.depends_on("py-qcelemental", type=("build", "link", "run")) + pkg.depends_on("py-qcengine", type=("build", "link", "run")) + pkg.depends_on("nwchem", type=("build", "link", "run")) + with pkg.when("friends=ase"): + pkg.depends_on("py-ase", 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", ) + # TODO: Add sanity checks # Start with CMaize sanity check locations # sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( # project.lower() @@ -102,17 +108,3 @@ class NwchemexFriendzone(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" - ), - self.define("ENABLE_ASE", "OFF"), - ] - ) - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py new file mode 100644 index 0000000..adcc9ba --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py @@ -0,0 +1,140 @@ +# 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 NwchemexNwchemex(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "NWChemEx" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.27.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( + "0.0.27", + sha256="1bd22792ca0fbe74f95b2065f2f2d674f2c62d186a340150e8ed1e0f27c2d334", + ) + + # TODO: Should this still be here for SimDE propagation? + # pkg.variant( + # "sigma", + # default=False, + # description="Enable Sigma for uncertainty tracking", + # sticky=True, + # ) + # TODO: Handle this turned on + pkg.variant( + "tamm", + default=False, + description="Build modules that rely on TAMM/Exachem", + ) + pkg.variant( + "full-chemcache", + default=False, + description="If ChemCache isn't found, build the full version", + sticky=False, + ) + + # First-party + pkg.depends_on( + "nwchemex-friendzone+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-scf+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-scf~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-nux+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-nux~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-chemcache+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-chemcache~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-integrals+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-integrals~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_from_variant( + # "ENABLE_EXPERIMENTAL_FEATURES", "experimental" + # ), + # ) + + # return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py index adcc9ba..ded50b3 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py @@ -22,10 +22,10 @@ from spack import package as pkg -from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings +from spack_repo.nwchemex.common.mixins import NWChemExBasePython -class NwchemexNwchemex(NWChemExBasePybindings): +class NwchemexNwchemex(NWChemExBasePython): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "NWChemEx" @@ -65,60 +65,56 @@ class NwchemexNwchemex(NWChemExBasePybindings): default=False, description="Build modules that rely on TAMM/Exachem", ) + # TODO: This is not used anywhere pkg.variant( "full-chemcache", default=False, description="If ChemCache isn't found, build the full version", sticky=False, ) + pkg.variant( + "friends", + values=pkg.any_combination_of("nwchem", "ase"), + # pkg.any_combination_of() automatically adds a "none" option and sets + # the following two options + # default="none", + # multi=True, + description=( + "Which friends to include. For multiple friends, use a " + "comma-separated list " + "(e.g. `spack install friendzone friends=nwchem,ase`)" + ), + ) + + # TODO: Many of these may be able to be switched to ("build", "run") + # instead of ("build", "link", "run") + pkg.depends_on("python@3.10:", type=("build", "run")) # First-party + # TODO: Figure out how to ensure that the correct value for the "friends" + # variant can be propagated, or switch each friend to a separate variant pkg.depends_on( - "nwchemex-friendzone+python", + "nwchemex-friendzone", type=("build", "link", "run"), - when="+python", ) pkg.depends_on( "nwchemex-scf+python", type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "nwchemex-scf~python", - type=("build", "link", "run"), - when="~python", ) pkg.depends_on( "nwchemex-nux+python", type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "nwchemex-nux~python", - type=("build", "link", "run"), - when="~python", ) pkg.depends_on( "nwchemex-chemcache+python", type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "nwchemex-chemcache~python", - type=("build", "link", "run"), - when="~python", ) pkg.depends_on( "nwchemex-integrals+python", type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "nwchemex-integrals~python", - type=("build", "link", "run"), - when="~python", ) + # TODO: Add sanity checks # Start with CMaize sanity check locations # sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( # project.lower() @@ -127,14 +123,3 @@ class NwchemexNwchemex(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 From 25cfac1d2ff3f635e33218e0352b4e4d92fa29e9 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Tue, 4 Nov 2025 15:56:42 -0600 Subject: [PATCH 16/23] remove stale references to experimental features --- .../packages/nwchemex_chemcache/package.py | 19 ------------------- .../packages/nwchemex_friendzone/_package.py | 9 --------- .../packages/nwchemex_friendzone/package.py | 7 ------- .../packages/nwchemex_nwchemex/_package.py | 11 ----------- 4 files changed, 46 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py index 5b3370e..dde069a 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -62,12 +62,6 @@ class NwchemexChemcache(NWChemExBasePybindings): # description="Enable Sigma for uncertainty tracking", # sticky=True, # ) - pkg.variant( - "experimental", - default=False, - description="Enable experimental features", - sticky=False, - ) pkg.depends_on("py-requests") @@ -91,16 +85,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 diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py index 4c48266..1f1774e 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py @@ -59,12 +59,6 @@ class NwchemexFriendzone(NWChemExBasePybindings): # description="Enable Sigma for uncertainty tracking", # sticky=True, # ) - pkg.variant( - "experimental", - default=False, - description="Enable experimental features", - sticky=False, - ) pkg.depends_on("py-pip", when="+python", type=("build", "link")) pkg.depends_on( @@ -108,9 +102,6 @@ def cmake_args(self): args.extend( [ - self.define_from_variant( - "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - ), self.define("ENABLE_ASE", "OFF"), ] ) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index a9dc1eb..027de00 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -59,13 +59,6 @@ class NwchemexFriendzone(NWChemExBasePython): # description="Enable Sigma for uncertainty tracking", # sticky=True, # ) - # Not currently available in the Python package - # pkg.variant( - # "experimental", - # default=False, - # description="Enable experimental features", - # sticky=False, - # ) pkg.variant( "friends", values=pkg.any_combination_of("nwchem", "ase"), diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py index adcc9ba..12e729a 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py @@ -127,14 +127,3 @@ class NwchemexNwchemex(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 From f68ef5ea4e356d72dcf9844ec23a0e41f52ef978 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Mon, 10 Nov 2025 16:12:58 -0600 Subject: [PATCH 17/23] FriendZon and NWX updates; some cleaning on various packages --- .../packages/nwchemex_chemcache/package.py | 8 ----- .../packages/nwchemex_friendzone/package.py | 9 ++--- .../core/packages/nwchemex_nux/package.py | 19 ---------- .../packages/nwchemex_nwchemex/package.py | 36 ++----------------- .../packages/nwchemex_parallelzone/package.py | 11 ++++++ .../core/packages/nwchemex_scf/package.py | 34 ------------------ .../nwchemex_tensorwrapper/package.py | 1 + 7 files changed, 16 insertions(+), 102 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py index dde069a..9698c28 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -55,14 +55,6 @@ class NwchemexChemcache(NWChemExBasePybindings): 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.depends_on("py-requests") # First-party diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 027de00..5e72ca0 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -47,18 +47,12 @@ class NwchemexFriendzone(NWChemExBasePython): pkg.license("Apache-2.0", checked_by="zachcran") # Versions from git tags + pkg.version("python_package", branch="python_package") pkg.version( "1.0.14", sha256="b504cb1f20ed5839a1fc926650b2f4114b8ff985f2295f81980e05281c74d652", ) - # TODO: Should this still be here for SimDE propagation? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) pkg.variant( "friends", values=pkg.any_combination_of("nwchem", "ase"), @@ -77,6 +71,7 @@ class NwchemexFriendzone(NWChemExBasePython): # instead of ("build", "link", "run") pkg.depends_on("python@3.10:", type=("build", "run")) pkg.depends_on("py-pip", type=("build", "link")) + pkg.depends_on("py-setuptools", type="build") pkg.depends_on("py-pydantic", type=("build", "link", "run")) with pkg.when("friends=nwchem"): pkg.depends_on("py-networkx~default", type=("build", "link", "run")) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py index dccc8e3..9a97ef7 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py @@ -52,14 +52,6 @@ class NwchemexNux(NWChemExBasePybindings): sha256="58cb55b4975baf3255208333fd4366293efe55b0aeaab3c269f7485f75f2061b", ) - # TODO: Should this still be here for SimDE propagation? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) - # First-party pkg.depends_on( "nwchemex-simde+python", @@ -80,14 +72,3 @@ class NwchemexNux(NWChemExBasePybindings): project.lower() ) # Append more sanity checks as needed - - # def cmake_args(self): - # args = super().cmake_args() - - # args.extend( - # [ - # self.define_from_variant("ENABLE_SIGMA", "sigma"), - # ] - # ) - - # return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py index ded50b3..d8afa69 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py @@ -47,48 +47,16 @@ class NwchemexNwchemex(NWChemExBasePython): pkg.license("Apache-2.0", checked_by="zachcran") # Versions from git tags + pkg.version("python_package", branch="python_package") pkg.version( "0.0.27", sha256="1bd22792ca0fbe74f95b2065f2f2d674f2c62d186a340150e8ed1e0f27c2d334", ) - # TODO: Should this still be here for SimDE propagation? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) - # TODO: Handle this turned on - pkg.variant( - "tamm", - default=False, - description="Build modules that rely on TAMM/Exachem", - ) - # TODO: This is not used anywhere - pkg.variant( - "full-chemcache", - default=False, - description="If ChemCache isn't found, build the full version", - sticky=False, - ) - pkg.variant( - "friends", - values=pkg.any_combination_of("nwchem", "ase"), - # pkg.any_combination_of() automatically adds a "none" option and sets - # the following two options - # default="none", - # multi=True, - description=( - "Which friends to include. For multiple friends, use a " - "comma-separated list " - "(e.g. `spack install friendzone friends=nwchem,ase`)" - ), - ) - # TODO: Many of these may be able to be switched to ("build", "run") # instead of ("build", "link", "run") pkg.depends_on("python@3.10:", type=("build", "run")) + pkg.depends_on("py-setuptools", type="build") # First-party # TODO: Figure out how to ensure that the correct value for the "friends" diff --git a/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py index a4a55c1..6111d81 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py @@ -85,4 +85,15 @@ class NwchemexParallelzone(NWChemExBasePybindings): 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_from_variant("BUILD_PAPI_BINDINGS ", "papi"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py index fdd1aba..68bc685 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -51,38 +51,15 @@ class NwchemexScf(NWChemExBasePybindings): sha256="b175c15e8c814cd288817c970f4e049c7eab248975ff7c891d8927d7555d0cd8", ) - pkg.variant( - "sigma", - default=False, - description="Enable Sigma for uncertainty tracking", - sticky=True, - ) - # TODO: Handle this turned on - pkg.variant( - "tamm", - default=False, - description="Build modules that rely on TAMM/Exachem", - ) - # For building GauXC, I think pkg.depends_on("c", type="build") # TODO: Create this package # pkg.depends_on("gauxc") pkg.depends_on("eigen") - # The "tune" variant is not available prior to v2.6 - # TODO: A value of "tune=none" or any of the molgw-* options likely break - # the unit tests, but I don't know how to add them as conflicts yet. - pkg.depends_on("libint@2.6:", when="+tamm") pkg.depends_on("mpi") pkg.depends_on("py-numpy") pkg.depends_on("libxc") - # pkg.depends_on("tamm", when="+tamm") - # pkg.depends_on("exachem", when="+tamm") - - # Although we have a variant, technically it is not a direct dependency - # of this package - # pkg.depends_on("sigma+eigen", when="+sigma") # First-party pkg.depends_on( @@ -104,14 +81,3 @@ class NwchemexScf(NWChemExBasePybindings): project.lower() ) # Append more sanity checks as needed - - def cmake_args(self): - args = super().cmake_args() - - args.extend( - [ - self.define_from_variant("ENABLE_SIGMA", "sigma"), - ] - ) - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py index 67f4118..fc2bd9c 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py @@ -61,6 +61,7 @@ class NwchemexTensorwrapper(NWChemExBasePybindings): # Runtime dependencies pkg.depends_on("boost") pkg.depends_on("eigen") + pkg.depends_on("py-numpy", when="+python", type=("build", "run")) # First-party pkg.depends_on("nwchemex-utilities") From 430e5410e52d9a9e559e39f8c8e5cc311fbb8b9d Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Wed, 12 Nov 2025 12:17:54 -0600 Subject: [PATCH 18/23] Python is default --- spack_repo/nwchemex/common/mixins/nwchemex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 2e2f1e6..2342a7e 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -95,7 +95,7 @@ class NWChemExBasePybindings(NWChemExBaseCXX): pkg.variant( "python", - default=False, + default=True, description="Build the Python bindings", # sticky=True, ) From 611dfe0ccb823aaba3f24952ff4737da7153fa0c Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Fri, 14 Nov 2025 16:08:20 -0600 Subject: [PATCH 19/23] update FriendZone --- .../nwchemex/core/packages/nwchemex_friendzone/package.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 5e72ca0..ba28ad3 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -55,7 +55,7 @@ class NwchemexFriendzone(NWChemExBasePython): pkg.variant( "friends", - values=pkg.any_combination_of("nwchem", "ase"), + values=pkg.any_combination_of("molssi", "ase", "nwchem"), # pkg.any_combination_of() automatically adds a "none" option and sets # the following two options # default="none", @@ -63,7 +63,7 @@ class NwchemexFriendzone(NWChemExBasePython): description=( "Which friends to include. For multiple friends, use a " "comma-separated list " - "(e.g. `spack install friendzone friends=nwchem,ase`)" + "(e.g. `spack install friendzone friends=molssi,ase`)" ), ) @@ -73,10 +73,11 @@ class NwchemexFriendzone(NWChemExBasePython): pkg.depends_on("py-pip", type=("build", "link")) pkg.depends_on("py-setuptools", type="build") pkg.depends_on("py-pydantic", type=("build", "link", "run")) - with pkg.when("friends=nwchem"): + with pkg.when("friends=molssi"): pkg.depends_on("py-networkx~default", type=("build", "link", "run")) pkg.depends_on("py-qcelemental", type=("build", "link", "run")) pkg.depends_on("py-qcengine", type=("build", "link", "run")) + with pkg.when("friends=nwchem"): pkg.depends_on("nwchem", type=("build", "link", "run")) with pkg.when("friends=ase"): pkg.depends_on("py-ase", type=("build", "link", "run")) From 6af16e328119a7010d7984f36f9a684dbbc9327e Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Thu, 20 Nov 2025 15:31:19 -0600 Subject: [PATCH 20/23] remove cxx standard from NWChemExBaseCXX --- spack_repo/nwchemex/common/mixins/nwchemex.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 2342a7e..a2fa8a1 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -30,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 @@ -56,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), ] ) @@ -75,12 +63,6 @@ def cmake_args(self): args.append(self.define("CMAKE_POLICY_DEFAULT_CMP0152", "NEW")) # DEBUG REMOVE ME - args.append( - self.define( - "FETCHCONTENT_SOURCE_DIR_NWX_CMAKE", - "/home/zachcran/workspaces/nwchemex/repos_dev/nwxcmake", - ) - ) args.append( self.define( "CMAKE_VERBOSE_MAKEFILE", From 41ab70532374de639a067220c488dfcfb07f771b Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Fri, 21 Nov 2025 13:27:07 -0600 Subject: [PATCH 21/23] dependency updates; checksum update for qcengine --- spack_repo/nwchemex/core/packages/nwchemex_scf/package.py | 3 ++- .../nwchemex/core/packages/nwchemex_tensorwrapper/package.py | 2 +- spack_repo/nwchemex/core/packages/py_qcengine/package.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py index 68bc685..1194533 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -59,7 +59,8 @@ class NwchemexScf(NWChemExBasePybindings): pkg.depends_on("eigen") pkg.depends_on("mpi") pkg.depends_on("py-numpy") - pkg.depends_on("libxc") + # Uncomment when GauXC/Libxc interactions are sorted out + # pkg.depends_on("libxc") # First-party pkg.depends_on( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py index fc2bd9c..675bd6c 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py @@ -60,7 +60,7 @@ class NwchemexTensorwrapper(NWChemExBasePybindings): # Runtime dependencies pkg.depends_on("boost") - pkg.depends_on("eigen") + pkg.depends_on("eigen", type=("build", "link", "run")) pkg.depends_on("py-numpy", when="+python", type=("build", "run")) # First-party diff --git a/spack_repo/nwchemex/core/packages/py_qcengine/package.py b/spack_repo/nwchemex/core/packages/py_qcengine/package.py index 8c5d3bd..e6b92b6 100644 --- a/spack_repo/nwchemex/core/packages/py_qcengine/package.py +++ b/spack_repo/nwchemex/core/packages/py_qcengine/package.py @@ -39,7 +39,7 @@ class PyQcengine(PythonPackage): pkg.version( "0.33.0", - sha256="1d83cda4d1b3214f5710f84ba8ad8586fb9b7949236ed6699f4b036bbd4c077b", + sha256="7d9317355294b2118b9e959e57394eb3f2205db004d9ebe7441cd5026a7fc6c4", ) pkg.version( "0.32.0", From 184edc18e6b2145aef8c97d854c577e7d7b5e989 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 24 Nov 2025 13:27:03 -0700 Subject: [PATCH 22/23] ChemCache: Add minimum version constraint to py-requests --- .../nwchemex/core/packages/nwchemex_chemcache/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py index 9698c28..bb28e16 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -21,6 +21,7 @@ # ---------------------------------------------------------------------------- from spack import package as pkg + from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings @@ -55,7 +56,7 @@ class NwchemexChemcache(NWChemExBasePybindings): sha256="5efb2a60d75aaa57e08e8b2a0b84a24e502083fa5bacae416406ec59bd2839b8", ) - pkg.depends_on("py-requests") + pkg.depends_on("py-requests@2.16:") # First-party pkg.depends_on( From d7258b7b93ba6769498b4718ff7d49f078c486ca Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Tue, 25 Nov 2025 02:15:56 -0600 Subject: [PATCH 23/23] Remove stale FriendZone version --- spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py | 1 - 1 file changed, 1 deletion(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index ba28ad3..03b9113 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -47,7 +47,6 @@ class NwchemexFriendzone(NWChemExBasePython): pkg.license("Apache-2.0", checked_by="zachcran") # Versions from git tags - pkg.version("python_package", branch="python_package") pkg.version( "1.0.14", sha256="b504cb1f20ed5839a1fc926650b2f4114b8ff985f2295f81980e05281c74d652",