diff --git a/spack_repo/nwchemex/common/mixins/__init__.py b/spack_repo/nwchemex/common/mixins/__init__.py index 63c84d2..5d82e1a 100644 --- a/spack_repo/nwchemex/common/mixins/__init__.py +++ b/spack_repo/nwchemex/common/mixins/__init__.py @@ -1,4 +1,13 @@ from .cmaize import CMaizePackage -from .nwchemex import NWChemExBaseCXX, NWChemExBasePybindings +from .nwchemex import ( + NWChemExBaseCXX, + NWChemExBasePybindings, + NWChemExBasePython, +) -__all__ = ["CMaizePackage", "NWChemExBaseCXX", "NWChemExBasePybindings"] +__all__ = [ + "CMaizePackage", + "NWChemExBaseCXX", + "NWChemExBasePybindings", + "NWChemExBasePython", +] diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index f9f41ea..a2fa8a1 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -2,6 +2,7 @@ from spack import package as pkg from spack.package_base import PackageBase +from spack_repo.builtin.build_systems.python import PythonPackage from .cmaize import CMaizePackage @@ -29,17 +30,6 @@ class NWChemExBaseCXX(NWChemExBaseGit, CMaizePackage): sticky=True, ) - pkg.variant( - "cxxstd", - default="17", - # NOTE: Comma after "17" is necessary so Spack doesn't split it into - # individual characters - values=("17",), - multi=False, - description="Use the specified C++ standard when building", - sticky=True, - ) - pkg.depends_on("cxx", type="build") # Test dependencies @@ -55,7 +45,6 @@ def cmake_args(self): ), self.define_from_variant("BUILD_SHARED_LIBS", "shared"), self.define_from_variant("BUILD_DOCS", "docs"), - self.define_from_variant("CMAKE_CXX_STANDARD", "cxxstd"), self.define("BUILD_TESTING", self.run_tests), ] ) @@ -87,13 +76,24 @@ def cmake_args(self): class NWChemExBasePybindings(NWChemExBaseCXX): pkg.variant( - "pybindings", - default=False, - description="Build the Python bindings with Pybind11", - sticky=True, + "python", + default=True, + description="Build the Python bindings", + # sticky=True, ) - pkg.depends_on("py-pybind11", when="+pybindings") + # https://spack.readthedocs.io/en/latest/build_systems/pythonpackage.html#extends-vs-depends-on + pkg.extends("python", when="+python") + pkg.depends_on( + "py-pybind11@3:", + type=("build", "link", "run", "test"), + when="+python", + ) + pkg.depends_on( + "python@3:", + type=("build", "link", "run", "test"), + when="+python", + ) def cmake_args(self): args = super().cmake_args() @@ -101,25 +101,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/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py index c366f5c..bb28e16 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -48,7 +48,7 @@ class NwchemexChemcache(NWChemExBasePybindings): pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") pkg.license("Apache-2.0", checked_by="zachcran") - pkg.version("generated_data", branch="generated_data") + pkg.version("generated_data", branch="generated_data", preferred=True) # Versions from git tags pkg.version( @@ -56,24 +56,19 @@ class NwchemexChemcache(NWChemExBasePybindings): sha256="5efb2a60d75aaa57e08e8b2a0b84a24e502083fa5bacae416406ec59bd2839b8", ) - # TODO: Are we sure this shouldn't be here to propagate down to SimDE? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) - pkg.variant( - "experimental", - default=False, - description="Enable experimental features", - sticky=False, - ) - - # Runtime dependencies + pkg.depends_on("py-requests@2.16:") # First-party - pkg.depends_on("nwchemex-simde") + pkg.depends_on( + "nwchemex-simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-simde~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( @@ -83,16 +78,3 @@ class NwchemexChemcache(NWChemExBasePybindings): project.lower() ) # Append more sanity checks as needed - - def cmake_args(self): - args = super().cmake_args() - - args.extend( - [ - self.define_from_variant( - "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - ), - ] - ) - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py index e6e3bb5..b075f91 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py @@ -63,8 +63,27 @@ class NwchemexChemist(NWChemExBasePybindings): # First-party pkg.depends_on("nwchemex-utilities") - pkg.depends_on("nwchemex-parallelzone") - pkg.depends_on("nwchemex-tensorwrapper") + pkg.depends_on( + "nwchemex-parallelzone+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-parallelzone~python", + type=("build", "link", "run"), + when="~python", + ) + + pkg.depends_on( + "nwchemex-tensorwrapper+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-tensorwrapper~python", + type=("build", "link", "run"), + when="~python", + ) # Although we have a variant, technically it is not a direct dependency # of this package 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..1f1774e --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py @@ -0,0 +1,109 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-simde +# +# You can edit this file again by typing: +# +# spack edit nwchemex-simde +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexFriendzone(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "FriendZone" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v1.0.9.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + pkg.version( + "1.0.9", + sha256="fbf3b4a8f392e88e675696976d4d4927af1f158a2602f761796d415c1fbaeab1", + ) + + # TODO: Should this still be here for SimDE propagation? + # pkg.variant( + # "sigma", + # default=False, + # description="Enable Sigma for uncertainty tracking", + # sticky=True, + # ) + + pkg.depends_on("py-pip", when="+python", type=("build", "link")) + pkg.depends_on( + "py-pydantic", when="+python", type=("build", "link", "run") + ) + pkg.depends_on( + "py-networkx~default", when="+python", type=("build", "link", "run") + ) + pkg.depends_on( + "py-qcelemental", when="+python", type=("build", "link", "run") + ) + pkg.depends_on( + "py-qcengine", when="+python", type=("build", "link", "run") + ) + # pkg.depends_on("py-ase", when="+python", type=("build", "link", "run")) + pkg.depends_on("nwchem", when="+python", type=("build", "link", "run")) + + # First-party + pkg.depends_on( + "nwchemex-simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-simde~python", + type=("build", "link", "run"), + when="~python", + ) + + # Start with CMaize sanity check locations + # sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + # project.lower() + # ) + # sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + # project.lower() + # ) + # Append more sanity checks as needed + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define("ENABLE_ASE", "OFF"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 1203f76..03b9113 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -11,22 +11,22 @@ # next to all the things you'll want to change. Once you've handled # them, you can save this file and test your package like this: # -# spack install nwchemex-simde +# spack install nwchemex-friendzone # # You can edit this file again by typing: # -# spack edit nwchemex-simde +# spack edit nwchemex-friendzone # # See the Spack documentation for more information on packaging. # ---------------------------------------------------------------------------- from spack import package as pkg -from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings +from spack_repo.nwchemex.common.mixins import NWChemExBasePython -class NwchemexFriendzone(NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" +class NwchemexFriendzone(NWChemExBasePython): + """Provides SimDE-compatible APIs so that NWChemEx can play nicely with its friends.""" project = "FriendZone" @@ -48,46 +48,51 @@ class NwchemexFriendzone(NWChemExBasePybindings): # Versions from git tags pkg.version( - "1.0.9", - sha256="fbf3b4a8f392e88e675696976d4d4927af1f158a2602f761796d415c1fbaeab1", + "1.0.14", + sha256="b504cb1f20ed5839a1fc926650b2f4114b8ff985f2295f81980e05281c74d652", ) - # TODO: Should this still be here for SimDE propagation? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) pkg.variant( - "experimental", - default=False, - description="Enable experimental features", - sticky=False, + "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`)" + ), ) - pkg.depends_on("py-ase") - pkg.depends_on("nwchem") + # 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("nwchemex-simde") + pkg.depends_on( + "nwchemex-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() - ) + # 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 index 295ce03..a2ca584 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py @@ -67,7 +67,16 @@ class NwchemexIntegrals(NWChemExBasePybindings): # pkg.depends_on("sigma+eigen", when="+sigma") # First-party - pkg.depends_on("nwchemex-simde") + pkg.depends_on( + "nwchemex-simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-simde~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py index bb85011..9a97ef7 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py @@ -52,16 +52,17 @@ class NwchemexNux(NWChemExBasePybindings): sha256="58cb55b4975baf3255208333fd4366293efe55b0aeaab3c269f7485f75f2061b", ) - # TODO: Should this still be here for SimDE propagation? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) - # First-party - pkg.depends_on("nwchemex-simde") + pkg.depends_on( + "nwchemex-simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-simde~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( @@ -71,14 +72,3 @@ class NwchemexNux(NWChemExBasePybindings): project.lower() ) # Append more sanity checks as needed - - def cmake_args(self): - args = super().cmake_args() - - args.extend( - [ - self.define_from_variant("ENABLE_SIGMA", "sigma"), - ] - ) - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py new file mode 100644 index 0000000..12e729a --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py @@ -0,0 +1,129 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-simde +# +# You can edit this file again by typing: +# +# spack edit nwchemex-simde +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexNwchemex(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "NWChemEx" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.27.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + pkg.version( + "0.0.27", + sha256="1bd22792ca0fbe74f95b2065f2f2d674f2c62d186a340150e8ed1e0f27c2d334", + ) + + # TODO: Should this still be here for SimDE propagation? + # pkg.variant( + # "sigma", + # default=False, + # description="Enable Sigma for uncertainty tracking", + # sticky=True, + # ) + # TODO: Handle this turned on + pkg.variant( + "tamm", + default=False, + description="Build modules that rely on TAMM/Exachem", + ) + pkg.variant( + "full-chemcache", + default=False, + description="If ChemCache isn't found, build the full version", + sticky=False, + ) + + # First-party + pkg.depends_on( + "nwchemex-friendzone+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-scf+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-scf~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-nux+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-nux~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-chemcache+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-chemcache~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-integrals+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-integrals~python", + type=("build", "link", "run"), + when="~python", + ) + + # Start with CMaize sanity check locations + # sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + # project.lower() + # ) + # sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + # project.lower() + # ) + # Append more sanity checks as needed diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py index b4e2de4..d8afa69 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py @@ -22,10 +22,10 @@ from spack import package as pkg -from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings +from spack_repo.nwchemex.common.mixins import NWChemExBasePython -class NwchemexNwchemex(NWChemExBasePybindings): +class NwchemexNwchemex(NWChemExBasePython): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "NWChemEx" @@ -47,61 +47,47 @@ class NwchemexNwchemex(NWChemExBasePybindings): pkg.license("Apache-2.0", checked_by="zachcran") # Versions from git tags + pkg.version("python_package", branch="python_package") pkg.version( "0.0.27", sha256="1bd22792ca0fbe74f95b2065f2f2d674f2c62d186a340150e8ed1e0f27c2d334", ) - # TODO: Should this still be here for SimDE propagation? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) - # TODO: Handle this turned on - pkg.variant( - "tamm", - default=False, - description="Build modules that rely on TAMM/Exachem", - ) - 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") + # 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 - 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() + # TODO: Figure out how to ensure that the correct value for the "friends" + # variant can be propagated, or switch each friend to a separate variant + pkg.depends_on( + "nwchemex-friendzone", + type=("build", "link", "run"), ) - sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( - project.lower() + pkg.depends_on( + "nwchemex-scf+python", + type=("build", "link", "run"), + ) + pkg.depends_on( + "nwchemex-nux+python", + type=("build", "link", "run"), + ) + pkg.depends_on( + "nwchemex-chemcache+python", + type=("build", "link", "run"), + ) + pkg.depends_on( + "nwchemex-integrals+python", + type=("build", "link", "run"), ) - # 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 + # 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_parallelzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py index a4a55c1..6111d81 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py @@ -85,4 +85,15 @@ class NwchemexParallelzone(NWChemExBasePybindings): sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( project.lower() ) + # Append more sanity checks as needed + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant("BUILD_PAPI_BINDINGS ", "papi"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py index f8c5006..2fcd7ff 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py @@ -21,6 +21,7 @@ # ---------------------------------------------------------------------------- from spack import package as pkg + from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings @@ -63,7 +64,16 @@ class NwchemexPluginplay(NWChemExBasePybindings): pkg.depends_on("rocksdb", when="+rocksdb") # First-party pkg.depends_on("nwchemex-utilities") - pkg.depends_on("nwchemex-parallelzone") + pkg.depends_on( + "nwchemex-parallelzone+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-parallelzone~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py index ce7b1b9..1194533 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -51,46 +51,28 @@ class NwchemexScf(NWChemExBasePybindings): sha256="b175c15e8c814cd288817c970f4e049c7eab248975ff7c891d8927d7555d0cd8", ) - pkg.variant( - "sigma", - default=False, - description="Enable Sigma for uncertainty tracking", - sticky=True, - ) - # TODO: Handle this turned on - pkg.variant( - "tamm", - default=False, - description="Build modules that rely on TAMM/Exachem", - ) - 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") + # Uncomment when GauXC/Libxc interactions are sorted out + # pkg.depends_on("libxc") # First-party - pkg.depends_on("nwchemex-simde") + pkg.depends_on( + "nwchemex-simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-simde~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( @@ -100,17 +82,3 @@ class NwchemexScf(NWChemExBasePybindings): project.lower() ) # Append more sanity checks as needed - - def cmake_args(self): - args = super().cmake_args() - - args.extend( - [ - self.define_from_variant( - "ENABLE_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 index 809253b..6abe88f 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py @@ -59,8 +59,26 @@ class NwchemexSimde(NWChemExBasePybindings): ) # First-party - pkg.depends_on("nwchemex-chemist") - pkg.depends_on("nwchemex-pluginplay") + pkg.depends_on( + "nwchemex-chemist+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-chemist~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-pluginplay+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-pluginplay~python", + type=("build", "link", "run"), + when="~python", + ) pkg.depends_on("sigma+eigen", when="+sigma") diff --git a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py index 43c8bd4..675bd6c 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py @@ -60,11 +60,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( + "nwchemex-parallelzone~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-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/py_qcelemental/package.py b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py new file mode 100644 index 0000000..963d564 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py @@ -0,0 +1,92 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install py-qcelemental +# +# You can edit this file again by typing: +# +# spack edit py-qcelemental +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack_repo.builtin.build_systems.python import PythonPackage + +from spack import package as pkg + + +class PyQcelemental(PythonPackage): + """FIXME: Put a proper description of your package here.""" + + homepage = "https://github.com/MolSSI/QCElemental" + 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..e6b92b6 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/py_qcengine/package.py @@ -0,0 +1,90 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install py-qcengine +# +# You can edit this file again by typing: +# +# spack edit py-qcengine +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack_repo.builtin.build_systems.python import PythonPackage + +from spack import package as pkg + + +class PyQcengine(PythonPackage): + """QCEngine provides a wrapper to ingest and produce QCSchema for a variety + of quantum chemistry programs.""" + + homepage = "https://github.com/MolSSI/QCEngine" + 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"))