|
| 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