From d0feccb35417cb316c2755603a38b8ec691acac8 Mon Sep 17 00:00:00 2001 From: zachcran Date: Mon, 14 Jul 2025 13:15:04 -0600 Subject: [PATCH 01/19] Convert to Package API v2.0, draft rest of software stack, and abstract out what I can --- spack-repo-index.yaml | 1 + spack_repo/nwchemex/common/README.md | 14 ++ spack_repo/nwchemex/common/mixins/__init__.py | 4 + spack_repo/nwchemex/common/mixins/cmaize.py | 67 +++++++ spack_repo/nwchemex/common/mixins/nwchemex.py | 106 ++++++++++++ spack_repo/nwchemex/common/repo.yaml | 10 ++ .../core/packages/nwchemex-chemist/package.py | 149 ---------------- .../packages/nwchemex-parallelzone/package.py | 163 ------------------ .../packages/nwchemex-pluginplay/package.py | 149 ---------------- .../core/packages/nwchemex-scf/package.py | 146 ---------------- .../core/packages/nwchemex-simde/package.py | 145 ---------------- .../nwchemex-tensorwrapper/package.py | 153 ---------------- .../packages/nwchemex-utilities/package.py | 119 ------------- .../packages/nwchemex_chemcache/package.py | 98 +++++++++++ .../core/packages/nwchemex_chemist/package.py | 91 ++++++++++ .../packages/nwchemex_friendzone/package.py | 93 ++++++++++ .../packages/nwchemex_integrals/package.py | 87 ++++++++++ .../core/packages/nwchemex_nux/package.py | 84 +++++++++ .../packages/nwchemex_nwchemex/package.py | 107 ++++++++++++ .../packages/nwchemex_parallelzone/package.py | 88 ++++++++++ .../packages/nwchemex_pluginplay/package.py | 86 +++++++++ .../core/packages/nwchemex_scf/package.py | 103 +++++++++++ .../core/packages/nwchemex_simde/package.py | 85 +++++++++ .../nwchemex_tensorwrapper/package.py | 89 ++++++++++ .../packages/nwchemex_utilities/package.py | 61 +++++++ 25 files changed, 1274 insertions(+), 1024 deletions(-) create mode 100644 spack_repo/nwchemex/common/README.md create mode 100644 spack_repo/nwchemex/common/mixins/__init__.py create mode 100644 spack_repo/nwchemex/common/mixins/cmaize.py create mode 100644 spack_repo/nwchemex/common/mixins/nwchemex.py create mode 100644 spack_repo/nwchemex/common/repo.yaml delete mode 100644 spack_repo/nwchemex/core/packages/nwchemex-chemist/package.py delete mode 100644 spack_repo/nwchemex/core/packages/nwchemex-parallelzone/package.py delete mode 100644 spack_repo/nwchemex/core/packages/nwchemex-pluginplay/package.py delete mode 100644 spack_repo/nwchemex/core/packages/nwchemex-scf/package.py delete mode 100644 spack_repo/nwchemex/core/packages/nwchemex-simde/package.py delete mode 100644 spack_repo/nwchemex/core/packages/nwchemex-tensorwrapper/package.py delete mode 100644 spack_repo/nwchemex/core/packages/nwchemex-utilities/package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_nux/package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_scf/package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_simde/package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_utilities/package.py diff --git a/spack-repo-index.yaml b/spack-repo-index.yaml index ceab671..6cd40b9 100644 --- a/spack-repo-index.yaml +++ b/spack-repo-index.yaml @@ -4,5 +4,6 @@ repo_index: # Relative paths from project root to repos paths: + - spack_repo/nwchemex/common - spack_repo/nwchemex/core - spack_repo/nwchemex/overrides diff --git a/spack_repo/nwchemex/common/README.md b/spack_repo/nwchemex/common/README.md new file mode 100644 index 0000000..d9ce4fa --- /dev/null +++ b/spack_repo/nwchemex/common/README.md @@ -0,0 +1,14 @@ +# NWChemEx Common Package Components + +As of Spack package repository `api: v2.0`, package repositories integrate smoothly with Python's import system and can be imported for use in other packages. This repository is a collection of helpers and abstractions for NWChemEx packages to help with maintenance and development. + +## Usage + +In other repositories, use the following import statement form: +```python +from spack_repo.nwchemex._common.packages..package import Package +# Or, more generally +from spack_repo.nwchemex._common.. import +``` + +For more information about importing from packages after `api:v2.0`, see Spack's [Repository Namespaces and Python](https://spack.readthedocs.io/en/latest/repositories.html#repository-namespaces-and-python). diff --git a/spack_repo/nwchemex/common/mixins/__init__.py b/spack_repo/nwchemex/common/mixins/__init__.py new file mode 100644 index 0000000..63c84d2 --- /dev/null +++ b/spack_repo/nwchemex/common/mixins/__init__.py @@ -0,0 +1,4 @@ +from .cmaize import CMaizePackage +from .nwchemex import NWChemExBaseCXX, NWChemExBasePybindings + +__all__ = ["CMaizePackage", "NWChemExBaseCXX", "NWChemExBasePybindings"] diff --git a/spack_repo/nwchemex/common/mixins/cmaize.py b/spack_repo/nwchemex/common/mixins/cmaize.py new file mode 100644 index 0000000..be829c0 --- /dev/null +++ b/spack_repo/nwchemex/common/mixins/cmaize.py @@ -0,0 +1,67 @@ +from spack.package import join_path +from spack.package_base import PackageBase +from spack_repo.builtin.build_systems.cmake import CMakePackage + + +class CMaizePackage(CMakePackage): + + @staticmethod + def cmaize_sanity_check_dirs(project_name: str) -> list[str]: + # Could also use cls.__name__.lower() if it should always match + project_name_lowercase = project_name.lower() + + # Create NWChemEx project locations + project_include_path = join_path("include", project_name_lowercase) + project_lib_path = join_path("lib", project_name_lowercase) + project_lib_cmake_path = join_path( + project_lib_path, + "cmake", + ) + + directories = [ + join_path(project_include_path), + join_path(project_lib_path), + join_path(project_lib_cmake_path), + # CMaize's "external/" should not be a strict requirement since it + # can be empty, especially with Spack managing most/all deps. + # join_path(project_lib_path, "external"), + ] + + return directories + + @staticmethod + def cmaize_sanity_check_files(project_name: str) -> list[str]: + project_name_lowercase = project_name.lower() + + # Create NWChemEx project locations + project_lib_path = join_path("lib", project_name_lowercase) + project_lib_cmake_path = join_path( + project_lib_path, + "cmake", + ) + + files = [ + join_path( + project_lib_cmake_path, + f"{project_name_lowercase}Config.cmake", + ), + join_path( + project_lib_cmake_path, + f"{project_name_lowercase}ConfigVersion.cmake", + ), + join_path( + project_lib_cmake_path, + f"{project_name_lowercase}-target.cmake", + ), + # TODO: Conditionally check these once there is a "shared" variant + # if even possible + # join_path( + # project_lib_path, f"lib{project_name_lowercase}.a" + # ), + # join_path( + # project_lib_path, + # f"lib{project_name_lowercase}.so", + # ), + ] + + return files diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py new file mode 100644 index 0000000..a2e1261 --- /dev/null +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -0,0 +1,106 @@ +import os + +from spack import package as pkg +from spack.package_base import PackageBase + +from . import CMaizePackage + + +class NWChemExBaseGit(PackageBase): + + # Latest commit from GitHub + # "This download method is untrusted, and is not recommended. Branches are + # moving targets, so the commit you get when you install the package likely + # won’t be the same commit that was used when the package was first + # written." + # ~~~~ From the Spack docs + # Is there a way to warn the user about this while still providing + # the option? + pkg.version("master", branch="master", preferred=True) + + +class NWChemExBaseCXX(NWChemExBaseGit, CMaizePackage): + + pkg.variant("docs", default=False, description="Build documentation") + pkg.variant( + "shared", + default=True, + description="Build shared libraries", + sticky=True, + ) + + pkg.depends_on("cxx", type="build") + + # Test dependencies + pkg.depends_on("catch2", type="test") + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant( + "CMAKE_POSITION_INDEPENDENT_CODE", "shared" + ), + self.define_from_variant("BUILD_SHARED_LIBS", "shared"), + self.define_from_variant("BUILD_DOCS", "docs"), + self.define("BUILD_TESTING", self.run_tests), + ] + ) + + if "CMAKE_TOOLCHAIN_FILE" in os.environ: + args.append( + f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" + ) + # TODO: +debug flag? +verbose flag? + args.append(self.define("CMAKE_MESSAGE_LOG_LEVEL", "DEBUG")) + # Silence FetchContent by default + args.append(self.define("FETCHCONTENT_QUIET", True)) + args.append("-Wno-dev") + # https://cmake.org/cmake/help/latest/policy/CMP0152.html + # Added in 3.28; OLD is deprecated now + 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", + ) + ) + + return args + + +class NWChemExBasePybindings(NWChemExBaseCXX): + + pkg.variant( + "pybindings", + default=False, + description="Build the Python bindings with Pybind11", + sticky=True, + ) + + pkg.depends_on("py-pybind11", when="+pybindings") + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant( + "BUILD_PYBIND11_PYBINDINGS", "pybindings" + ), + self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), + ] + ) + + if self.spec.satisfies("+pybindings"): + # TODO: Allow the user to configure this? + args.append( + "-DNWX_MODULE_DIRECTORY={}".format( + self.prefix.lib.join(self.project).join("python") + ) + ) + + return args diff --git a/spack_repo/nwchemex/common/repo.yaml b/spack_repo/nwchemex/common/repo.yaml new file mode 100644 index 0000000..18876d1 --- /dev/null +++ b/spack_repo/nwchemex/common/repo.yaml @@ -0,0 +1,10 @@ +# For more information on Spack package repositories, see +# https://spack.readthedocs.io/en/latest/repositories.html + +repo: + # Unique identifier for this repository + # For more details, see https://spack.readthedocs.io/en/latest/repositories.html#namespaces + namespace: 'nwchemex.common' + + # Spack package API this repo adheres to + api: v2.0 diff --git a/spack_repo/nwchemex/core/packages/nwchemex-chemist/package.py b/spack_repo/nwchemex/core/packages/nwchemex-chemist/package.py deleted file mode 100644 index 67ea5ab..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-chemist/package.py +++ /dev/null @@ -1,149 +0,0 @@ -# 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-chemist -# -# You can edit this file again by typing: -# -# spack edit nwchemex-chemist -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - -import os - -from spack.package import * - - -class NwchemexChemist(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/Chemist" - url = ( - "https://github.com/NWChemEx/Chemist/archive/refs/tags/v1.3.18.tar.gz" - ) - git = "https://github.com/NWChemEx/Chemist.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/Chemist/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 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "1.3.19", - sha256="dc1adf754ce9a532ee4b13461aaaf29488a2d6d5f34aaa416a33bd621abb8c29", - ) - - variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, - ) - variant("docs", default=False, description="Build documentation") - variant( - "sigma", - default=False, - description="Enable Sigma for uncertainty tracking", - sticky=True, - ) - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # Runtime dependencies - depends_on("cxx", type="build") - depends_on("boost") - depends_on("py-pybind11", when="+pybindings") - # First-party - depends_on("nwchemex-utilities") - depends_on("nwchemex-parallelzone") - depends_on("nwchemex-tensorwrapper") - - # Test dependencies - depends_on("catch2", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("include", "chemist", "chemist.hpp"), - join_path("lib", "chemist", "cmake", "chemistConfig.cmake"), - join_path("lib", "chemist", "cmake", "chemistConfigVersion.cmake"), - join_path("lib", "chemist", "cmake", "chemist-target.cmake"), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "chemist", "libchemist.a"), - # join_path("lib", "chemist", "libchemist.so"), - ] - - sanity_check_is_dir = [ - join_path("include", "chemist"), - join_path("lib", "chemist"), - join_path("lib", "chemist", "cmake"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - self.define_from_variant("ENABLE_SIGMA", "sigma"), - self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" - ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), - ] - - if self.spec.satisfies("+pybindings"): - # TODO: Allow the user to configure this - args.append( - "-DNWX_MODULE_DIRECTORY={}".format( - join_path(self.prefix.lib, "chemist", "python") - ) - ) - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex-parallelzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex-parallelzone/package.py deleted file mode 100644 index da1b27a..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-parallelzone/package.py +++ /dev/null @@ -1,163 +0,0 @@ -# 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-parallelzone -# -# You can edit this file again by typing: -# -# spack edit nwchemex-parallelzone -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - -import os - -from spack.package import * - - -class NwchemexParallelzone(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/ParallelZone" - url = "https://github.com/NWChemEx/ParallelZone/archive/refs/tags/v0.1.30.tar.gz" - git = ( - "https://github.com/NWChemEx/ParallelZone.git" # For the latest commit - ) - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/ParallelZone/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 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "0.1.34", - sha256="ca47108832ddefc600c9b4782bbe0faf89da403a4cdac5b379f508be39ece934", - ) - - variant( - "papi", - default=False, - description="Enable PAPI bindings", - ) - # variant( - # "cuda", - # default=False, - # description="Enable CUDA bindings", - # ) - # variant( - # "hip", - # default=False, - # description="Enable HIP bindings", - # ) - # variant( - # "sycl", - # default=False, - # description="Enable SYCL bindings", - # ) - variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, - ) - variant("docs", default=False, description="Build documentation") - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # Runtime dependencies - depends_on("cxx", type="build") - depends_on("mpi") - depends_on("spdlog") - depends_on("cereal@1.3.0") # v1.3.1 changed the installed target... - depends_on("papi", when="+papi") - depends_on("py-pybind11", when="+pybindings") - - # Test dependencies - depends_on("catch2", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("include", "parallelzone", "parallelzone.hpp"), - join_path("lib", "parallelzone", "cmake", "parallelzoneConfig.cmake"), - join_path( - "lib", "parallelzone", "cmake", "parallelzoneConfigVersion.cmake" - ), - join_path("lib", "parallelzone", "cmake", "parallelzone-target.cmake"), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "parallelzone", "libparallelzone.a"), - # join_path("lib", "parallelzone", "libparallelzone.so"), - ] - - sanity_check_is_dir = [ - join_path("include", "parallelzone"), - join_path("lib", "parallelzone"), - join_path("lib", "parallelzone", "cmake"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" - ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), - ] - - if self.spec.satisfies("+pybindings"): - # TODO: Allow the user to configure this? - args.append( - "-DNWX_MODULE_DIRECTORY={}".format( - join_path(self.prefix.lib, "parallelzone", "python") - ) - ) - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex-pluginplay/package.py b/spack_repo/nwchemex/core/packages/nwchemex-pluginplay/package.py deleted file mode 100644 index 4fda2f6..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-pluginplay/package.py +++ /dev/null @@ -1,149 +0,0 @@ -# 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-pluginplay -# -# You can edit this file again by typing: -# -# spack edit nwchemex-pluginplay -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - -import os - -from spack.package import * - - -class NwchemexPluginplay(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/PluginPlay" - url = "https://github.com/NWChemEx/PluginPlay/archive/refs/tags/v1.0.43.tar.gz" - git = "https://github.com/NWChemEx/PluginPlay.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/PluginPlay/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 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "1.0.46", - sha256="22303b38ac6e2459b50a9074697a59fbd01422cdb7db98599f81255f43176597", - ) - - variant( - "rocksdb", - default=False, - description="Enable RocksDB backend of the cache", - ) - variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, - ) - variant("docs", default=False, description="Build documentation") - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # Runtime dependencies - depends_on("cxx", type="build") - depends_on("boost") - depends_on("libfort enable_testing=false") - depends_on("rocksdb", when="+rocksdb") - depends_on("py-pybind11", when="+pybindings") - # First-party - depends_on("nwchemex-utilities") - depends_on("nwchemex-parallelzone") - - # Test dependencies - depends_on("catch2", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("include", "pluginplay", "pluginplay.hpp"), - join_path("lib", "pluginplay", "cmake", "pluginplayConfig.cmake"), - join_path( - "lib", "pluginplay", "cmake", "pluginplayConfigVersion.cmake" - ), - join_path("lib", "pluginplay", "cmake", "pluginplay-target.cmake"), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "pluginplay", "libpluginplay.a"), - # join_path("lib", "pluginplay", "libpluginplay.so"), - ] - - sanity_check_is_dir = [ - join_path("include", "pluginplay"), - join_path("lib", "pluginplay"), - join_path("lib", "pluginplay", "cmake"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - self.define_from_variant("BUILD_ROCKSDB", "rocksdb"), - self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" - ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), - ] - - if self.spec.satisfies("+pybindings"): - # TODO: Allow the user to configure this - args.append( - "-DNWX_MODULE_DIRECTORY={}".format( - join_path(self.prefix.lib, "parallelzone", "python") - ) - ) - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex-scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex-scf/package.py deleted file mode 100644 index 4cbd613..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-scf/package.py +++ /dev/null @@ -1,146 +0,0 @@ -# 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-scf -# -# You can edit this file again by typing: -# -# spack edit nwchemex-scf -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - -import os - -from spack.package import * - - -class NwchemexScf(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/SCF" - url = "https://github.com/NWChemEx/SCF/archive/refs/tags/v0.0.53.tar.gz" - git = "https://github.com/NWChemEx/SCF.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/SCF/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 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "0.0.23", - sha256="b175c15e8c814cd288817c970f4e049c7eab248975ff7c891d8927d7555d0cd8", - ) - - variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, - ) - variant("docs", default=False, description="Build documentation") - # FIXME: Anything above TensorWrapper is going to need to turn on or off sigma - variant( - "sigma", - default=False, - description="Enable Sigma for uncertainty tracking", - sticky=True, - ) - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # Runtime dependencies - depends_on("cxx", type="build") - depends_on("py-pybind11", when="+pybindings") - # FIXME: First-party dependencies - # depends_on("nwchemex-another-repo") - - # Test dependencies - depends_on("catch2", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("include", "scf", "scf.hpp"), - join_path("lib", "scf", "cmake", "scfConfig.cmake"), - join_path("lib", "scf", "cmake", "scfConfigVersion.cmake"), - join_path("lib", "scf", "cmake", "scf-target.cmake"), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "scf", "libscf.a"), - # join_path("lib", "scf", "libscf.so"), - ] - - sanity_check_is_dir = [ - join_path("include", "scf"), - join_path("lib", "scf"), - join_path("lib", "scf", "cmake"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - # FIXME: Anything above TensorWrapper is going to need to turn on or off sigma - self.define_from_variant("ENABLE_SIGMA", "sigma"), - self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" - ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), - ] - - if self.spec.satisfies("+pybindings"): - # TODO: Allow the user to configure this - args.append( - "-DNWX_MODULE_DIRECTORY={}".format( - join_path(self.prefix.lib, "scf", "python") - ) - ) - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex-simde/package.py b/spack_repo/nwchemex/core/packages/nwchemex-simde/package.py deleted file mode 100644 index 4e09d5d..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-simde/package.py +++ /dev/null @@ -1,145 +0,0 @@ -# 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. -# ---------------------------------------------------------------------------- - -import os - -from spack.package import * - - -class NwchemexSimde(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/SimDE" - url = "https://github.com/NWChemEx/SimDE/archive/refs/tags/v0.0.53.tar.gz" - git = "https://github.com/NWChemEx/SimDE.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/SimDE/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 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "0.0.53", - sha256="c95b818c0151a38190eebdaf41cc19fe04227ec827aef30293f959751a4b0bed", - ) - - variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, - ) - variant("docs", default=False, description="Build documentation") - variant( - "sigma", - default=False, - description="Enable Sigma for uncertainty tracking", - sticky=True, - ) - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # Runtime dependencies - depends_on("cxx", type="build") - depends_on("py-pybind11", when="+pybindings") - # First-party - depends_on("nwchemex-chemist") - depends_on("nwchemex-pluginplay") - - # Test dependencies - depends_on("catch2", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("include", "simde", "simde.hpp"), - join_path("lib", "simde", "cmake", "simdeConfig.cmake"), - join_path("lib", "simde", "cmake", "simdeConfigVersion.cmake"), - join_path("lib", "simde", "cmake", "simde-target.cmake"), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "simde", "libsimde.a"), - # join_path("lib", "simde", "libsimde.so"), - ] - - sanity_check_is_dir = [ - join_path("include", "simde"), - join_path("lib", "simde"), - join_path("lib", "simde", "cmake"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - self.define_from_variant("ENABLE_SIGMA", "sigma"), - self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" - ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), - ] - - if self.spec.satisfies("+pybindings"): - # TODO: Allow the user to configure this - args.append( - "-DNWX_MODULE_DIRECTORY={}".format( - join_path(self.prefix.lib, "simde", "python") - ) - ) - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex-tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/nwchemex-tensorwrapper/package.py deleted file mode 100644 index fc91013..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-tensorwrapper/package.py +++ /dev/null @@ -1,153 +0,0 @@ -# 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-tensorwrapper -# -# You can edit this file again by typing: -# -# spack edit nwchemex-tensorwrapper -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- -import os - -from spack.package import * - - -class NwchemexTensorwrapper(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/TensorWrapper" - url = "https://github.com/NWChemEx/TensorWrapper/archive/refs/tags/v0.0.55.tar.gz" - git = "https://github.com/NWChemEx/TensorWrapper.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/TensorWrapper/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 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "0.0.62", - sha256="a526418836e0fff1362d4ff2c9131ae9eb2d509ae53148ac597f8de8444af9ca", - ) - - variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, - ) - variant( - "sigma", - default=False, - description="Enable Sigma for uncertainty tracking", - sticky=True, - ) - variant("docs", default=False, description="Build documentation") - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # Runtime dependencies - depends_on("cxx", type="build") - depends_on("boost") - depends_on("eigen@master") - depends_on("sigma@main+eigen", when="+sigma") - depends_on("py-pybind11", when="+pybindings") - # First-party - depends_on("nwchemex-utilities") - depends_on("nwchemex-parallelzone") - - # Test dependencies - depends_on("catch2", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("include", "tensorwrapper", "tensorwrapper.hpp"), - join_path( - "lib", "tensorwrapper", "cmake", "tensorwrapperConfig.cmake" - ), - join_path( - "lib", "tensorwrapper", "cmake", "tensorwrapperConfigVersion.cmake" - ), - join_path( - "lib", "tensorwrapper", "cmake", "tensorwrapper-target.cmake" - ), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "tensorwrapper", "libtensorwrapper.a"), - # join_path("lib", "tensorwrapper", "libtensorwrapper.so"), - ] - - sanity_check_is_dir = [ - join_path("include", "tensorwrapper"), - join_path("lib", "tensorwrapper"), - join_path("lib", "tensorwrapper", "cmake"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - self.define_from_variant("ENABLE_SIGMA", "sigma"), - self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" - ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), - ] - - if self.spec.satisfies("+pybindings"): - # TODO: Allow the user to configure this - args.append( - "-DNWX_MODULE_DIRECTORY={}".format( - join_path(self.prefix.lib, "tensorwrapper", "python") - ) - ) - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex-utilities/package.py b/spack_repo/nwchemex/core/packages/nwchemex-utilities/package.py deleted file mode 100644 index ff4baaa..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-utilities/package.py +++ /dev/null @@ -1,119 +0,0 @@ -# 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-utilities -# -# You can edit this file again by typing: -# -# spack edit nwchemex-utilities -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - -import os - -from spack.package import * - - -class NwchemexUtilities(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/Utilities" - url = "https://github.com/NWChemEx/Utilities/archive/refs/tags/v0.1.26.tar.gz" - git = "https://github.com/NWChemEx/Utilities.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/Utilities/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 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "0.1.26", - sha256="508a14609cb6cdbaaa604ada512224ed1bfa3c378d0232c69429a2134c1d1180", - ) - - depends_on("cxx", type="build") - - variant("docs", default=False, description="Build documentation") - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # No runtime dependencies - # depends_on("foo") - - # Test dependencies - depends_on("catch2", type="test", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("lib", "utilities", "cmake", "utilitiesConfig.cmake"), - join_path("lib", "utilities", "cmake", "utilitiesConfigVersion.cmake"), - join_path("lib", "utilities", "cmake", "utilities-target.cmake"), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "utilities", "libutilities.a"), - # join_path("lib", "utilities", "libutilities.so"), - ] - sanity_check_is_dir = [ - join_path("include", "utilities"), - join_path("lib", "utilities"), - join_path("lib", "utilities", "cmake"), - # ZDC: I don't think CMaize's "external/" should be a strict requirement - # since it can be empty, especially with Spack managing most/all deps. - # join_path("lib", "utilities", "external"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - ] - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py new file mode 100644 index 0000000..c366f5c --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -0,0 +1,98 @@ +# 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-chemist +# +# You can edit this file again by typing: +# +# spack edit nwchemex-chemist +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexChemcache(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "ChemCache" + + homepage = f"https://github.com/NWChemEx/{project}" + url = ( + f"https://github.com/NWChemEx/{project}/archive/refs/tags/v1.1.2tar.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") + + pkg.version("generated_data", branch="generated_data") + + # 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 + + # First-party + pkg.depends_on("nwchemex-simde") + + # 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_chemist/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py new file mode 100644 index 0000000..e6e3bb5 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py @@ -0,0 +1,91 @@ +# 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-chemist +# +# You can edit this file again by typing: +# +# spack edit nwchemex-chemist +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexChemist(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "Chemist" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v1.3.18.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.3.19", + sha256="dc1adf754ce9a532ee4b13461aaaf29488a2d6d5f34aaa416a33bd621abb8c29", + ) + + pkg.variant( + "sigma", + default=False, + description="Enable Sigma for uncertainty tracking", + sticky=True, + ) + + # Runtime dependencies + pkg.depends_on("boost") + + # First-party + pkg.depends_on("nwchemex-utilities") + pkg.depends_on("nwchemex-parallelzone") + pkg.depends_on("nwchemex-tensorwrapper") + + # Although we have a variant, technically it is not a direct dependency + # of this package + # pkg.depends_on("sigma+eigen", when="+sigma") + + # 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_SIGMA", "sigma"), + ] + ) + + return args 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..1203f76 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -0,0 +1,93 @@ +# 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-ase") + pkg.depends_on("nwchem") + + # First-party + pkg.depends_on("nwchemex-simde") + + # 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_integrals/package.py b/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py new file mode 100644 index 0000000..161796f --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py @@ -0,0 +1,87 @@ +# 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 NwchemexIntegrals(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "Integrals" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.30.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.30", + sha256="894bec1a6be2ec28302fde9f26f9b2961b43cfe4d15c037005fd266295dd7f3b", + ) + + pkg.variant( + "sigma", + default=False, + description="Enable Sigma for uncertainty tracking", + sticky=True, + ) + + pkg.depends_on("libint") + # 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("nwchemex-simde") + + # 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_SIGMA", "sigma"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py new file mode 100644 index 0000000..bb85011 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py @@ -0,0 +1,84 @@ +# 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 NwchemexNux(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "NUX" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.5.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.5", + 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") + + # 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_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 new file mode 100644 index 0000000..b4e2de4 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py @@ -0,0 +1,107 @@ +# 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, + ) + + # 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") + pkg.depends_on("nwchemex-scf") + pkg.depends_on("nwchemex-nux") + pkg.depends_on("nwchemex-chemcache") + pkg.depends_on("nwchemex-integrals") + + # 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_parallelzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py new file mode 100644 index 0000000..a4a55c1 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py @@ -0,0 +1,88 @@ +# 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-parallelzone +# +# You can edit this file again by typing: +# +# spack edit nwchemex-parallelzone +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack.package import depends_on, license, maintainers, variant, version +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexParallelzone(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "ParallelZone" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.1.34.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 + + maintainers("ryanmrichard", "jwaldrop107", "zachcran") + license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + version( + "0.1.34", + sha256="ca47108832ddefc600c9b4782bbe0faf89da403a4cdac5b379f508be39ece934", + ) + + variant( + "papi", + default=False, + description="Enable PAPI bindings", + ) + # variant( + # "cuda", + # default=False, + # description="Enable CUDA bindings", + # ) + # variant( + # "hip", + # default=False, + # description="Enable HIP bindings", + # ) + # variant( + # "sycl", + # default=False, + # description="Enable SYCL bindings", + # ) + + # Runtime dependencies + depends_on("mpi") + depends_on("spdlog") + depends_on("cereal@1.3.0") # v1.3.1 changed the installed target... + depends_on("papi", when="+papi") + + # 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 diff --git a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py new file mode 100644 index 0000000..f8c5006 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py @@ -0,0 +1,86 @@ +# 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-pluginplay +# +# You can edit this file again by typing: +# +# spack edit nwchemex-pluginplay +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexPluginplay(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "PluginPlay" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v1.0.43.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.46", + sha256="22303b38ac6e2459b50a9074697a59fbd01422cdb7db98599f81255f43176597", + ) + + pkg.variant( + "rocksdb", + default=False, + description="Enable RocksDB backend of the cache", + ) + + # Runtime dependencies + pkg.depends_on("boost") + pkg.depends_on("libfort enable_testing=false") + pkg.depends_on("rocksdb", when="+rocksdb") + # First-party + pkg.depends_on("nwchemex-utilities") + pkg.depends_on("nwchemex-parallelzone") + + # 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("BUILD_ROCKSDB", "rocksdb"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py new file mode 100644 index 0000000..e321aea --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -0,0 +1,103 @@ +# 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 NwchemexScf(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "SCF" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.23.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.23", + sha256="b175c15e8c814cd288817c970f4e049c7eab248975ff7c891d8927d7555d0cd8", + ) + + # 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( + "experimental", + default=False, + description="Enable experimental features", + 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-simde") + + # 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_simde/package.py b/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py new file mode 100644 index 0000000..809253b --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py @@ -0,0 +1,85 @@ +# 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 NwchemexSimde(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "SimDE" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.53.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.53", + sha256="c95b818c0151a38190eebdaf41cc19fe04227ec827aef30293f959751a4b0bed", + ) + + pkg.variant( + "sigma", + default=False, + description="Enable Sigma for uncertainty tracking", + sticky=True, + ) + + # First-party + pkg.depends_on("nwchemex-chemist") + pkg.depends_on("nwchemex-pluginplay") + + pkg.depends_on("sigma+eigen", when="+sigma") + + # 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_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 new file mode 100644 index 0000000..b2edd31 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py @@ -0,0 +1,89 @@ +# 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-tensorwrapper +# +# You can edit this file again by typing: +# +# spack edit nwchemex-tensorwrapper +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexTensorwrapper(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "TensorWrapper" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.55.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.62", + sha256="a526418836e0fff1362d4ff2c9131ae9eb2d509ae53148ac597f8de8444af9ca", + ) + + pkg.variant( + "sigma", + default=False, + description="Enable Sigma for uncertainty tracking", + sticky=True, + ) + + # Runtime dependencies + pkg.depends_on("boost") + pkg.depends_on("eigen") + pkg.depends_on("sigma+eigen", when="+sigma") + + # First-party + pkg.depends_on("nwchemex-utilities") + pkg.depends_on("nwchemex-parallelzone") + + # 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_SIGMA", "sigma"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_utilities/package.py b/spack_repo/nwchemex/core/packages/nwchemex_utilities/package.py new file mode 100644 index 0000000..aa21cb0 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_utilities/package.py @@ -0,0 +1,61 @@ +# 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-utilities +# +# You can edit this file again by typing: +# +# spack edit nwchemex-utilities +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg +from spack_repo.nwchemex.common.mixins import NWChemExBaseCXX + + +class NwchemexUtilities(NWChemExBaseCXX): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "Utilities" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.1.26.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.1.26", + sha256="508a14609cb6cdbaaa604ada512224ed1bfa3c378d0232c69429a2134c1d1180", + ) + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBaseCXX.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBaseCXX.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed From fab6c94f2b99a56ffd52cad3d8eccde90f62d76f Mon Sep 17 00:00:00 2001 From: zachcran Date: Mon, 14 Jul 2025 13:15:22 -0600 Subject: [PATCH 02/19] Note seemingly undocumented repo update command --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index a60d5a6..ee1718d 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,11 @@ git pull git checkout ``` +NOTE: Spack may have an undocumented update command now. The following worked for me with Spack `1.0.0.dev0 (b63f793f74c672eaf4768b7a5a711c83882bbebd)`: +```bash +spack repo update +``` + ### Spack <1.0.0 Updating with Spack <1.0.0 is approximately the same as >=1.0.0, and must be done by manually updating the cloned GitHub repository. The following commands will update *all* `nwchemex.*` sub-repos at once. You do not need to run this separately for each `nwchemex.*` sub-repo! From f67acbd474f4c8ee4cdae4d01d1a7a0945228886 Mon Sep 17 00:00:00 2001 From: zachcran Date: Mon, 14 Jul 2025 14:01:08 -0600 Subject: [PATCH 03/19] Pin libint to be >=2.1.0 --- spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py b/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py index 161796f..71ef89d 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py @@ -58,7 +58,7 @@ class NwchemexIntegrals(NWChemExBasePybindings): sticky=True, ) - pkg.depends_on("libint") + pkg.depends_on("libint@2.1.0:") # Although we have a variant, technically it is not a direct dependency # of this package # pkg.depends_on("sigma+eigen", when="+sigma") From 6c08568f353a1f0129a0bcfd9fb5fe897f37fe19 Mon Sep 17 00:00:00 2001 From: zachcran Date: Mon, 14 Jul 2025 16:05:38 -0600 Subject: [PATCH 04/19] Remove NWXCMake fetchcontent location --- spack_repo/nwchemex/common/mixins/nwchemex.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index a2e1261..37abf1a 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -61,14 +61,6 @@ def cmake_args(self): # Added in 3.28; OLD is deprecated now 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", - ) - ) - return args From d4ac1e1ba1bbd6d1f725e6d39b4bf87397e0d003 Mon Sep 17 00:00:00 2001 From: zachcran Date: Mon, 14 Jul 2025 16:06:31 -0600 Subject: [PATCH 05/19] Add permanent cxxstd of 17 and variant attempt that is broken in the current Spack version --- spack_repo/nwchemex/common/mixins/nwchemex.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 37abf1a..a5af304 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -29,6 +29,15 @@ class NWChemExBaseCXX(NWChemExBaseGit, CMaizePackage): sticky=True, ) + # TODO: Not working as of spack 1.0.0.dev0 (e8a72d97b5b463a711a2e5c758ebbf3cef54d851) + # pkg.variant( + # "cxxstd", + # default="17", + # values=["17"], + # multi=False, + # description="Use the specified C++ standard when building", + # ) + pkg.depends_on("cxx", type="build") # Test dependencies @@ -44,6 +53,10 @@ def cmake_args(self): ), self.define_from_variant("BUILD_SHARED_LIBS", "shared"), self.define_from_variant("BUILD_DOCS", "docs"), + # TODO: Not working as of spack 1.0.0.dev0 + # (e8a72d97b5b463a711a2e5c758ebbf3cef54d851) + # self.define("CMAKE_CXX_STANDARD", "cxxstd"), + self.define("CMAKE_CXX_STANDARD", "17"), self.define("BUILD_TESTING", self.run_tests), ] ) From e258933c6c4fe0d1bd88d32c7eaccff233cbfb6b Mon Sep 17 00:00:00 2001 From: zachcran Date: Mon, 14 Jul 2025 16:22:24 -0600 Subject: [PATCH 06/19] Add catch2 as a build dependency in addition to the test type --- 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 a5af304..c55401f 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -41,7 +41,7 @@ class NWChemExBaseCXX(NWChemExBaseGit, CMaizePackage): pkg.depends_on("cxx", type="build") # Test dependencies - pkg.depends_on("catch2", type="test") + pkg.depends_on("catch2", type=("build", "test")) def cmake_args(self): args = super().cmake_args() From 7d06b14ef92b58482cf9c349e8cf6f48cfe42f0c Mon Sep 17 00:00:00 2001 From: zachcran Date: Mon, 14 Jul 2025 16:24:30 -0600 Subject: [PATCH 07/19] Now the variant works properly? Idk --- spack_repo/nwchemex/common/mixins/nwchemex.py | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index c55401f..7aff10e 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -29,14 +29,15 @@ class NWChemExBaseCXX(NWChemExBaseGit, CMaizePackage): sticky=True, ) - # TODO: Not working as of spack 1.0.0.dev0 (e8a72d97b5b463a711a2e5c758ebbf3cef54d851) - # pkg.variant( - # "cxxstd", - # default="17", - # values=["17"], - # multi=False, - # description="Use the specified C++ standard when building", - # ) + 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", + ) pkg.depends_on("cxx", type="build") @@ -53,10 +54,7 @@ def cmake_args(self): ), self.define_from_variant("BUILD_SHARED_LIBS", "shared"), self.define_from_variant("BUILD_DOCS", "docs"), - # TODO: Not working as of spack 1.0.0.dev0 - # (e8a72d97b5b463a711a2e5c758ebbf3cef54d851) - # self.define("CMAKE_CXX_STANDARD", "cxxstd"), - self.define("CMAKE_CXX_STANDARD", "17"), + self.define_from_variant("CMAKE_CXX_STANDARD", "cxxstd"), self.define("BUILD_TESTING", self.run_tests), ] ) From ce96cbaea2ffce511d805f79ce99ed7a77907826 Mon Sep 17 00:00:00 2001 From: zachcran Date: Mon, 14 Jul 2025 17:04:23 -0600 Subject: [PATCH 08/19] Fix python module install directory project name not being lowercased --- 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 7aff10e..e6120f2 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -102,7 +102,7 @@ def cmake_args(self): # TODO: Allow the user to configure this? args.append( "-DNWX_MODULE_DIRECTORY={}".format( - self.prefix.lib.join(self.project).join("python") + self.prefix.lib.join(self.project.lower()).join("python") ) ) From 320ce963d3e809c1a76c6e31e948020ae8d9d2ba Mon Sep 17 00:00:00 2001 From: zachcran Date: Tue, 22 Jul 2025 12:34:07 -0600 Subject: [PATCH 09/19] Use proper definitions for cmake flags --- spack_repo/nwchemex/common/mixins/nwchemex.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index e6120f2..ac70995 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -99,11 +99,18 @@ def cmake_args(self): ) if self.spec.satisfies("+pybindings"): - # TODO: Allow the user to configure this? - args.append( - "-DNWX_MODULE_DIRECTORY={}".format( - self.prefix.lib.join(self.project.lower()).join("python") + if "NWX_MODULE_DIRECTORY" in os.environ: + args.append( + self.define( + "NWX_MODULE_DIRECTORY", + os.environ["NWX_MODULE_DIRECTORY"], + ) ) - ) + # TODO: Allow the user to configure this? + # args.append( + # "-DNWX_MODULE_DIRECTORY={}".format( + # self.prefix.lib.join(self.project.lower()).join("python") + # ) + # ) return args From 98b0109ee17b4a821fb8a06d0779b45392292170 Mon Sep 17 00:00:00 2001 From: zachcran Date: Tue, 22 Jul 2025 12:34:35 -0600 Subject: [PATCH 10/19] Add temporary debug flags --- spack_repo/nwchemex/common/mixins/nwchemex.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index ac70995..9bb6f50 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -72,6 +72,20 @@ def cmake_args(self): # Added in 3.28; OLD is deprecated now 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", + True, + ) + ) + return args From 9b9c4db6d4b3bd190b6e4adc3b1a85ab53ebfa65 Mon Sep 17 00:00:00 2001 From: zachcran Date: Tue, 22 Jul 2025 12:35:03 -0600 Subject: [PATCH 11/19] Make CXX standard sticky --- spack_repo/nwchemex/common/mixins/nwchemex.py | 1 + 1 file changed, 1 insertion(+) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 9bb6f50..805fe33 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -37,6 +37,7 @@ class NWChemExBaseCXX(NWChemExBaseGit, CMaizePackage): values=("17",), multi=False, description="Use the specified C++ standard when building", + sticky=True, ) pkg.depends_on("cxx", type="build") From 42c7bc6a626299a514ba501634e0b1ee470a6d4e Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:12:21 -0600 Subject: [PATCH 12/19] Fix scf package to work by adding sigma variant and libint version constraints --- .../core/packages/nwchemex_scf/package.py | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py index e321aea..9ae188c 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -21,7 +21,6 @@ # ---------------------------------------------------------------------------- from spack import package as pkg - from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings @@ -52,13 +51,12 @@ class NwchemexScf(NWChemExBasePybindings): sha256="b175c15e8c814cd288817c970f4e049c7eab248975ff7c891d8927d7555d0cd8", ) - # TODO: Should this still be here for SimDE propagation? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) + pkg.variant( + "sigma", + default=False, + description="Enable Sigma for uncertainty tracking", + sticky=True, + ) # TODO: Handle this turned on pkg.variant( "tamm", @@ -72,13 +70,21 @@ class NwchemexScf(NWChemExBasePybindings): sticky=False, ) + # For building GauXC, I think + pkg.depends_on("c", type="build") + # TODO: Create this package # pkg.depends_on("gauxc") pkg.depends_on("eigen") - pkg.depends_on("libint", when="+tamm") + pkg.depends_on("libint@2.6:", when="+tamm") + pkg.depends_on("mpi") # 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("nwchemex-simde") @@ -95,9 +101,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_from_variant("ENABLE_SIGMA", "sigma"), + ] ) return args From 1c3ae4c2bba9069d81153145547b8a6c9be58704 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:13:38 -0600 Subject: [PATCH 13/19] Add explanation for libint version constraint --- spack_repo/nwchemex/core/packages/nwchemex_scf/package.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py index 9ae188c..5c167c5 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -76,6 +76,9 @@ class NwchemexScf(NWChemExBasePybindings): # 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("tamm", when="+tamm") From 47ddb78e6f9fcdd9e6d9a8de0984eb062215d342 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:14:11 -0600 Subject: [PATCH 14/19] Update libint version constraint --- .../nwchemex/core/packages/nwchemex_integrals/package.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py b/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py index 71ef89d..295ce03 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py @@ -58,7 +58,10 @@ class NwchemexIntegrals(NWChemExBasePybindings): sticky=True, ) - pkg.depends_on("libint@2.1.0:") + # 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:") # Although we have a variant, technically it is not a direct dependency # of this package # pkg.depends_on("sigma+eigen", when="+sigma") From 9dce5255d3bee5a1155aea3153608ced10435e29 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:15:20 -0600 Subject: [PATCH 15/19] Reorder dependencies and fix formatting --- .../nwchemex/core/packages/nwchemex_tensorwrapper/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py index b2edd31..43c8bd4 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py @@ -21,7 +21,6 @@ # ---------------------------------------------------------------------------- from spack import package as pkg - from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings @@ -62,12 +61,13 @@ class NwchemexTensorwrapper(NWChemExBasePybindings): # Runtime dependencies pkg.depends_on("boost") pkg.depends_on("eigen") - pkg.depends_on("sigma+eigen", when="+sigma") # First-party pkg.depends_on("nwchemex-utilities") pkg.depends_on("nwchemex-parallelzone") + pkg.depends_on("sigma+eigen", when="+sigma") + # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( project.lower() From 278bb1839b13022b5379c99f196b3288cad4e4a0 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:16:36 -0600 Subject: [PATCH 16/19] Formatting and import fixes --- spack_repo/nwchemex/common/mixins/cmaize.py | 1 - spack_repo/nwchemex/common/mixins/nwchemex.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/cmaize.py b/spack_repo/nwchemex/common/mixins/cmaize.py index be829c0..087127c 100644 --- a/spack_repo/nwchemex/common/mixins/cmaize.py +++ b/spack_repo/nwchemex/common/mixins/cmaize.py @@ -1,5 +1,4 @@ from spack.package import join_path -from spack.package_base import PackageBase from spack_repo.builtin.build_systems.cmake import CMakePackage diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 805fe33..264d96b 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -3,7 +3,7 @@ from spack import package as pkg from spack.package_base import PackageBase -from . import CMaizePackage +from .cmaize import CMaizePackage class NWChemExBaseGit(PackageBase): From 5a3f082f4574afcddc2f4c8271603ba9d37a12c4 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 12 Aug 2025 09:46:55 -0600 Subject: [PATCH 17/19] Remove hard-coded FETCHCONTENT_SOURCE_DIR debug path --- spack_repo/nwchemex/common/mixins/nwchemex.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 264d96b..f9f41ea 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -74,12 +74,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 e741d9be796448a82681e709c775c74ca2ad32a9 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Fri, 3 Oct 2025 11:28:17 -0500 Subject: [PATCH 18/19] SCF: add numpy dependency to satisfy gau2grid build --- spack_repo/nwchemex/core/packages/nwchemex_scf/package.py | 1 + 1 file changed, 1 insertion(+) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py index 5c167c5..ce7b1b9 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -81,6 +81,7 @@ class NwchemexScf(NWChemExBasePybindings): # 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("tamm", when="+tamm") # pkg.depends_on("exachem", when="+tamm") From 3df4ffd589d82ea1da6857af59e2c111141c29a7 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 7 Oct 2025 13:09:11 -0600 Subject: [PATCH 19/19] Add link to information for developing packages in a spack environment --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ee1718d..4b8c288 100644 --- a/README.md +++ b/README.md @@ -113,3 +113,7 @@ For more information, see the Spack's [Search Order and Overriding Packages](htt ## Helpful Spack Commands For a broader list of helpful Spack repository management commands, see Spack's [The `spack repo` Command](https://spack.readthedocs.io/en/latest/repositories.html#the-spack-repo-command). + +### Developing Packages in a Spack Environment + +https://spack.readthedocs.io/en/latest/environments.html#developing-packages-in-a-spack-environment