diff --git a/README.md b/README.md index a60d5a6..4b8c288 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,11 @@ git pull git checkout ``` +NOTE: Spack may have an undocumented update command now. The following worked for me with Spack `1.0.0.dev0 (b63f793f74c672eaf4768b7a5a711c83882bbebd)`: +```bash +spack repo update +``` + ### Spack <1.0.0 Updating with Spack <1.0.0 is approximately the same as >=1.0.0, and must be done by manually updating the cloned GitHub repository. The following commands will update *all* `nwchemex.*` sub-repos at once. You do not need to run this separately for each `nwchemex.*` sub-repo! @@ -108,3 +113,7 @@ For more information, see the Spack's [Search Order and Overriding Packages](htt ## Helpful Spack Commands For a broader list of helpful Spack repository management commands, see Spack's [The `spack repo` Command](https://spack.readthedocs.io/en/latest/repositories.html#the-spack-repo-command). + +### Developing Packages in a Spack Environment + +https://spack.readthedocs.io/en/latest/environments.html#developing-packages-in-a-spack-environment diff --git a/spack-repo-index.yaml b/spack-repo-index.yaml index ceab671..6cd40b9 100644 --- a/spack-repo-index.yaml +++ b/spack-repo-index.yaml @@ -4,5 +4,6 @@ repo_index: # Relative paths from project root to repos paths: + - spack_repo/nwchemex/common - spack_repo/nwchemex/core - spack_repo/nwchemex/overrides diff --git a/spack_repo/nwchemex/common/README.md b/spack_repo/nwchemex/common/README.md new file mode 100644 index 0000000..d9ce4fa --- /dev/null +++ b/spack_repo/nwchemex/common/README.md @@ -0,0 +1,14 @@ +# NWChemEx Common Package Components + +As of Spack package repository `api: v2.0`, package repositories integrate smoothly with Python's import system and can be imported for use in other packages. This repository is a collection of helpers and abstractions for NWChemEx packages to help with maintenance and development. + +## Usage + +In other repositories, use the following import statement form: +```python +from spack_repo.nwchemex._common.packages..package import Package +# Or, more generally +from spack_repo.nwchemex._common.. import +``` + +For more information about importing from packages after `api:v2.0`, see Spack's [Repository Namespaces and Python](https://spack.readthedocs.io/en/latest/repositories.html#repository-namespaces-and-python). diff --git a/spack_repo/nwchemex/common/mixins/__init__.py b/spack_repo/nwchemex/common/mixins/__init__.py new file mode 100644 index 0000000..63c84d2 --- /dev/null +++ b/spack_repo/nwchemex/common/mixins/__init__.py @@ -0,0 +1,4 @@ +from .cmaize import CMaizePackage +from .nwchemex import NWChemExBaseCXX, NWChemExBasePybindings + +__all__ = ["CMaizePackage", "NWChemExBaseCXX", "NWChemExBasePybindings"] diff --git a/spack_repo/nwchemex/common/mixins/cmaize.py b/spack_repo/nwchemex/common/mixins/cmaize.py new file mode 100644 index 0000000..087127c --- /dev/null +++ b/spack_repo/nwchemex/common/mixins/cmaize.py @@ -0,0 +1,66 @@ +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 + project_name_lowercase = project_name.lower() + + # Create NWChemEx project locations + project_include_path = join_path("include", project_name_lowercase) + project_lib_path = join_path("lib", project_name_lowercase) + project_lib_cmake_path = join_path( + project_lib_path, + "cmake", + ) + + directories = [ + join_path(project_include_path), + join_path(project_lib_path), + join_path(project_lib_cmake_path), + # CMaize's "external/" should not be a strict requirement since it + # can be empty, especially with Spack managing most/all deps. + # join_path(project_lib_path, "external"), + ] + + return directories + + @staticmethod + def cmaize_sanity_check_files(project_name: str) -> list[str]: + project_name_lowercase = project_name.lower() + + # Create NWChemEx project locations + project_lib_path = join_path("lib", project_name_lowercase) + project_lib_cmake_path = join_path( + project_lib_path, + "cmake", + ) + + files = [ + join_path( + project_lib_cmake_path, + f"{project_name_lowercase}Config.cmake", + ), + join_path( + project_lib_cmake_path, + f"{project_name_lowercase}ConfigVersion.cmake", + ), + join_path( + project_lib_cmake_path, + f"{project_name_lowercase}-target.cmake", + ), + # TODO: Conditionally check these once there is a "shared" variant + # if even possible + # join_path( + # project_lib_path, f"lib{project_name_lowercase}.a" + # ), + # join_path( + # project_lib_path, + # f"lib{project_name_lowercase}.so", + # ), + ] + + return files diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py new file mode 100644 index 0000000..f9f41ea --- /dev/null +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -0,0 +1,125 @@ +import os + +from spack import package as pkg +from spack.package_base import PackageBase + +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 + # won’t be the same commit that was used when the package was first + # written." + # ~~~~ From the Spack docs + # Is there a way to warn the user about this while still providing + # the option? + pkg.version("master", branch="master", preferred=True) + + +class NWChemExBaseCXX(NWChemExBaseGit, CMaizePackage): + + pkg.variant("docs", default=False, description="Build documentation") + pkg.variant( + "shared", + default=True, + description="Build shared libraries", + sticky=True, + ) + + pkg.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 + pkg.depends_on("catch2", type=("build", "test")) + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant( + "CMAKE_POSITION_INDEPENDENT_CODE", "shared" + ), + self.define_from_variant("BUILD_SHARED_LIBS", "shared"), + self.define_from_variant("BUILD_DOCS", "docs"), + self.define_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"]}" + ) + # TODO: +debug flag? +verbose flag? + args.append(self.define("CMAKE_MESSAGE_LOG_LEVEL", "DEBUG")) + # Silence FetchContent by default + args.append(self.define("FETCHCONTENT_QUIET", True)) + args.append("-Wno-dev") + # https://cmake.org/cmake/help/latest/policy/CMP0152.html + # Added in 3.28; OLD is deprecated now + args.append(self.define("CMAKE_POLICY_DEFAULT_CMP0152", "NEW")) + + # DEBUG REMOVE ME + args.append( + self.define( + "CMAKE_VERBOSE_MAKEFILE", + True, + ) + ) + + return args + + +class NWChemExBasePybindings(NWChemExBaseCXX): + + pkg.variant( + "pybindings", + default=False, + description="Build the Python bindings with Pybind11", + sticky=True, + ) + + pkg.depends_on("py-pybind11", when="+pybindings") + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant( + "BUILD_PYBIND11_PYBINDINGS", "pybindings" + ), + self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), + ] + ) + + if self.spec.satisfies("+pybindings"): + if "NWX_MODULE_DIRECTORY" in os.environ: + args.append( + self.define( + "NWX_MODULE_DIRECTORY", + os.environ["NWX_MODULE_DIRECTORY"], + ) + ) + # TODO: Allow the user to configure this? + # args.append( + # "-DNWX_MODULE_DIRECTORY={}".format( + # self.prefix.lib.join(self.project.lower()).join("python") + # ) + # ) + + return args diff --git a/spack_repo/nwchemex/common/repo.yaml b/spack_repo/nwchemex/common/repo.yaml new file mode 100644 index 0000000..18876d1 --- /dev/null +++ b/spack_repo/nwchemex/common/repo.yaml @@ -0,0 +1,10 @@ +# For more information on Spack package repositories, see +# https://spack.readthedocs.io/en/latest/repositories.html + +repo: + # Unique identifier for this repository + # For more details, see https://spack.readthedocs.io/en/latest/repositories.html#namespaces + namespace: 'nwchemex.common' + + # Spack package API this repo adheres to + api: v2.0 diff --git a/spack_repo/nwchemex/core/packages/nwchemex-chemist/package.py b/spack_repo/nwchemex/core/packages/nwchemex-chemist/package.py deleted file mode 100644 index 67ea5ab..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-chemist/package.py +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-chemist -# -# You can edit this file again by typing: -# -# spack edit nwchemex-chemist -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - -import os - -from spack.package import * - - -class NwchemexChemist(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/Chemist" - url = ( - "https://github.com/NWChemEx/Chemist/archive/refs/tags/v1.3.18.tar.gz" - ) - git = "https://github.com/NWChemEx/Chemist.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/Chemist/tags" - # To get older versions, uncomment 'list_depth' below and set it to a - # value >0 to get list_depth + 1 pages of versions. - # WARNING: This increases the number of links that the search spider will - # follow, meaning even 'list_depth = 1' may increase the search time - # significantly! - # list_depth = 1 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "1.3.19", - sha256="dc1adf754ce9a532ee4b13461aaaf29488a2d6d5f34aaa416a33bd621abb8c29", - ) - - variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, - ) - variant("docs", default=False, description="Build documentation") - variant( - "sigma", - default=False, - description="Enable Sigma for uncertainty tracking", - sticky=True, - ) - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # Runtime dependencies - depends_on("cxx", type="build") - depends_on("boost") - depends_on("py-pybind11", when="+pybindings") - # First-party - depends_on("nwchemex-utilities") - depends_on("nwchemex-parallelzone") - depends_on("nwchemex-tensorwrapper") - - # Test dependencies - depends_on("catch2", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("include", "chemist", "chemist.hpp"), - join_path("lib", "chemist", "cmake", "chemistConfig.cmake"), - join_path("lib", "chemist", "cmake", "chemistConfigVersion.cmake"), - join_path("lib", "chemist", "cmake", "chemist-target.cmake"), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "chemist", "libchemist.a"), - # join_path("lib", "chemist", "libchemist.so"), - ] - - sanity_check_is_dir = [ - join_path("include", "chemist"), - join_path("lib", "chemist"), - join_path("lib", "chemist", "cmake"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - self.define_from_variant("ENABLE_SIGMA", "sigma"), - self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" - ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), - ] - - if self.spec.satisfies("+pybindings"): - # TODO: Allow the user to configure this - args.append( - "-DNWX_MODULE_DIRECTORY={}".format( - join_path(self.prefix.lib, "chemist", "python") - ) - ) - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex-parallelzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex-parallelzone/package.py deleted file mode 100644 index da1b27a..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-parallelzone/package.py +++ /dev/null @@ -1,163 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-parallelzone -# -# You can edit this file again by typing: -# -# spack edit nwchemex-parallelzone -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - -import os - -from spack.package import * - - -class NwchemexParallelzone(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/ParallelZone" - url = "https://github.com/NWChemEx/ParallelZone/archive/refs/tags/v0.1.30.tar.gz" - git = ( - "https://github.com/NWChemEx/ParallelZone.git" # For the latest commit - ) - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/ParallelZone/tags" - # To get older versions, uncomment 'list_depth' below and set it to a - # value >0 to get list_depth + 1 pages of versions. - # WARNING: This increases the number of links that the search spider will - # follow, meaning even 'list_depth = 1' may increase the search time - # significantly! - # list_depth = 1 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "0.1.34", - sha256="ca47108832ddefc600c9b4782bbe0faf89da403a4cdac5b379f508be39ece934", - ) - - variant( - "papi", - default=False, - description="Enable PAPI bindings", - ) - # variant( - # "cuda", - # default=False, - # description="Enable CUDA bindings", - # ) - # variant( - # "hip", - # default=False, - # description="Enable HIP bindings", - # ) - # variant( - # "sycl", - # default=False, - # description="Enable SYCL bindings", - # ) - variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, - ) - variant("docs", default=False, description="Build documentation") - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # Runtime dependencies - depends_on("cxx", type="build") - depends_on("mpi") - depends_on("spdlog") - depends_on("cereal@1.3.0") # v1.3.1 changed the installed target... - depends_on("papi", when="+papi") - depends_on("py-pybind11", when="+pybindings") - - # Test dependencies - depends_on("catch2", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("include", "parallelzone", "parallelzone.hpp"), - join_path("lib", "parallelzone", "cmake", "parallelzoneConfig.cmake"), - join_path( - "lib", "parallelzone", "cmake", "parallelzoneConfigVersion.cmake" - ), - join_path("lib", "parallelzone", "cmake", "parallelzone-target.cmake"), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "parallelzone", "libparallelzone.a"), - # join_path("lib", "parallelzone", "libparallelzone.so"), - ] - - sanity_check_is_dir = [ - join_path("include", "parallelzone"), - join_path("lib", "parallelzone"), - join_path("lib", "parallelzone", "cmake"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" - ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), - ] - - if self.spec.satisfies("+pybindings"): - # TODO: Allow the user to configure this? - args.append( - "-DNWX_MODULE_DIRECTORY={}".format( - join_path(self.prefix.lib, "parallelzone", "python") - ) - ) - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex-pluginplay/package.py b/spack_repo/nwchemex/core/packages/nwchemex-pluginplay/package.py deleted file mode 100644 index 4fda2f6..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-pluginplay/package.py +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-pluginplay -# -# You can edit this file again by typing: -# -# spack edit nwchemex-pluginplay -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - -import os - -from spack.package import * - - -class NwchemexPluginplay(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/PluginPlay" - url = "https://github.com/NWChemEx/PluginPlay/archive/refs/tags/v1.0.43.tar.gz" - git = "https://github.com/NWChemEx/PluginPlay.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/PluginPlay/tags" - # To get older versions, uncomment 'list_depth' below and set it to a - # value >0 to get list_depth + 1 pages of versions. - # WARNING: This increases the number of links that the search spider will - # follow, meaning even 'list_depth = 1' may increase the search time - # significantly! - # list_depth = 1 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "1.0.46", - sha256="22303b38ac6e2459b50a9074697a59fbd01422cdb7db98599f81255f43176597", - ) - - variant( - "rocksdb", - default=False, - description="Enable RocksDB backend of the cache", - ) - variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, - ) - variant("docs", default=False, description="Build documentation") - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # Runtime dependencies - depends_on("cxx", type="build") - depends_on("boost") - depends_on("libfort enable_testing=false") - depends_on("rocksdb", when="+rocksdb") - depends_on("py-pybind11", when="+pybindings") - # First-party - depends_on("nwchemex-utilities") - depends_on("nwchemex-parallelzone") - - # Test dependencies - depends_on("catch2", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("include", "pluginplay", "pluginplay.hpp"), - join_path("lib", "pluginplay", "cmake", "pluginplayConfig.cmake"), - join_path( - "lib", "pluginplay", "cmake", "pluginplayConfigVersion.cmake" - ), - join_path("lib", "pluginplay", "cmake", "pluginplay-target.cmake"), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "pluginplay", "libpluginplay.a"), - # join_path("lib", "pluginplay", "libpluginplay.so"), - ] - - sanity_check_is_dir = [ - join_path("include", "pluginplay"), - join_path("lib", "pluginplay"), - join_path("lib", "pluginplay", "cmake"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - self.define_from_variant("BUILD_ROCKSDB", "rocksdb"), - self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" - ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), - ] - - if self.spec.satisfies("+pybindings"): - # TODO: Allow the user to configure this - args.append( - "-DNWX_MODULE_DIRECTORY={}".format( - join_path(self.prefix.lib, "parallelzone", "python") - ) - ) - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex-scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex-scf/package.py deleted file mode 100644 index 4cbd613..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-scf/package.py +++ /dev/null @@ -1,146 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-scf -# -# You can edit this file again by typing: -# -# spack edit nwchemex-scf -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - -import os - -from spack.package import * - - -class NwchemexScf(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/SCF" - url = "https://github.com/NWChemEx/SCF/archive/refs/tags/v0.0.53.tar.gz" - git = "https://github.com/NWChemEx/SCF.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/SCF/tags" - # To get older versions, uncomment 'list_depth' below and set it to a - # value >0 to get list_depth + 1 pages of versions. - # WARNING: This increases the number of links that the search spider will - # follow, meaning even 'list_depth = 1' may increase the search time - # significantly! - # list_depth = 1 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "0.0.23", - sha256="b175c15e8c814cd288817c970f4e049c7eab248975ff7c891d8927d7555d0cd8", - ) - - variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, - ) - variant("docs", default=False, description="Build documentation") - # FIXME: Anything above TensorWrapper is going to need to turn on or off sigma - variant( - "sigma", - default=False, - description="Enable Sigma for uncertainty tracking", - sticky=True, - ) - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # Runtime dependencies - depends_on("cxx", type="build") - depends_on("py-pybind11", when="+pybindings") - # FIXME: First-party dependencies - # depends_on("nwchemex-another-repo") - - # Test dependencies - depends_on("catch2", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("include", "scf", "scf.hpp"), - join_path("lib", "scf", "cmake", "scfConfig.cmake"), - join_path("lib", "scf", "cmake", "scfConfigVersion.cmake"), - join_path("lib", "scf", "cmake", "scf-target.cmake"), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "scf", "libscf.a"), - # join_path("lib", "scf", "libscf.so"), - ] - - sanity_check_is_dir = [ - join_path("include", "scf"), - join_path("lib", "scf"), - join_path("lib", "scf", "cmake"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - # FIXME: Anything above TensorWrapper is going to need to turn on or off sigma - self.define_from_variant("ENABLE_SIGMA", "sigma"), - self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" - ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), - ] - - if self.spec.satisfies("+pybindings"): - # TODO: Allow the user to configure this - args.append( - "-DNWX_MODULE_DIRECTORY={}".format( - join_path(self.prefix.lib, "scf", "python") - ) - ) - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex-simde/package.py b/spack_repo/nwchemex/core/packages/nwchemex-simde/package.py deleted file mode 100644 index 4e09d5d..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-simde/package.py +++ /dev/null @@ -1,145 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-simde -# -# You can edit this file again by typing: -# -# spack edit nwchemex-simde -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - -import os - -from spack.package import * - - -class NwchemexSimde(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/SimDE" - url = "https://github.com/NWChemEx/SimDE/archive/refs/tags/v0.0.53.tar.gz" - git = "https://github.com/NWChemEx/SimDE.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/SimDE/tags" - # To get older versions, uncomment 'list_depth' below and set it to a - # value >0 to get list_depth + 1 pages of versions. - # WARNING: This increases the number of links that the search spider will - # follow, meaning even 'list_depth = 1' may increase the search time - # significantly! - # list_depth = 1 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "0.0.53", - sha256="c95b818c0151a38190eebdaf41cc19fe04227ec827aef30293f959751a4b0bed", - ) - - variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, - ) - variant("docs", default=False, description="Build documentation") - variant( - "sigma", - default=False, - description="Enable Sigma for uncertainty tracking", - sticky=True, - ) - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # Runtime dependencies - depends_on("cxx", type="build") - depends_on("py-pybind11", when="+pybindings") - # First-party - depends_on("nwchemex-chemist") - depends_on("nwchemex-pluginplay") - - # Test dependencies - depends_on("catch2", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("include", "simde", "simde.hpp"), - join_path("lib", "simde", "cmake", "simdeConfig.cmake"), - join_path("lib", "simde", "cmake", "simdeConfigVersion.cmake"), - join_path("lib", "simde", "cmake", "simde-target.cmake"), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "simde", "libsimde.a"), - # join_path("lib", "simde", "libsimde.so"), - ] - - sanity_check_is_dir = [ - join_path("include", "simde"), - join_path("lib", "simde"), - join_path("lib", "simde", "cmake"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - self.define_from_variant("ENABLE_SIGMA", "sigma"), - self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" - ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), - ] - - if self.spec.satisfies("+pybindings"): - # TODO: Allow the user to configure this - args.append( - "-DNWX_MODULE_DIRECTORY={}".format( - join_path(self.prefix.lib, "simde", "python") - ) - ) - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex-tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/nwchemex-tensorwrapper/package.py deleted file mode 100644 index fc91013..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-tensorwrapper/package.py +++ /dev/null @@ -1,153 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-tensorwrapper -# -# You can edit this file again by typing: -# -# spack edit nwchemex-tensorwrapper -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- -import os - -from spack.package import * - - -class NwchemexTensorwrapper(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/TensorWrapper" - url = "https://github.com/NWChemEx/TensorWrapper/archive/refs/tags/v0.0.55.tar.gz" - git = "https://github.com/NWChemEx/TensorWrapper.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/TensorWrapper/tags" - # To get older versions, uncomment 'list_depth' below and set it to a - # value >0 to get list_depth + 1 pages of versions. - # WARNING: This increases the number of links that the search spider will - # follow, meaning even 'list_depth = 1' may increase the search time - # significantly! - # list_depth = 1 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "0.0.62", - sha256="a526418836e0fff1362d4ff2c9131ae9eb2d509ae53148ac597f8de8444af9ca", - ) - - variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, - ) - variant( - "sigma", - default=False, - description="Enable Sigma for uncertainty tracking", - sticky=True, - ) - variant("docs", default=False, description="Build documentation") - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # Runtime dependencies - depends_on("cxx", type="build") - depends_on("boost") - depends_on("eigen@master") - depends_on("sigma@main+eigen", when="+sigma") - depends_on("py-pybind11", when="+pybindings") - # First-party - depends_on("nwchemex-utilities") - depends_on("nwchemex-parallelzone") - - # Test dependencies - depends_on("catch2", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("include", "tensorwrapper", "tensorwrapper.hpp"), - join_path( - "lib", "tensorwrapper", "cmake", "tensorwrapperConfig.cmake" - ), - join_path( - "lib", "tensorwrapper", "cmake", "tensorwrapperConfigVersion.cmake" - ), - join_path( - "lib", "tensorwrapper", "cmake", "tensorwrapper-target.cmake" - ), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "tensorwrapper", "libtensorwrapper.a"), - # join_path("lib", "tensorwrapper", "libtensorwrapper.so"), - ] - - sanity_check_is_dir = [ - join_path("include", "tensorwrapper"), - join_path("lib", "tensorwrapper"), - join_path("lib", "tensorwrapper", "cmake"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - self.define_from_variant("ENABLE_SIGMA", "sigma"), - self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" - ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), - ] - - if self.spec.satisfies("+pybindings"): - # TODO: Allow the user to configure this - args.append( - "-DNWX_MODULE_DIRECTORY={}".format( - join_path(self.prefix.lib, "tensorwrapper", "python") - ) - ) - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex-utilities/package.py b/spack_repo/nwchemex/core/packages/nwchemex-utilities/package.py deleted file mode 100644 index ff4baaa..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex-utilities/package.py +++ /dev/null @@ -1,119 +0,0 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-utilities -# -# You can edit this file again by typing: -# -# spack edit nwchemex-utilities -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - -import os - -from spack.package import * - - -class NwchemexUtilities(CMakePackage): - """Generic, helpful C++ classes used by the NWChemEx project.""" - - homepage = "https://github.com/NWChemEx/Utilities" - url = "https://github.com/NWChemEx/Utilities/archive/refs/tags/v0.1.26.tar.gz" - git = "https://github.com/NWChemEx/Utilities.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = "https://github.com/NWChemEx/Utilities/tags" - # To get older versions, uncomment 'list_depth' below and set it to a - # value >0 to get list_depth + 1 pages of versions. - # WARNING: This increases the number of links that the search spider will - # follow, meaning even 'list_depth = 1' may increase the search time - # significantly! - # list_depth = 1 - - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") - - # Latest commit from GitHub - # "This download method is untrusted, and is not recommended. Branches are - # moving targets, so the commit you get when you install the package likely - # won’t be the same commit that was used when the package was first written." - # ~~~~ From the Spack docs - # Is there a way to warn the user about this while still providing - # the option? - version("master", branch="master", preferred=True) - - # Versions from git tags - version( - "0.1.26", - sha256="508a14609cb6cdbaaa604ada512224ed1bfa3c378d0232c69429a2134c1d1180", - ) - - depends_on("cxx", type="build") - - variant("docs", default=False, description="Build documentation") - variant( - "shared", - default=True, - description="Build shared libraries", - sticky=True, - ) - variant( - "tests", - default=False, - description="Build unit tests", - ) - - # No runtime dependencies - # depends_on("foo") - - # Test dependencies - depends_on("catch2", type="test", when="+tests") - - # Sanity check tests during installation - sanity_check_is_file = [ - join_path("lib", "utilities", "cmake", "utilitiesConfig.cmake"), - join_path("lib", "utilities", "cmake", "utilitiesConfigVersion.cmake"), - join_path("lib", "utilities", "cmake", "utilities-target.cmake"), - # TODO: Conditionally check these once there is a "shared" variant - # join_path("lib", "utilities", "libutilities.a"), - # join_path("lib", "utilities", "libutilities.so"), - ] - sanity_check_is_dir = [ - join_path("include", "utilities"), - join_path("lib", "utilities"), - join_path("lib", "utilities", "cmake"), - # ZDC: I don't think CMaize's "external/" should be a strict requirement - # since it can be empty, especially with Spack managing most/all deps. - # join_path("lib", "utilities", "external"), - ] - - def cmake_args(self): - args = [ - self.define_from_variant( - "CMAKE_POSITION_INDEPENDENT_CODE", "shared" - ), - self.define_from_variant("BUILD_SHARED_LIBS", "shared"), - self.define_from_variant("BUILD_TESTING", "tests"), - self.define_from_variant("BUILD_DOCS", "docs"), - ] - - if "CMAKE_TOOLCHAIN_FILE" in os.environ: - args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" - ) - args.append("-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") - args.append("-DCMAKE_POLICY_DEFAULT_CMP0152=NEW") - args.append("-Wno-dev") - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py new file mode 100644 index 0000000..c366f5c --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -0,0 +1,98 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-chemist +# +# You can edit this file again by typing: +# +# spack edit nwchemex-chemist +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexChemcache(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "ChemCache" + + homepage = f"https://github.com/NWChemEx/{project}" + url = ( + f"https://github.com/NWChemEx/{project}/archive/refs/tags/v1.1.2tar.gz" + ) + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + pkg.version("generated_data", branch="generated_data") + + # Versions from git tags + pkg.version( + "1.1.2", + sha256="5efb2a60d75aaa57e08e8b2a0b84a24e502083fa5bacae416406ec59bd2839b8", + ) + + # TODO: Are we sure this shouldn't be here to propagate down to SimDE? + # pkg.variant( + # "sigma", + # default=False, + # description="Enable Sigma for uncertainty tracking", + # sticky=True, + # ) + pkg.variant( + "experimental", + default=False, + description="Enable experimental features", + sticky=False, + ) + + # Runtime dependencies + + # First-party + pkg.depends_on("nwchemex-simde") + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant( + "ENABLE_EXPERIMENTAL_FEATURES", "experimental" + ), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py new file mode 100644 index 0000000..e6e3bb5 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py @@ -0,0 +1,91 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-chemist +# +# You can edit this file again by typing: +# +# spack edit nwchemex-chemist +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexChemist(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "Chemist" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v1.3.18.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + pkg.version( + "1.3.19", + sha256="dc1adf754ce9a532ee4b13461aaaf29488a2d6d5f34aaa416a33bd621abb8c29", + ) + + pkg.variant( + "sigma", + default=False, + description="Enable Sigma for uncertainty tracking", + sticky=True, + ) + + # Runtime dependencies + pkg.depends_on("boost") + + # First-party + pkg.depends_on("nwchemex-utilities") + pkg.depends_on("nwchemex-parallelzone") + pkg.depends_on("nwchemex-tensorwrapper") + + # Although we have a variant, technically it is not a direct dependency + # of this package + # pkg.depends_on("sigma+eigen", when="+sigma") + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant("ENABLE_SIGMA", "sigma"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py new file mode 100644 index 0000000..1203f76 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -0,0 +1,93 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-simde +# +# You can edit this file again by typing: +# +# spack edit nwchemex-simde +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexFriendzone(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "FriendZone" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v1.0.9.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + pkg.version( + "1.0.9", + sha256="fbf3b4a8f392e88e675696976d4d4927af1f158a2602f761796d415c1fbaeab1", + ) + + # TODO: Should this still be here for SimDE propagation? + # pkg.variant( + # "sigma", + # default=False, + # description="Enable Sigma for uncertainty tracking", + # sticky=True, + # ) + pkg.variant( + "experimental", + default=False, + description="Enable experimental features", + sticky=False, + ) + + pkg.depends_on("py-ase") + pkg.depends_on("nwchem") + + # First-party + pkg.depends_on("nwchemex-simde") + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + self.define_from_variant( + "ENABLE_EXPERIMENTAL_FEATURES", "experimental" + ), + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py b/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py new file mode 100644 index 0000000..295ce03 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py @@ -0,0 +1,90 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-simde +# +# You can edit this file again by typing: +# +# spack edit nwchemex-simde +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexIntegrals(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "Integrals" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.30.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + pkg.version( + "0.0.30", + sha256="894bec1a6be2ec28302fde9f26f9b2961b43cfe4d15c037005fd266295dd7f3b", + ) + + pkg.variant( + "sigma", + default=False, + description="Enable Sigma for uncertainty tracking", + sticky=True, + ) + + # The "tune" variant is not available prior to v2.6 + # TODO: A value of "tune=none" or any of the molgw-* options likely break + # the unit tests, but I don't know how to add them as conflicts yet. + pkg.depends_on("libint@2.6:") + # Although we have a variant, technically it is not a direct dependency + # of this package + # pkg.depends_on("sigma+eigen", when="+sigma") + + # First-party + pkg.depends_on("nwchemex-simde") + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant("ENABLE_SIGMA", "sigma"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py new file mode 100644 index 0000000..bb85011 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py @@ -0,0 +1,84 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-simde +# +# You can edit this file again by typing: +# +# spack edit nwchemex-simde +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexNux(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "NUX" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.5.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + pkg.version( + "0.0.5", + sha256="58cb55b4975baf3255208333fd4366293efe55b0aeaab3c269f7485f75f2061b", + ) + + # TODO: Should this still be here for SimDE propagation? + # pkg.variant( + # "sigma", + # default=False, + # description="Enable Sigma for uncertainty tracking", + # sticky=True, + # ) + + # First-party + pkg.depends_on("nwchemex-simde") + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant("ENABLE_SIGMA", "sigma"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py new file mode 100644 index 0000000..b4e2de4 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py @@ -0,0 +1,107 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-simde +# +# You can edit this file again by typing: +# +# spack edit nwchemex-simde +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexNwchemex(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "NWChemEx" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.27.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + pkg.version( + "0.0.27", + sha256="1bd22792ca0fbe74f95b2065f2f2d674f2c62d186a340150e8ed1e0f27c2d334", + ) + + # TODO: Should this still be here for SimDE propagation? + # pkg.variant( + # "sigma", + # default=False, + # description="Enable Sigma for uncertainty tracking", + # sticky=True, + # ) + # TODO: Handle this turned on + pkg.variant( + "tamm", + default=False, + description="Build modules that rely on TAMM/Exachem", + ) + pkg.variant( + "full-chemcache", + default=False, + description="If ChemCache isn't found, build the full version", + sticky=False, + ) + + # TODO: Create this package + # pkg.depends_on("gauxc") + pkg.depends_on("eigen") + pkg.depends_on("libint", when="+tamm") + # pkg.depends_on("tamm", when="+tamm") + # pkg.depends_on("exachem", when="+tamm") + + # First-party + pkg.depends_on("nwchemex-friendzone") + pkg.depends_on("nwchemex-scf") + pkg.depends_on("nwchemex-nux") + pkg.depends_on("nwchemex-chemcache") + pkg.depends_on("nwchemex-integrals") + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + self.define_from_variant( + "ENABLE_EXPERIMENTAL_FEATURES", "experimental" + ), + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py new file mode 100644 index 0000000..a4a55c1 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py @@ -0,0 +1,88 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-parallelzone +# +# You can edit this file again by typing: +# +# spack edit nwchemex-parallelzone +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack.package import depends_on, license, maintainers, variant, version +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexParallelzone(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "ParallelZone" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.1.34.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + maintainers("ryanmrichard", "jwaldrop107", "zachcran") + license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + version( + "0.1.34", + sha256="ca47108832ddefc600c9b4782bbe0faf89da403a4cdac5b379f508be39ece934", + ) + + variant( + "papi", + default=False, + description="Enable PAPI bindings", + ) + # variant( + # "cuda", + # default=False, + # description="Enable CUDA bindings", + # ) + # variant( + # "hip", + # default=False, + # description="Enable HIP bindings", + # ) + # variant( + # "sycl", + # default=False, + # description="Enable SYCL bindings", + # ) + + # Runtime dependencies + depends_on("mpi") + depends_on("spdlog") + depends_on("cereal@1.3.0") # v1.3.1 changed the installed target... + depends_on("papi", when="+papi") + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed diff --git a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py new file mode 100644 index 0000000..f8c5006 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py @@ -0,0 +1,86 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-pluginplay +# +# You can edit this file again by typing: +# +# spack edit nwchemex-pluginplay +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexPluginplay(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "PluginPlay" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v1.0.43.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + pkg.version( + "1.0.46", + sha256="22303b38ac6e2459b50a9074697a59fbd01422cdb7db98599f81255f43176597", + ) + + pkg.variant( + "rocksdb", + default=False, + description="Enable RocksDB backend of the cache", + ) + + # Runtime dependencies + pkg.depends_on("boost") + pkg.depends_on("libfort enable_testing=false") + pkg.depends_on("rocksdb", when="+rocksdb") + # First-party + pkg.depends_on("nwchemex-utilities") + pkg.depends_on("nwchemex-parallelzone") + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant("BUILD_ROCKSDB", "rocksdb"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py new file mode 100644 index 0000000..ce7b1b9 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -0,0 +1,116 @@ +# 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/nwchemex_simde/package.py b/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py new file mode 100644 index 0000000..809253b --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py @@ -0,0 +1,85 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-simde +# +# You can edit this file again by typing: +# +# spack edit nwchemex-simde +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexSimde(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "SimDE" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.53.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + pkg.version( + "0.0.53", + sha256="c95b818c0151a38190eebdaf41cc19fe04227ec827aef30293f959751a4b0bed", + ) + + pkg.variant( + "sigma", + default=False, + description="Enable Sigma for uncertainty tracking", + sticky=True, + ) + + # First-party + pkg.depends_on("nwchemex-chemist") + pkg.depends_on("nwchemex-pluginplay") + + pkg.depends_on("sigma+eigen", when="+sigma") + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant("ENABLE_SIGMA", "sigma"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py new file mode 100644 index 0000000..43c8bd4 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py @@ -0,0 +1,89 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-tensorwrapper +# +# You can edit this file again by typing: +# +# spack edit nwchemex-tensorwrapper +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexTensorwrapper(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "TensorWrapper" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.55.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + pkg.version( + "0.0.62", + sha256="a526418836e0fff1362d4ff2c9131ae9eb2d509ae53148ac597f8de8444af9ca", + ) + + pkg.variant( + "sigma", + default=False, + description="Enable Sigma for uncertainty tracking", + sticky=True, + ) + + # Runtime dependencies + pkg.depends_on("boost") + pkg.depends_on("eigen") + + # First-party + pkg.depends_on("nwchemex-utilities") + pkg.depends_on("nwchemex-parallelzone") + + pkg.depends_on("sigma+eigen", when="+sigma") + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant("ENABLE_SIGMA", "sigma"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_utilities/package.py b/spack_repo/nwchemex/core/packages/nwchemex_utilities/package.py new file mode 100644 index 0000000..aa21cb0 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_utilities/package.py @@ -0,0 +1,61 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-utilities +# +# You can edit this file again by typing: +# +# spack edit nwchemex-utilities +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg +from spack_repo.nwchemex.common.mixins import NWChemExBaseCXX + + +class NwchemexUtilities(NWChemExBaseCXX): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "Utilities" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.1.26.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + pkg.version( + "0.1.26", + sha256="508a14609cb6cdbaaa604ada512224ed1bfa3c378d0232c69429a2134c1d1180", + ) + + # Start with CMaize sanity check locations + sanity_check_is_dir = NWChemExBaseCXX.cmaize_sanity_check_dirs( + project.lower() + ) + sanity_check_is_file = NWChemExBaseCXX.cmaize_sanity_check_files( + project.lower() + ) + # Append more sanity checks as needed