adept: new package (#46793)

* added adept package

* forgot to remove boilerplate comment

* fixed formatting issue and use of lapack_prefix

* adept: use f-string

* removed debug variant and corresponding configure_args conditional

---------

Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
This commit is contained in:
Jason Hicken 2024-10-09 15:14:56 -04:00 committed by GitHub
parent 39ff675898
commit 3342866e0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,48 @@
# 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)
from spack.package import *
class Adept(AutotoolsPackage):
"""Combined array and automatic differentiation library in C++."""
homepage = "https://www.met.reading.ac.uk/clouds/adept/"
url = "https://www.met.reading.ac.uk/clouds/adept/adept-2.1.1.tar.gz"
maintainers("jehicken")
license("Apache-2.0", checked_by="jehicken")
version("2.1.1", sha256="0cef334e82df4526d3761bdd8319a63e7582c96b2f1cc88391729018b4825c47")
variant("blas", default=False, description="Enable Adept's native arrays using Openblas")
variant("lapack", default=False, description="Enable Adept's native arrays using Lapack")
depends_on("cxx", type="build")
depends_on("autoconf", type="build")
depends_on("automake", type="build")
depends_on("libtool", type="build")
depends_on("m4", type="build")
depends_on("openblas", when="+blas")
depends_on("netlib-lapack", when="+lapack")
def autoreconf(self, spec, prefix):
autoreconf("--install", "--verbose", "--force")
def configure_args(self):
args = []
if self.spec.satisfies("+blas"):
blas_prefix = self.spec["openblas"].prefix
args.append(f"--with-blas={blas_prefix}")
if self.spec.satisfies("+lapack"):
lapack_prefix = self.spec["netlib-lapack"].prefix
args.append(f"--with-lapack={lapack_prefix}")
return args