From 5090023e3a419e2b2543a815d262409afc7d797b Mon Sep 17 00:00:00 2001 From: Leopold Talirz Date: Wed, 23 Aug 2023 11:08:13 +0200 Subject: xtb: fix `la_backend` logic (#38309) --- var/spack/repos/builtin/packages/test-drive/package.py | 17 +++++++++++++++++ var/spack/repos/builtin/packages/xtb/package.py | 6 ++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 var/spack/repos/builtin/packages/test-drive/package.py diff --git a/var/spack/repos/builtin/packages/test-drive/package.py b/var/spack/repos/builtin/packages/test-drive/package.py new file mode 100644 index 0000000000..b5221570db --- /dev/null +++ b/var/spack/repos/builtin/packages/test-drive/package.py @@ -0,0 +1,17 @@ +# Copyright 2013-2023 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 TestDrive(MesonPackage): + """Simple testing framework for Fortran packages""" + + homepage = "https://github.com/fortran-lang/test-drive" + url = "https://github.com/fortran-lang/test-drive/releases/download/v0.4.0/test-drive-0.4.0.tar.xz" + + maintainers("awvwgk") + + version("0.4.0", "effabe5d46ea937a79f3ea8d37eea43caf38f9f1377398bad0ca02784235e54a") diff --git a/var/spack/repos/builtin/packages/xtb/package.py b/var/spack/repos/builtin/packages/xtb/package.py index 2bf378d6af..b93d10497e 100644 --- a/var/spack/repos/builtin/packages/xtb/package.py +++ b/var/spack/repos/builtin/packages/xtb/package.py @@ -23,9 +23,11 @@ class Xtb(MesonPackage): depends_on("meson@0.57.2:", type="build") depends_on("mctc-lib") depends_on("pkgconfig", type="build") - depends_on("tblite", when="@6.6.0:") + depends_on("tblite", when="+tblite") + depends_on("test-drive", type="build") variant("openmp", default=True, description="Use OpenMP parallelisation") + variant("tblite", default=True, when="@6.6.0:", description="Use tblite for xTB calculations") def meson_args(self): lapack = self.spec["lapack"].libs.names[0] @@ -34,7 +36,7 @@ class Xtb(MesonPackage): elif lapack != "openblas": lapack = "netlib" - lapack_opt = "-Dlapack={0}" if self.version > Version("6.6.0") else "-Dla_backend={0}" + lapack_opt = "-Dlapack={0}" if self.version >= Version("6.6.0") else "-Dla_backend={0}" return [ lapack_opt.format(lapack), -- cgit v1.2.3-70-g09d2