diff options
author | John W. Parent <45471568+johnwparent@users.noreply.github.com> | 2024-07-24 16:28:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-24 13:28:30 -0700 |
commit | e5364ea832abb7ed79f4cbdc7addf8afe6bb353f (patch) | |
tree | 563bcfe5ed48d033b6c45109ed4ba2008884201c | |
parent | 53b8f91c02b776190036b24146c6103d1dfc0dcc (diff) | |
download | spack-e5364ea832abb7ed79f4cbdc7addf8afe6bb353f.tar.gz spack-e5364ea832abb7ed79f4cbdc7addf8afe6bb353f.tar.bz2 spack-e5364ea832abb7ed79f4cbdc7addf8afe6bb353f.tar.xz spack-e5364ea832abb7ed79f4cbdc7addf8afe6bb353f.zip |
Netlib-lapack package: search for correct library names on Windows (#45417)
Library names on Windows are not typically prefixed with lib; the default
`.libs` implementation accounts for this, but `netlib-lapack` has a
custom implementation of `.libs` that did not account for this.
-rw-r--r-- | var/spack/repos/builtin/packages/netlib-lapack/package.py | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/var/spack/repos/builtin/packages/netlib-lapack/package.py b/var/spack/repos/builtin/packages/netlib-lapack/package.py index 1686a0a76a..20d9a0664f 100644 --- a/var/spack/repos/builtin/packages/netlib-lapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-lapack/package.py @@ -148,15 +148,22 @@ class NetlibLapack(CMakePackage): if self.spec.satisfies("platform=windows @0:3.9.1"): force_remove("LAPACKE/include/lapacke_mangling.h") + def xplatform_lib_name(self, lib): + return ( + "lib" + lib + if not lib.startswith("lib") and not self.spec.satisfies("platform=windows") + else lib + ) + @property def blas_libs(self): - shared = True if "+shared" in self.spec else False + shared = "+shared" in self.spec query_parameters = self.spec.last_query.extra_parameters query2libraries = { - tuple(): ["libblas"], - ("c", "fortran"): ["libcblas", "libblas"], - ("c",): ["libcblas"], - ("fortran",): ["libblas"], + tuple(): [self.xplatform_lib_name("blas")], + ("c", "fortran"): [self.xplatform_lib_name("cblas"), self.xplatform_lib_name("blas")], + ("c",): [self.xplatform_lib_name("cblas")], + ("fortran",): [self.xplatform_lib_name("blas")], } key = tuple(sorted(query_parameters)) libraries = query2libraries[key] @@ -167,10 +174,13 @@ class NetlibLapack(CMakePackage): shared = True if "+shared" in self.spec else False query_parameters = self.spec.last_query.extra_parameters query2libraries = { - tuple(): ["liblapack"], - ("c", "fortran"): ["liblapacke", "liblapack"], - ("c",): ["liblapacke"], - ("fortran",): ["liblapack"], + tuple(): [self.xplatform_lib_name("lapack")], + ("c", "fortran"): [ + self.xplatform_lib_name("lapacke"), + self.xplatform_lib_name("lapack"), + ], + ("c",): [self.xplatform_lib_name("lapacke")], + ("fortran",): [self.xplatform_lib_name("lapack")], } key = tuple(sorted(query_parameters)) libraries = query2libraries[key] |