Skip to content

Commit 335ee21

Browse files
committed
backport weak attribute for cblas_xerbla
1 parent fa3b1cf commit 335ee21

6 files changed

+90
-4
lines changed

recipe/meta.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ source:
2727
- patches/0003-fixed-bug-in-array-bounds-in-complex-syl01-test.patch
2828
# backport https://github.com/Reference-LAPACK/lapack/pull/854, can be dropped for 3.12
2929
- patches/0004-Use-dynamic-allocation-in-SYL01-tests.patch
30+
# backport a commit for changes to cblas_xerbla (minus the cblas_f77.h formatting)
31+
# https://github.com/Reference-LAPACK/lapack/commit/e7afed35fb2ee3b82f34e324953b92f63883f670
32+
- patches/0005-Fixed-usage-of-HAS_ATTRIBUTE_WEAK_SUPPORT.patch
3033

3134
- url: https://github.com/isuruf/vecLibFort/archive/99af8640e98c829b41c3235e3706760cd5696fe4.tar.gz
3235
sha256: 80de7c6e83d1d84d016b4cb299f2c15f5a82b9d36865dd5c16bf221fe9a303ad

recipe/patches/0001-Test-BLAS-and-LAPACKE-in-addition-to-LAPACK.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 6ddc5a62badf0a2b4e1c29fd3ce32155985c1ba0 Mon Sep 17 00:00:00 2001
22
From: Isuru Fernando <[email protected]>
33
Date: Mon, 7 Jan 2019 00:23:59 -0600
4-
Subject: [PATCH 1/4] Test BLAS and LAPACKE in addition to LAPACK
4+
Subject: [PATCH 1/5] Test BLAS and LAPACKE in addition to LAPACK
55

66
---
77
CMakeLists.txt | 2 ++

recipe/patches/0002-read-pipe-as-binary.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From a3ed3013a70f8bc26b8dad6fe621b35c3011e99f Mon Sep 17 00:00:00 2001
22
From: "H. Vetinari" <[email protected]>
33
Date: Sun, 18 Aug 2024 14:03:42 +1100
4-
Subject: [PATCH 2/4] read pipe as binary
4+
Subject: [PATCH 2/5] read pipe as binary
55

66
---
77
lapack_testing.py | 16 ++++++++--------

recipe/patches/0003-fixed-bug-in-array-bounds-in-complex-syl01-test.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From ad2fce9c3ca932c75c18f49d778f9b2631636aab Mon Sep 17 00:00:00 2001
22
From: Dmitry Klyuchinsky <[email protected]>
33
Date: Fri, 18 Nov 2022 17:58:06 +0700
4-
Subject: [PATCH 3/4] fixed bug in array bounds in complex syl01 test
4+
Subject: [PATCH 3/5] fixed bug in array bounds in complex syl01 test
55

66
---
77
TESTING/EIG/csyl01.f | 2 +-

recipe/patches/0004-Use-dynamic-allocation-in-SYL01-tests.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From aee7578559a21752b7b13d7d644eede93835f0ad Mon Sep 17 00:00:00 2001
22
From: Angelika Schwarz <[email protected]>
33
Date: Sat, 17 Jun 2023 10:51:33 +0200
4-
Subject: [PATCH 4/4] Use dynamic allocation in SYL01 tests
4+
Subject: [PATCH 4/5] Use dynamic allocation in SYL01 tests
55

66
---
77
TESTING/EIG/csyl01.f | 33 ++++++++++++++++++++++++++++-----
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
From 4d6b6ada0e110243b006734229734b5201799aa7 Mon Sep 17 00:00:00 2001
2+
From: Simon Maertens <[email protected]>
3+
Date: Sat, 19 Nov 2022 21:25:15 +0100
4+
Subject: [PATCH 5/5] Fixed usage of `HAS_ATTRIBUTE_WEAK_SUPPORT`
5+
6+
---
7+
CBLAS/include/cblas.h | 6 +++++-
8+
CBLAS/testing/CMakeLists.txt | 24 ++++++++++++++++++++++++
9+
2 files changed, 29 insertions(+), 1 deletion(-)
10+
11+
diff --git a/CBLAS/include/cblas.h b/CBLAS/include/cblas.h
12+
index f7d411571..124baf17e 100644
13+
--- a/CBLAS/include/cblas.h
14+
+++ b/CBLAS/include/cblas.h
15+
@@ -608,7 +608,11 @@ void cblas_zher2k(CBLAS_LAYOUT layout, CBLAS_UPLO Uplo,
16+
const void *B, const CBLAS_INT ldb, const double beta,
17+
void *C, const CBLAS_INT ldc);
18+
19+
-void cblas_xerbla(CBLAS_INT p, const char *rout, const char *form, ...);
20+
+void
21+
+#ifdef HAS_ATTRIBUTE_WEAK_SUPPORT
22+
+__attribute__((weak))
23+
+#endif
24+
+cblas_xerbla(CBLAS_INT p, const char *rout, const char *form, ...);
25+
26+
#ifdef __cplusplus
27+
}
28+
diff --git a/CBLAS/testing/CMakeLists.txt b/CBLAS/testing/CMakeLists.txt
29+
index 9b8cfaeb1..a2a41e05e 100644
30+
--- a/CBLAS/testing/CMakeLists.txt
31+
+++ b/CBLAS/testing/CMakeLists.txt
32+
@@ -52,6 +52,12 @@ if(BUILD_SINGLE)
33+
add_executable(xscblat2 c_sblat2.f ${STESTL2O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
34+
add_executable(xscblat3 c_sblat3.f ${STESTL3O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
35+
36+
+ if(HAS_ATTRIBUTE_WEAK_SUPPORT)
37+
+ target_compile_definitions(xscblat1 PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
38+
+ target_compile_definitions(xscblat2 PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
39+
+ target_compile_definitions(xscblat3 PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
40+
+ endif()
41+
+
42+
target_link_libraries(xscblat1 ${CBLASLIB})
43+
target_link_libraries(xscblat2 ${CBLASLIB})
44+
target_link_libraries(xscblat3 ${CBLASLIB})
45+
@@ -66,6 +72,12 @@ if(BUILD_DOUBLE)
46+
add_executable(xdcblat2 c_dblat2.f ${DTESTL2O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
47+
add_executable(xdcblat3 c_dblat3.f ${DTESTL3O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
48+
49+
+ if(HAS_ATTRIBUTE_WEAK_SUPPORT)
50+
+ target_compile_definitions(xdcblat1 PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
51+
+ target_compile_definitions(xdcblat2 PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
52+
+ target_compile_definitions(xdcblat3 PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
53+
+ endif()
54+
+
55+
target_link_libraries(xdcblat1 ${CBLASLIB})
56+
target_link_libraries(xdcblat2 ${CBLASLIB})
57+
target_link_libraries(xdcblat3 ${CBLASLIB})
58+
@@ -80,6 +92,12 @@ if(BUILD_COMPLEX)
59+
add_executable(xccblat2 c_cblat2.f ${CTESTL2O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
60+
add_executable(xccblat3 c_cblat3.f ${CTESTL3O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
61+
62+
+ if(HAS_ATTRIBUTE_WEAK_SUPPORT)
63+
+ target_compile_definitions(xccblat1 PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
64+
+ target_compile_definitions(xccblat2 PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
65+
+ target_compile_definitions(xccblat3 PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
66+
+ endif()
67+
+
68+
target_link_libraries(xccblat1 ${CBLASLIB} ${BLAS_LIBRARIES})
69+
target_link_libraries(xccblat2 ${CBLASLIB})
70+
target_link_libraries(xccblat3 ${CBLASLIB})
71+
@@ -94,6 +112,12 @@ if(BUILD_COMPLEX16)
72+
add_executable(xzcblat2 c_zblat2.f ${ZTESTL2O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
73+
add_executable(xzcblat3 c_zblat3.f ${ZTESTL3O} ${LAPACK_BINARY_DIR}/test_include/cblas_test.h)
74+
75+
+ if(HAS_ATTRIBUTE_WEAK_SUPPORT)
76+
+ target_compile_definitions(xzcblat1 PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
77+
+ target_compile_definitions(xzcblat2 PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
78+
+ target_compile_definitions(xzcblat3 PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT)
79+
+ endif()
80+
+
81+
target_link_libraries(xzcblat1 ${CBLASLIB})
82+
target_link_libraries(xzcblat2 ${CBLASLIB})
83+
target_link_libraries(xzcblat3 ${CBLASLIB})

0 commit comments

Comments
 (0)