From a2cbc46dbc1a7ba3799d44c04c57060e80cd2180 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Fri, 2 Aug 2024 13:19:06 -0500 Subject: openblas: fix AttributeError when threads=openmp (#45338) --- var/spack/repos/builtin/packages/openblas/package.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 74961d16aa..ae9f2e6070 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -570,17 +570,19 @@ class MakefileBuilder(spack.build_systems.makefile.MakefileBuilder): # Openblas may pass its own test but still fail to compile Lapack # symbols. To make sure we get working Blas and Lapack, do a small # test. - source_file = join_path(os.path.dirname(self.module.__file__), "test_cblas_dgemm.c") - blessed_file = join_path(os.path.dirname(self.module.__file__), "test_cblas_dgemm.output") + source_file = join_path(os.path.dirname(self.pkg.module.__file__), "test_cblas_dgemm.c") + blessed_file = join_path( + os.path.dirname(self.pkg.module.__file__), "test_cblas_dgemm.output" + ) include_flags = spec["openblas"].headers.cpp_flags link_flags = spec["openblas"].libs.ld_flags - if self.compiler.name == "intel": + if self.pkg.compiler.name == "intel": link_flags += " -lifcore" if self.spec.satisfies("threads=pthreads"): link_flags += " -lpthread" if spec.satisfies("threads=openmp"): - link_flags += " -lpthread " + self.compiler.openmp_flag + link_flags += " -lpthread " + self.pkg.compiler.openmp_flag output = compile_c_and_execute(source_file, [include_flags], link_flags.split()) compare_output_file(output, blessed_file) -- cgit v1.2.3-70-g09d2