diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml new file mode 100644 index 0000000..ddf36d2 --- /dev/null +++ b/.github/workflows/merge.yaml @@ -0,0 +1,33 @@ +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: Merge Workflow + +on: + push: + branches: + - master + +jobs: + tag-commit: + uses: NWChemEx/.github/.github/workflows/tag.yaml@master + secrets: inherit + + # deploy_nwx_docs: + # uses: NWChemEx/.github/.github/workflows/deploy_nwx_docs.yaml@master + # with: + # doc_target: "friendzone_cxx_api" + # generate_module_docs: true + # secrets: inherit diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 0000000..b0ed610 --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -0,0 +1,35 @@ +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: Pull Request Workflow + +on: + pull_request: + branches: + - master + +jobs: + check_formatting: + uses: NWChemEx/.github/.github/workflows/check_formatting.yaml@master + + # test_nwx_docs: + # uses: NWChemEx/.github/.github/workflows/test_nwx_docs.yaml@master + # with: + # doc_target: "friendzone_cxx_api" + + # test_library: + # uses: NWChemEx/.github/.github/workflows/test_nwx_library.yaml@master + # with: + # compilers: '["gcc-14", "clang-18"]' diff --git a/.gitignore b/.gitignore index b7faf40..40d7a79 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Byte-compiled / optimized / DLL files __pycache__/ *.py[codz] @@ -182,9 +196,9 @@ cython_debug/ .abstra/ # Visual Studio Code -# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore +# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore -# and can be added to the global gitignore or merged into this file. However, if you prefer, +# and can be added to the global gitignore or merged into this file. However, if you prefer, # you could uncomment the following to ignore the entire vscode folder # .vscode/ diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 0000000..c274745 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,29 @@ +# Copyright 2021 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +header: + license: + spdx-id: Apache-2.0 + copyright-owner: NWChemEx-Project + + paths-ignore: + - .github/ + - docs/Makefile + - docs/requirements.txt + - cmake/generate_module_docs.cpp.in + - LICENSE + - version.txt + - build/ + + comment: never diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f433b1a --- /dev/null +++ b/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/README.md b/README.md index 4b8c288..1ef5531 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,19 @@ + + # NWChemEx Spack Package Repositories **WARNING:** Under heavy construction and subject to change at any moment. Not ready for use yet! @@ -74,6 +90,11 @@ This GitHub repository provides various package repositories for the NWChemEx pr ``` spack_repo └── nwchemex + ├── common + │ ├── mixins + │ │ └── ... + │ ├── ... + │ └── repo.yaml ├── core │ ├── packages │ │ ├── package_1 @@ -94,6 +115,10 @@ In Spack, package repositories are namespaced as `nwchemex.` and Packages can be distinguished by prefixing the package name with the package repository namespace it is defined in (e.g. `nwchemex.repo_a.package_1`). This is useful to determine from which repository a package originated, like to confirm that you are using the correct override of a package. However, in general, namespaces are not needed when identifying a package in a package specification and should be avoided. Spack actually strongly discourages using explicit namespacing in `depends_on()` statements of packages, as "It makes the package non-portable and tightly coupled to a specific repository configuration, hindering sharing and composition of repositories." (see warning at the bottom of Spack's [Search Order and Overriding Packages](https://spack.readthedocs.io/en/latest/repositories.html#search-order-and-overriding-packages)). +### `nwchemex.common` + +Spack package repository for common components used to build up NWChemEx Spack packages, like various mixin classes composing the package classes. + ### `nwchemex.core` Spack package repository for core (first-party) packages in the NWChemEx software stack. @@ -110,6 +135,28 @@ spack config edit repos For more information, see the Spack's [Search Order and Overriding Packages](https://spack.readthedocs.io/en/latest/repositories.html#search-order-and-overriding-packages). +## Development/Testing + +- Set up the environment + 1. `spack env create nwchemex-stack` + 2. `spack env activate nwchemex-stack` + 3. `spack config edit` + 4. Paste the contents of `nwchemex-stack.yaml` + 5. Check for TODOs in the file +- Concretize the environment packages: `spack concretize` +- Build the packages + - For most packages: `spack install --test=root --fail-fast --verbose --only-concrete ` + - For FriendZone and NWChemEx, exclude `--test=root`: `spack install --fail-fast --verbose --only-concrete ` + +### Tips + +- Run `spack clean` as necessary after failed builds/installs. + - Make sure to clear the Python cache as well for odd import errors: `spack clean -p`. +- If changing the environment package matrices or `package.py` files, you likely need to uninstall any dependant packages from the NWChemEx stack, reconcretize all packages, and build up the stack again. + - `spack uninstall --all ` + - `spack deconcretize` + - `spack concretize --force` + ## 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). diff --git a/nwchemex-stack.yaml b/nwchemex-stack.yaml new file mode 100644 index 0000000..c7eb927 --- /dev/null +++ b/nwchemex-stack.yaml @@ -0,0 +1,153 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NWChemEx stack Spack Environment file. +# +# It describes the combinatorial build of the NWChemEx stack. +spack: + + # General definitions for various flags and options used in the + # combinatorial builds + definitions: + - shared: [+shared] + - pybindings: [+python, ~python] + - sigmas: [+sigma, ~sigma] + # Eigen version that actually works for all builds + - eigens: [eigen@git.2e76277bd049f7bec36b0f908c69734a42c5234f=master] + - eigenflags: [+eigen ^eigen@git.2e76277bd049f7bec36b0f908c69734a42c5234f=master, ~eigen] + - common_deps: [catch2@3.8.0] + - libint_tuning: [tune=cp2k-lmax-4] + + # Compiler toolchains for baseline build testing. + # + # See https://spack.readthedocs.io/en/latest/advanced_topics.html#defining-and-using-toolchains + toolchains: + # Force using only gcc@ for C, CXX, and Fortran + gcc14_all: + - spec: '%c=gcc@14' + when: '%c' + - spec: '%cxx=gcc@14' + when: '%cxx' + - spec: '%fortran=gcc@14' + when: '%fortran' + + # Force using only llvm@ for C, CXX, and Fortran + llvm21_all: + - spec: '%c=llvm@21' + when: '%c' + - spec: '%cxx=llvm@21' + when: '%cxx' + - spec: '%fortran=llvm@21' + when: '%fortran' + + # Definition of NWChemEx stack package combinations + specs: + # libint pinning to try to ensure that packages all use the same version + - matrix: + - ['libint@2.6:'] + - [$libint_tuning] + - ['%gcc14_all'] + - matrix: + - [sigma] + - ['@main'] + - ['%gcc14_all'] + - [$eigenflags] + - matrix: + - [utilities] + - ['@master'] + - [$shared] + - ['%gcc14_all'] + - [$^common_deps] + - matrix: + - [parallelzone, pluginplay] + - ['@master'] + - [$shared] + - [$pybindings] + - ['%gcc14_all'] + - [$^common_deps] + - matrix: + - [tensorwrapper] + - ['@master'] + - [$shared] + - [$pybindings] + - [$sigmas] + - ['%gcc14_all'] + - [$^eigens] + - [$^common_deps] + - matrix: + - [chemist, simde, integrals] + - ['@master'] + - [$shared] + - [$pybindings] + - [$sigmas] + - ['%gcc14_all'] + - [$^eigens] + - [$^common_deps] + - matrix: + - [scf] + - ['@master'] + - [$shared] + - [$pybindings] + - ['%gcc14_all'] + - [$^eigens] + - [$^common_deps] + - matrix: + - [chemcache] + - ['@master'] + - [$shared] + - [$pybindings] + - ['%gcc14_all'] + - [$^common_deps] + - matrix: + - [nux] + - ['@master'] + - [$shared] + - [$pybindings] + - ['%gcc14_all'] + - [$^common_deps] + - matrix: + - [friendzone] + - ['@master'] + - [friends=none, 'friends=nwchem,ase'] + - ['%gcc14_all'] + - matrix: + - [nwchemex] + - ['@master'] + - ['%gcc14_all'] + # TODO: Uncomment and provide toolchain path if needed + # env_vars: + # set: + # # Recommended way to set toolchain file for nwchemex.* packages + # CMAKE_TOOLCHAIN_FILE: //toolchain.cmake + view: false + concretizer: + unify: when_possible + # TODO: Uncomment and provide alternative tmp path if needed + # config: + # # Give the tmp directory more room if your /tmp partition is not large + # # enough for 10+ GB compiler builds + # build_stage: ///tmpdir + packages: + gcc: + externals: [] + llvm: + externals: [] + # Likely set by `spack repo add` commands (see README.md) + # repos: + # nwchemex: + # git: https://github.com/NWChemEx/SpackRepos.git + # destination: //nwchemex + # qcuncertainty: + # git: https://github.com/QCUncertainty/spack-repo.git + # destination: //qcuncertainty diff --git a/spack-repo-index.yaml b/spack-repo-index.yaml index 6cd40b9..f8995e2 100644 --- a/spack-repo-index.yaml +++ b/spack-repo-index.yaml @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Used by Spack v1.0.0 to automatically add Spack repos from GitHub # For more info, see https://spack.readthedocs.io/en/latest/repositories.html#git-based-repositories diff --git a/spack_repo/nwchemex/common/README.md b/spack_repo/nwchemex/common/README.md index d9ce4fa..b4dfc50 100644 --- a/spack_repo/nwchemex/common/README.md +++ b/spack_repo/nwchemex/common/README.md @@ -1,3 +1,19 @@ + + # 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. diff --git a/spack_repo/nwchemex/common/mixins/__init__.py b/spack_repo/nwchemex/common/mixins/__init__.py index 63c84d2..68546e4 100644 --- a/spack_repo/nwchemex/common/mixins/__init__.py +++ b/spack_repo/nwchemex/common/mixins/__init__.py @@ -1,4 +1,27 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .cmaize import CMaizePackage -from .nwchemex import NWChemExBaseCXX, NWChemExBasePybindings +from .nwchemex import ( + NWChemExBaseCXX, + NWChemExBasePybindings, + NWChemExBasePython, +) -__all__ = ["CMaizePackage", "NWChemExBaseCXX", "NWChemExBasePybindings"] +__all__ = [ + "CMaizePackage", + "NWChemExBaseCXX", + "NWChemExBasePybindings", + "NWChemExBasePython", +] diff --git a/spack_repo/nwchemex/common/mixins/cmaize.py b/spack_repo/nwchemex/common/mixins/cmaize.py index 087127c..cf32855 100644 --- a/spack_repo/nwchemex/common/mixins/cmaize.py +++ b/spack_repo/nwchemex/common/mixins/cmaize.py @@ -1,9 +1,22 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack.package import join_path 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 diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index f9f41ea..b3ba070 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -1,13 +1,27 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os from spack import package as pkg from spack.package_base import PackageBase +from spack_repo.builtin.build_systems.python import PythonPackage from .cmaize import CMaizePackage 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 @@ -20,7 +34,6 @@ class NWChemExBaseGit(PackageBase): class NWChemExBaseCXX(NWChemExBaseGit, CMaizePackage): - pkg.variant("docs", default=False, description="Build documentation") pkg.variant( "shared", @@ -29,17 +42,6 @@ class NWChemExBaseCXX(NWChemExBaseGit, CMaizePackage): sticky=True, ) - pkg.variant( - "cxxstd", - default="17", - # NOTE: Comma after "17" is necessary so Spack doesn't split it into - # individual characters - values=("17",), - multi=False, - description="Use the specified C++ standard when building", - sticky=True, - ) - pkg.depends_on("cxx", type="build") # Test dependencies @@ -55,14 +57,13 @@ def cmake_args(self): ), self.define_from_variant("BUILD_SHARED_LIBS", "shared"), self.define_from_variant("BUILD_DOCS", "docs"), - self.define_from_variant("CMAKE_CXX_STANDARD", "cxxstd"), self.define("BUILD_TESTING", self.run_tests), ] ) if "CMAKE_TOOLCHAIN_FILE" in os.environ: args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" + f"-DCMAKE_TOOLCHAIN_FILE={os.environ['CMAKE_TOOLCHAIN_FILE']}" ) # TODO: +debug flag? +verbose flag? args.append(self.define("CMAKE_MESSAGE_LOG_LEVEL", "DEBUG")) @@ -73,27 +74,29 @@ 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( - "CMAKE_VERBOSE_MAKEFILE", - True, - ) - ) - return args class NWChemExBasePybindings(NWChemExBaseCXX): - pkg.variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, + "python", + default=True, + description="Build the Python bindings", + # sticky=True, ) - pkg.depends_on("py-pybind11", when="+pybindings") + # https://spack.readthedocs.io/en/latest/build_systems/pythonpackage.html#extends-vs-depends-on + pkg.extends("python", when="+python") + pkg.depends_on( + "py-pybind11@3:", + type=("build", "link", "run", "test"), + when="+python", + ) + pkg.depends_on( + "python@3:", + type=("build", "link", "run", "test"), + when="+python", + ) def cmake_args(self): args = super().cmake_args() @@ -101,25 +104,25 @@ def cmake_args(self): args.extend( [ self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" + "BUILD_PYBIND11_PYBINDINGS", "python" ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), + self.define_from_variant("PYBIND11_FINDPYTHON", "python"), ] ) - if self.spec.satisfies("+pybindings"): - if "NWX_MODULE_DIRECTORY" in os.environ: - args.append( - self.define( - "NWX_MODULE_DIRECTORY", - os.environ["NWX_MODULE_DIRECTORY"], - ) + if self.spec.satisfies("+python"): + args.append( + self.define( + "NWX_MODULE_DIRECTORY", + # lib64 is used for platlib from Python package + self.prefix.lib.join( + "python{}".format(self.spec["python"].version[:-1]) + ).join("site-packages"), ) - # TODO: Allow the user to configure this? - # args.append( - # "-DNWX_MODULE_DIRECTORY={}".format( - # self.prefix.lib.join(self.project.lower()).join("python") - # ) - # ) + ) return args + + +class NWChemExBasePython(NWChemExBaseGit, PythonPackage): + pass diff --git a/spack_repo/nwchemex/common/repo.yaml b/spack_repo/nwchemex/common/repo.yaml index 18876d1..ce57642 100644 --- a/spack_repo/nwchemex/common/repo.yaml +++ b/spack_repo/nwchemex/common/repo.yaml @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # For more information on Spack package repositories, see # https://spack.readthedocs.io/en/latest/repositories.html diff --git a/spack_repo/nwchemex/core/packages/README.md b/spack_repo/nwchemex/core/packages/README.md index 1bfd61b..0756ffb 100644 --- a/spack_repo/nwchemex/core/packages/README.md +++ b/spack_repo/nwchemex/core/packages/README.md @@ -1,3 +1,19 @@ + + # nwchemex.core Spack package repository for core (first-party) packages in the NWChemEx software stack. diff --git a/spack_repo/nwchemex/core/packages/chemcache/package.py b/spack_repo/nwchemex/core/packages/chemcache/package.py new file mode 100644 index 0000000..a968e27 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/chemcache/package.py @@ -0,0 +1,74 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class Chemcache(NWChemExBasePybindings): + """Basis sets, physical constants, geometries, basically any data you can + just look up. + """ + + 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", preferred=True) + + # Versions from git tags + pkg.version( + "1.1.2", + sha256="5efb2a60d75aaa57e08e8b2a0b84a24e502083fa5bacae416406ec59bd2839b8", + ) + + pkg.depends_on("py-requests@2.16:") + + # First-party + pkg.depends_on( + "simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "simde~python", + type=("build", "link", "run"), + when="~python", + ) + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py b/spack_repo/nwchemex/core/packages/chemist/package.py similarity index 59% rename from spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py rename to spack_repo/nwchemex/core/packages/chemist/package.py index e6e3bb5..5cd613c 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py +++ b/spack_repo/nwchemex/core/packages/chemist/package.py @@ -1,31 +1,27 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2026 NWChemEx-Project # -# 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 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# You can edit this file again by typing: +# http://www.apache.org/licenses/LICENSE-2.0 # -# spack edit nwchemex-chemist -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. 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.""" +class Chemist(NWChemExBasePybindings): + """Chemist provides chemistry-related data structures. This includes data + structures for chemistry concepts including atoms, molecules, and + atomic-orbital basis sets. + """ project = "Chemist" @@ -62,9 +58,28 @@ class NwchemexChemist(NWChemExBasePybindings): pkg.depends_on("boost") # First-party - pkg.depends_on("nwchemex-utilities") - pkg.depends_on("nwchemex-parallelzone") - pkg.depends_on("nwchemex-tensorwrapper") + pkg.depends_on("utilities") + pkg.depends_on( + "parallelzone+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "parallelzone~python", + type=("build", "link", "run"), + when="~python", + ) + + pkg.depends_on( + "tensorwrapper+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "tensorwrapper~python", + type=("build", "link", "run"), + when="~python", + ) # Although we have a variant, technically it is not a direct dependency # of this package diff --git a/spack_repo/nwchemex/core/packages/friendzone/package.py b/spack_repo/nwchemex/core/packages/friendzone/package.py new file mode 100644 index 0000000..2961a40 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/friendzone/package.py @@ -0,0 +1,92 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePython + + +class Friendzone(NWChemExBasePython): + """Provides SimDE-compatible APIs so that NWChemEx can play nicely with its + friends. + """ + + 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.14", + sha256="b504cb1f20ed5839a1fc926650b2f4114b8ff985f2295f81980e05281c74d652", + ) + + pkg.variant( + "friends", + values=pkg.any_combination_of("molssi", "ase", "nwchem"), + # pkg.any_combination_of() automatically adds a "none" option and sets + # the following two options + # default="none", + # multi=True, + description=( + "Which friends to include. For multiple friends, use a " + "comma-separated list " + "(e.g. `spack install friendzone friends=molssi,ase`)" + ), + ) + + # TODO: Many of these may be able to be switched to ("build", "run") + # instead of ("build", "link", "run") + pkg.depends_on("python@3.10:", type=("build", "run")) + pkg.depends_on("py-pip", type=("build", "link")) + pkg.depends_on("py-setuptools", type="build") + pkg.depends_on("py-pydantic", type=("build", "link", "run")) + with pkg.when("friends=molssi"): + pkg.depends_on("py-networkx~default", type=("build", "link", "run")) + pkg.depends_on("py-qcelemental", type=("build", "link", "run")) + pkg.depends_on("py-qcengine", type=("build", "link", "run")) + with pkg.when("friends=nwchem"): + pkg.depends_on("nwchem", type=("build", "link", "run")) + with pkg.when("friends=ase"): + pkg.depends_on("py-ase", type=("build", "link", "run")) + + # First-party + pkg.depends_on( + "simde+python", + type=("build", "link", "run"), + ) + + # TODO: Add sanity checks + # 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_integrals/package.py b/spack_repo/nwchemex/core/packages/integrals/package.py similarity index 67% rename from spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py rename to spack_repo/nwchemex/core/packages/integrals/package.py index 295ce03..4bcd69f 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py +++ b/spack_repo/nwchemex/core/packages/integrals/package.py @@ -1,31 +1,24 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2026 NWChemEx-Project # -# 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: +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# spack edit nwchemex-simde +# http://www.apache.org/licenses/LICENSE-2.0 # -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. 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.""" +class Integrals(NWChemExBasePybindings): + """Generic integral API and implementations for specific integral libraries.""" project = "Integrals" @@ -67,7 +60,16 @@ class NwchemexIntegrals(NWChemExBasePybindings): # pkg.depends_on("sigma+eigen", when="+sigma") # First-party - pkg.depends_on("nwchemex-simde") + pkg.depends_on( + "simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "simde~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( diff --git a/spack_repo/nwchemex/core/packages/nux/package.py b/spack_repo/nwchemex/core/packages/nux/package.py new file mode 100644 index 0000000..4a73d92 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nux/package.py @@ -0,0 +1,68 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class Nux(NWChemExBasePybindings): + """NWChemEx User Experience (NUX): Tools, functions, etc. to facilitate + user workflows. + """ + + 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", + ) + + # First-party + pkg.depends_on( + "simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "simde~python", + type=("build", "link", "run"), + when="~python", + ) + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed diff --git a/spack_repo/nwchemex/core/packages/nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex/package.py new file mode 100644 index 0000000..aa51a6c --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex/package.py @@ -0,0 +1,85 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePython + + +class Nwchemex(NWChemExBasePython): + """A top-level, user-focused, conglomerate repo for 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("python_package", branch="python_package") + pkg.version( + "0.0.27", + sha256="1bd22792ca0fbe74f95b2065f2f2d674f2c62d186a340150e8ed1e0f27c2d334", + ) + + # TODO: Many of these may be able to be switched to ("build", "run") + # instead of ("build", "link", "run") + pkg.depends_on("python@3.10:", type=("build", "run")) + pkg.depends_on("py-setuptools", type="build") + + # First-party + # TODO: Figure out how to ensure that the correct value for the "friends" + # variant can be propagated, or switch each friend to a separate variant + pkg.depends_on( + "friendzone", + type=("build", "link", "run"), + ) + pkg.depends_on( + "scf+python", + type=("build", "link", "run"), + ) + pkg.depends_on( + "nux+python", + type=("build", "link", "run"), + ) + pkg.depends_on( + "chemcache+python", + type=("build", "link", "run"), + ) + pkg.depends_on( + "integrals+python", + type=("build", "link", "run"), + ) + + # TODO: Add sanity checks + # 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_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py deleted file mode 100644 index c366f5c..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ /dev/null @@ -1,98 +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. -# ---------------------------------------------------------------------------- - -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_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py deleted file mode 100644 index 1203f76..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ /dev/null @@ -1,93 +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. -# ---------------------------------------------------------------------------- - -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_nux/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py deleted file mode 100644 index bb85011..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py +++ /dev/null @@ -1,84 +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. -# ---------------------------------------------------------------------------- - -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 deleted file mode 100644 index b4e2de4..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py +++ /dev/null @@ -1,107 +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. -# ---------------------------------------------------------------------------- - -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 deleted file mode 100644 index a4a55c1..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py +++ /dev/null @@ -1,88 +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. -# ---------------------------------------------------------------------------- - -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_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py deleted file mode 100644 index ce7b1b9..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ /dev/null @@ -1,116 +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. -# ---------------------------------------------------------------------------- - -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", - ) - - 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, - ) - - # For building GauXC, I think - pkg.depends_on("c", type="build") - - # TODO: Create this package - # pkg.depends_on("gauxc") - pkg.depends_on("eigen") - # The "tune" variant is not available prior to v2.6 - # TODO: A value of "tune=none" or any of the molgw-* options likely break - # the unit tests, but I don't know how to add them as conflicts yet. - pkg.depends_on("libint@2.6:", when="+tamm") - pkg.depends_on("mpi") - pkg.depends_on("py-numpy") - # pkg.depends_on("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") - - # Start with CMaize sanity check locations - sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( - project.lower() - ) - sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( - project.lower() - ) - # Append more sanity checks as needed - - def cmake_args(self): - args = super().cmake_args() - - args.extend( - [ - self.define_from_variant( - "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - ), - self.define_from_variant("ENABLE_SIGMA", "sigma"), - ] - ) - - return args diff --git a/spack_repo/nwchemex/core/packages/parallelzone/package.py b/spack_repo/nwchemex/core/packages/parallelzone/package.py new file mode 100644 index 0000000..f945619 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/parallelzone/package.py @@ -0,0 +1,101 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class Parallelzone(NWChemExBasePybindings): + """You're travelling through another dimension, a dimension not only of + CPUs and threads but of GPUs; a journey into a wondrous land whose + boundaries are bandwidth limited. That's the signpost up ahead - your next + stop, the ParallelZone! + """ + + 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 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + pkg.version("develop", branch="find_package_wrapper") + + # Versions from git tags + pkg.version( + "0.1.34", + sha256="ca47108832ddefc600c9b4782bbe0faf89da403a4cdac5b379f508be39ece934", + ) + + pkg.variant( + "papi", + default=False, + description="Enable PAPI bindings", + ) + # pkg.variant( + # "cuda", + # default=False, + # description="Enable CUDA bindings", + # ) + # pkg.variant( + # "hip", + # default=False, + # description="Enable HIP bindings", + # ) + # pkg.variant( + # "sycl", + # default=False, + # description="Enable SYCL bindings", + # ) + + # Runtime dependencies + pkg.depends_on("mpi") + pkg.depends_on("spdlog") + pkg.depends_on( + "cereal@1.3.1:", when="@0.1.41:" + ) # v1.3.1 changed the installed target from "cereal" to "cereal::cereal" + pkg.depends_on("cereal@:1.3.0", when="@:0.1.40") + pkg.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 + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant("BUILD_PAPI_BINDINGS ", "papi"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py b/spack_repo/nwchemex/core/packages/pluginplay/package.py similarity index 63% rename from spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py rename to spack_repo/nwchemex/core/packages/pluginplay/package.py index f8c5006..2b104c7 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py +++ b/spack_repo/nwchemex/core/packages/pluginplay/package.py @@ -1,31 +1,24 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2026 NWChemEx-Project # -# 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: +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# spack edit nwchemex-pluginplay +# http://www.apache.org/licenses/LICENSE-2.0 # -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. 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.""" +class Pluginplay(NWChemExBasePybindings): + """An inversion-of-control framework for developing modular scientific software.""" project = "PluginPlay" @@ -45,6 +38,8 @@ class NwchemexPluginplay(NWChemExBasePybindings): pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") pkg.license("Apache-2.0", checked_by="zachcran") + pkg.version("develop", branch="find_package_wrapper") + # Versions from git tags pkg.version( "1.0.46", @@ -62,8 +57,17 @@ class NwchemexPluginplay(NWChemExBasePybindings): 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") + pkg.depends_on("utilities") + pkg.depends_on( + "parallelzone+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "parallelzone~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( diff --git a/spack_repo/nwchemex/core/packages/py_qcelemental/package.py b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py new file mode 100644 index 0000000..55b9dec --- /dev/null +++ b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py @@ -0,0 +1,86 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from spack import package as pkg +from spack_repo.builtin.build_systems.python import PythonPackage + + +class PyQcelemental(PythonPackage): + """Periodic table, physical constants, and molecule parsing for quantum + chemistry. + """ + + homepage = "https://github.com/MolSSI/QCElemental" + url = "https://github.com/MolSSI/QCElemental/archive/refs/tags/v0.29.0.tar.gz" + git = "https://github.com/MolSSI/QCElemental.git" + # pypi = "qcelemental/qcelemental-0.29.0.tar.gz" + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + + pkg.license("BSD-3-Clause") + + pkg.version( + "0.29.0", + sha256="3571b9bc6c67faba8ea9d988948fd8efc593bf3b5d533486f84ee2e423d60c1e", + ) + pkg.version( + "0.28.0", + sha256="59f2104095b2d5bd78b02149c50c06fa884cde9fc2f49272edd0ec2e7f5fdd3d", + ) + pkg.version( + "0.27.1", + sha256="10686a022e7e85259d6ee1730c29cedff1b67c8a21d753b336fb4c42529922b1", + ) + pkg.version( + "0.27.0", + sha256="bf9ce6d6e134e905a5818c5907a3b8fa9fd8754eeb6b7519bd58c1a6a8177f1a", + ) + pkg.version( + "0.26.0", + sha256="fe198b92298c2a922b5e780757c055a522b31e46178851594185924df82bc00a", + ) + pkg.version( + "0.25.1", + sha256="87decd18ff6fffbbded4c77fe974c332a12573b9075247f461d57ec88301ac8b", + ) + pkg.version( + "0.25.0", + sha256="aad969fb10ac803a659f400a8ffd452f8bfa98409c092a136761dc99eb8374a8", + ) + pkg.version( + "0.24.0", + sha256="154367a7afa0a532325972caa16fd55b27c711fc4520a371eb9db56f4c2c62d1", + ) + pkg.version( + "0.23.0", + sha256="a6c9b77e66241b0862bcad8507aa94c40d5f54d299f46484363e3413caa93185", + ) + pkg.version( + "0.22.0", + sha256="e8d5e2cb00e5d8cd996157150e7270b304760c8a2bb569c68ad8ce279d5702d0", + ) + + pkg.depends_on("python@3.7:", type=("build", "run")) + + pkg.depends_on("py-poetry-core", type="build") + + pkg.depends_on("py-numpy@1.26:", type=("build", "run")) + pkg.depends_on("py-packaging@24.1:", type=("build", "run")) + pkg.depends_on("py-pint@0.24:", type=("build", "run")) + pkg.depends_on("py-pydantic@1.8.2:", type=("build", "run")) + pkg.depends_on("py-importlib-metadata@4.8:", type=("build", "run")) + pkg.depends_on("py-networkx~default", type=("build", "run")) + pkg.depends_on("py-scipy@1.9.0:", type=("build", "run")) + pkg.depends_on("py-setuptools@68.0.0:", type=("build", "run")) + pkg.depends_on("py-pytest@7.2.2:", type=("build", "run")) diff --git a/spack_repo/nwchemex/core/packages/py_qcengine/package.py b/spack_repo/nwchemex/core/packages/py_qcengine/package.py new file mode 100644 index 0000000..7ddb41c --- /dev/null +++ b/spack_repo/nwchemex/core/packages/py_qcengine/package.py @@ -0,0 +1,83 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from spack import package as pkg +from spack_repo.builtin.build_systems.python import PythonPackage + + +class PyQcengine(PythonPackage): + """QCEngine provides a wrapper to ingest and produce QCSchema for a variety + of quantum chemistry programs. + """ + + homepage = "https://github.com/MolSSI/QCEngine" + url = "https://github.com/MolSSI/QCEngine/archive/refs/tags/v0.29.0.tar.gz" + git = "https://github.com/MolSSI/QCEngine.git" + # pypi = "qcengine/qcengine-0.33.0.tar.gz" + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + + pkg.license("BSD-3-Clause") + + pkg.version( + "0.33.0", + sha256="7d9317355294b2118b9e959e57394eb3f2205db004d9ebe7441cd5026a7fc6c4", + ) + pkg.version( + "0.32.0", + sha256="666ae2eeec6758904548ac72199964c2141a1fcd2f14fed5dbe8bc324e43e4ac", + ) + pkg.version( + "0.31.0", + sha256="1d220c32efa813191a95a5c6a7aa8035551e4126230b60dccea4af236eeff810", + ) + pkg.version( + "0.30.0", + sha256="896c690fa82a5f65b6d702775ac61606dc54050f8642f0c04b6497c5f9bdca62", + ) + pkg.version( + "0.29.0", + sha256="a790f733d9132675636216011286415872ce815e6a4e7f7029ccde8c90293bfc", + ) + pkg.version( + "0.28.1", + sha256="11555cfc475fe6d048da6335fc1e2150a6c5f8082a415c45fe596e4fc96588ee", + ) + pkg.version( + "0.28.0", + sha256="c4b27a7a2f06e02e0ddfabf9b9b95adcc4f92acdd9a55678ae603d79a8464e60", + ) + pkg.version( + "0.27.0", + sha256="d339976c880c79cfe2da7cdb8458895a97322ca2abd134734b0b15031f5e3eeb", + ) + pkg.version( + "0.26.0", + sha256="0659fc6e92d0b8bd2252e4d0290543fdbf6fd5361943b4a43d429fe3074ab2dc", + ) + pkg.version( + "0.25.0", + sha256="2b651ed588c606cb9a734d4cfe04f8dfdee5ce7ccc64885c38f1a4e7798dadea", + ) + + pkg.depends_on("python@3.7:", type=("build", "run")) + + pkg.depends_on("py-setuptools", type="build") + + pkg.depends_on("py-pyyaml", type=("build", "run")) + pkg.depends_on("py-py-cpuinfo", type=("build", "run")) + pkg.depends_on("py-psutil", type=("build", "run")) + pkg.depends_on("py-pydantic@1.8.2:", type=("build", "run")) + pkg.depends_on("py-packaging", type=("build", "run")) + pkg.depends_on("py-qcelemental", type=("build", "run")) diff --git a/spack_repo/nwchemex/core/packages/scf/package.py b/spack_repo/nwchemex/core/packages/scf/package.py new file mode 100644 index 0000000..1e3d249 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/scf/package.py @@ -0,0 +1,77 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class Scf(NWChemExBasePybindings): + """Provides SCF driver for 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", + ) + + # 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("mpi") + pkg.depends_on("py-numpy@1") + # Uncomment when GauXC/Libxc interactions are sorted out + # pkg.depends_on("libxc") + + # First-party + pkg.depends_on( + "simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "simde~python", + type=("build", "link", "run"), + when="~python", + ) + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed diff --git a/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py b/spack_repo/nwchemex/core/packages/simde/package.py similarity index 59% rename from spack_repo/nwchemex/core/packages/nwchemex_simde/package.py rename to spack_repo/nwchemex/core/packages/simde/package.py index 809253b..56c582c 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py +++ b/spack_repo/nwchemex/core/packages/simde/package.py @@ -1,31 +1,27 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2026 NWChemEx-Project # -# 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 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# You can edit this file again by typing: +# http://www.apache.org/licenses/LICENSE-2.0 # -# spack edit nwchemex-simde -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. 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.""" +class Simde(NWChemExBasePybindings): + """The Simulation Development Environment (SimDE) includes software + designed to facilitate the creation of modular computational chemistry + software. + """ project = "SimDE" @@ -59,8 +55,26 @@ class NwchemexSimde(NWChemExBasePybindings): ) # First-party - pkg.depends_on("nwchemex-chemist") - pkg.depends_on("nwchemex-pluginplay") + pkg.depends_on( + "chemist+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "chemist~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "pluginplay+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "pluginplay~python", + type=("build", "link", "run"), + when="~python", + ) pkg.depends_on("sigma+eigen", when="+sigma") diff --git a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/tensorwrapper/package.py similarity index 60% rename from spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py rename to spack_repo/nwchemex/core/packages/tensorwrapper/package.py index 43c8bd4..9a2db1a 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/tensorwrapper/package.py @@ -1,31 +1,24 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2026 NWChemEx-Project # -# 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: +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# spack edit nwchemex-tensorwrapper +# http://www.apache.org/licenses/LICENSE-2.0 # -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. 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.""" +class Tensorwrapper(NWChemExBasePybindings): + """A type-erased wrapper around various tensor backends.""" project = "TensorWrapper" @@ -60,11 +53,26 @@ class NwchemexTensorwrapper(NWChemExBasePybindings): # Runtime dependencies pkg.depends_on("boost") - pkg.depends_on("eigen") + pkg.depends_on("eigen", type=("build", "link", "run")) + pkg.depends_on("py-numpy", when="+python", type=("build", "run")) # First-party - pkg.depends_on("nwchemex-utilities") - pkg.depends_on("nwchemex-parallelzone") + pkg.depends_on("utilities") + pkg.depends_on( + "parallelzone~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "parallelzone+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "py-numpy", + type=("build", "link", "run"), + when="+python", + ) pkg.depends_on("sigma+eigen", when="+sigma") diff --git a/spack_repo/nwchemex/core/packages/nwchemex_utilities/package.py b/spack_repo/nwchemex/core/packages/utilities/package.py similarity index 61% rename from spack_repo/nwchemex/core/packages/nwchemex_utilities/package.py rename to spack_repo/nwchemex/core/packages/utilities/package.py index aa21cb0..1ee26a7 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_utilities/package.py +++ b/spack_repo/nwchemex/core/packages/utilities/package.py @@ -1,30 +1,23 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2026 NWChemEx-Project # -# 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 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# You can edit this file again by typing: +# http://www.apache.org/licenses/LICENSE-2.0 # -# spack edit nwchemex-utilities -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from spack import package as pkg + from spack_repo.nwchemex.common.mixins import NWChemExBaseCXX -class NwchemexUtilities(NWChemExBaseCXX): +class Utilities(NWChemExBaseCXX): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "Utilities" diff --git a/spack_repo/nwchemex/core/repo.yaml b/spack_repo/nwchemex/core/repo.yaml index df117a9..354a086 100644 --- a/spack_repo/nwchemex/core/repo.yaml +++ b/spack_repo/nwchemex/core/repo.yaml @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # For more information on Spack package repositories, see # https://spack.readthedocs.io/en/latest/repositories.html diff --git a/spack_repo/nwchemex/overrides/packages/README.md b/spack_repo/nwchemex/overrides/packages/README.md index 2021054..fa72f00 100644 --- a/spack_repo/nwchemex/overrides/packages/README.md +++ b/spack_repo/nwchemex/overrides/packages/README.md @@ -1,3 +1,19 @@ + + # nwchemex.overrides Spack package repository to override existing packages for use in NWChemEx software stack. This package repository needs to appear above the repository containing the overridden package for it to work! diff --git a/spack_repo/nwchemex/overrides/repo.yaml b/spack_repo/nwchemex/overrides/repo.yaml index fcca2c3..8e7f678 100644 --- a/spack_repo/nwchemex/overrides/repo.yaml +++ b/spack_repo/nwchemex/overrides/repo.yaml @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # For more information on Spack package repositories, see # https://spack.readthedocs.io/en/latest/repositories.html diff --git a/test/check_errors.sh b/test/check_errors.sh new file mode 100755 index 0000000..87311ec --- /dev/null +++ b/test/check_errors.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# Performs import of all NWChemEx Spack package components to check for errors. +# +# With v2.0 of the Spack package API, Spack packages can be treated as normal +# Python-importable packages. This allows a first-pass error check by just +# importing the packages before even installing them, catching potential +# programming errors up the stack quickly. +# +# Usage: .sh +# +# Environment: +# SPACK_ROOT Used to find the location of your Spack install. +# SPACK_NWCHEMEX_ENV Env to activate that has the NWChemEx repo set up. +# Does not activate an env if undefined or empty. + +set -e + +_main() { + # Ensure that Spack is available for the script + local _spack_root="${SPACK_ROOT:-}" + if [[ "${_spack_root}" == "" ]]; then + printf 'ERROR: SPACK_ROOT environment variable not found! Make sure that Spack is installed and sourced correctly in your shell.\n' + exit 1 + fi + . "${_spack_root}"/share/spack/setup-env.sh + + # Check if an environment should be activated + local _nwchemex_env="${SPACK_NWCHEMEX_ENV:-}" + if [[ "${_nwchemex_env}" != "" ]]; then + spack env activate "${_nwchemex_env}" + fi + + # These are the imports to be executed + commands=( + "from spack_repo.nwchemex.common.mixins import *" + "from spack_repo.nwchemex.core.packages.utilities.package import Utilities" + "from spack_repo.nwchemex.core.packages.parallelzone.package import Parallelzone" + "from spack_repo.nwchemex.core.packages.pluginplay.package import Pluginplay" + "from spack_repo.nwchemex.core.packages.tensorwrapper.package import Tensorwrapper" + "from spack_repo.nwchemex.core.packages.chemist.package import Chemist" + "from spack_repo.nwchemex.core.packages.simde.package import Simde" + "from spack_repo.nwchemex.core.packages.integrals.package import Integrals" + "from spack_repo.nwchemex.core.packages.nux.package import Nux" + "from spack_repo.nwchemex.core.packages.chemcache.package import Chemcache" + "from spack_repo.nwchemex.core.packages.friendzone.package import Friendzone" + "from spack_repo.nwchemex.core.packages.scf.package import Scf" + "from spack_repo.nwchemex.core.packages.nwchemex.package import Nwchemex" + ) + + # Perform each import; this currently exits on the first error, but could + # continue if the python call was changed to avoid triggering 'set -e' with + # the colon no-op operator on error, like this: + # spack python -c "$cmd" || : + for cmd in "${commands[@]}"; do + printf 'Testing %s\n' "$cmd" + spack python -c "$cmd" + done +} + +_main "$@"