diff --git a/recipe/bld.bat b/recipe/bld.bat index d356c85..0f1bc90 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -1,5 +1,14 @@ @echo on +:: add CBLAS_DLL markers to RowMajorStrg/CBLAS_CallFromC in CBLAS/{src,testing} +for %%f in (CBLAS\src\*.c) do ( + sed -i.bak "s/extern int RowMajorStrg;/CBLAS_DLL extern int RowMajorStrg;/g" %%f + sed -i.bak "s/extern int CBLAS_CallFromC;/CBLAS_DLL extern int CBLAS_CallFromC;/g" %%f +) +for %%f in (CBLAS\testing\*.c) do ( + sed -i.bak "s/extern int RowMajorStrg;/CBLAS_DLL extern int RowMajorStrg;/g" %%f +) + mkdir build cd build @@ -7,6 +16,7 @@ cmake -G "Ninja" ^ -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ -DBUILD_SHARED_LIBS=yes ^ -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_SHARED_LIBRARY_PREFIX=lib ^ -DBUILD_TESTING=ON ^ -DLAPACKE=ON ^ -DCBLAS=ON ^ @@ -14,9 +24,18 @@ cmake -G "Ninja" ^ -Wno-dev .. ninja -j%CPU_COUNT% +if %ERRORLEVEL% NEQ 0 exit 1 + ninja install if %ERRORLEVEL% NEQ 0 exit 1 +:: strip "lib" prefix from import libraries, in line with previous naming +move %LIBRARY_LIB%\libblas.lib %LIBRARY_LIB%\blas.lib +move %LIBRARY_LIB%\libcblas.lib %LIBRARY_LIB%\cblas.lib +move %LIBRARY_LIB%\liblapack.lib %LIBRARY_LIB%\lapack.lib +move %LIBRARY_LIB%\liblapacke.lib %LIBRARY_LIB%\lapacke.lib +move %LIBRARY_LIB%\libtmglib.lib %LIBRARY_LIB%\tmglib.lib + :: testing with shared libraries does not work - skip them. :: This is because: to test that the program exits if wrong parameters are given, :: the testsuite overrides the symbol xerbla (xerbla logs the error and exits) with diff --git a/recipe/build.sh b/recipe/build.sh index 2e62d84..a84eeac 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -53,7 +53,7 @@ fi if [[ "${target_platform}" == osx-* ]]; then - for lib in blas cblas lapack lapacke; do + for lib in blas cblas lapack lapacke tmglib; do mv $PREFIX/lib/lib$lib.dylib $PREFIX/lib/lib$lib.$PKG_VERSION.dylib install_name_tool -id $PREFIX/lib/lib$lib.3.dylib $PREFIX/lib/lib$lib.$PKG_VERSION.dylib ln -s $PREFIX/lib/lib$lib.$PKG_VERSION.dylib $PREFIX/lib/lib$lib.dylib diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 6ab3334..a0d2fa0 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,6 +1,6 @@ {% set version = "3.11.0" %} # if build_num is reset to 0 (for new version), update increment for blas_minor below -{% set build_num = 6 %} +{% set build_num = 7 %} {% set version_major = version.split(".")[0] %} {% set version_minor = version.split(".")[1] %} # blas_major denotes major infrastructural change to how blas is managed @@ -25,11 +25,11 @@ source: sha256: 4b9ba79bfd4921ca820e83979db76ab3363155709444a787979e81c22285ffa9 patches: # Avoid setting current_version and compatibility_version - - patches/0001-Avoid-setting-current_version-and-compatibility_vers.patch # [osx] - # avoid linker errors on windows - - patches/0002-don-t-declare-RowMajorStrg-as-extern-on-windows.patch # [win] - # make xerbla-shenanigans work on windows - - patches/0003-use-__declspec-selectany-for-cblas_xerbla-s-RowMajor.patch # [win] + - patches/0001-Avoid-setting-current_version-and-compatibility_vers.patch + # backport https://github.com/Reference-LAPACK/lapack/pull/810 + - patches/0002-cmake-allow-setting-a-prefix-for-the-library-names.patch + # make symbol RowMajorStrg visible through DLL boundary + - patches/0003-add-DLL-import-export-machinery-for-RowMajorStrg.patch build: number: {{ build_num }} @@ -39,9 +39,10 @@ requirements: - {{ stdlib("c") }} - {{ compiler("c") }} - {{ compiler("fortran") }} - - ninja # [win] - - make # [unix] - cmake <4 + - make # [unix] + - ninja # [win] + - m2-sed # [win] outputs: - name: libblas @@ -69,7 +70,7 @@ outputs: - lib/libblas.dylib # [osx] - lib/libblas.{{ version_major }}.dylib # [osx] - lib/libblas.{{ version }}.dylib # [osx] - - Library/bin/blas.dll # [win] + - Library/bin/libblas.dll # [win] - Library/lib/blas.lib # [win] test: commands: @@ -103,7 +104,7 @@ outputs: - lib/libtmglib.dylib # [osx] - lib/libtmglib.{{ version_major }}.dylib # [osx] - lib/libtmglib.{{ version }}.dylib # [osx] - - Library/bin/tmglib.dll # [win] + - Library/bin/libtmglib.dll # [win] - Library/lib/tmglib.lib # [win] test: commands: @@ -136,7 +137,7 @@ outputs: - lib/libcblas.dylib # [osx] - lib/libcblas.{{ version_major }}.dylib # [osx] - lib/libcblas.{{ version }}.dylib # [osx] - - Library/bin/cblas.dll # [win] + - Library/bin/libcblas.dll # [win] - Library/lib/cblas.lib # [win] test: commands: @@ -168,7 +169,7 @@ outputs: - lib/liblapack.dylib # [osx] - lib/liblapack.{{ version_major }}.dylib # [osx] - lib/liblapack.{{ version }}.dylib # [osx] - - Library/bin/lapack.dll # [win] + - Library/bin/liblapack.dll # [win] - Library/lib/lapack.lib # [win] test: commands: @@ -203,7 +204,7 @@ outputs: - lib/liblapacke.dylib # [osx] - lib/liblapacke.{{ version_major }}.dylib # [osx] - lib/liblapacke.{{ version }}.dylib # [osx] - - Library/bin/lapacke.dll # [win] + - Library/bin/liblapacke.dll # [win] - Library/lib/lapacke.lib # [win] test: commands: @@ -252,7 +253,7 @@ outputs: - test -f $PREFIX/lib/pkgconfig/{{ each_lib }}.pc # [unix] - if not exist %LIBRARY_LIB%\pkgconfig\{{ each_lib }}.pc exit 1 # [win] - if not exist %LIBRARY_LIB%\{{ each_lib }}.lib exit 1 # [win] - - if not exist %LIBRARY_BIN%\{{ each_lib }}.dll exit 1 # [win] + - if not exist %LIBRARY_BIN%\lib{{ each_lib }}.dll exit 1 # [win] {% endfor %} # For compatiblity (see #33) diff --git a/recipe/patches/0001-Avoid-setting-current_version-and-compatibility_vers.patch b/recipe/patches/0001-Avoid-setting-current_version-and-compatibility_vers.patch index 8b0415a..94ddfb1 100644 --- a/recipe/patches/0001-Avoid-setting-current_version-and-compatibility_vers.patch +++ b/recipe/patches/0001-Avoid-setting-current_version-and-compatibility_vers.patch @@ -1,21 +1,24 @@ -From fe9cd54aaef1578716b3eadbaf72cc6cf560b68c Mon Sep 17 00:00:00 2001 +From 74c8f25b773eb356c54e502175418495b36535b3 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 22 Nov 2018 19:39:51 -0600 Subject: [PATCH 1/3] Avoid setting current_version and compatibility_version on OSX +To facilitate the switching of implementations, avoid these appearing +in libblas.dylib etc., so that downstream consumers don't record them. --- - BLAS/SRC/CMakeLists.txt | 5 ----- - CBLAS/src/CMakeLists.txt | 2 -- - LAPACKE/CMakeLists.txt | 2 -- - SRC/CMakeLists.txt | 5 ----- - 4 files changed, 14 deletions(-) + BLAS/SRC/CMakeLists.txt | 10 ++++++---- + CBLAS/src/CMakeLists.txt | 9 +++++++-- + LAPACKE/CMakeLists.txt | 9 +++++++-- + SRC/CMakeLists.txt | 10 ++++++---- + TESTING/MATGEN/CMakeLists.txt | 12 +++++++----- + 5 files changed, 33 insertions(+), 17 deletions(-) diff --git a/BLAS/SRC/CMakeLists.txt b/BLAS/SRC/CMakeLists.txt -index 4e5894f4d..e89b73495 100644 +index 4e5894f4d..ef7f13ca6 100644 --- a/BLAS/SRC/CMakeLists.txt +++ b/BLAS/SRC/CMakeLists.txt -@@ -110,11 +110,6 @@ endif() +@@ -110,11 +110,13 @@ endif() list(REMOVE_DUPLICATES SOURCES) add_library(${BLASLIB} ${SOURCES}) @@ -23,41 +26,63 @@ index 4e5894f4d..e89b73495 100644 - ${BLASLIB} PROPERTIES - VERSION ${LAPACK_VERSION} - SOVERSION ${LAPACK_MAJOR_VERSION} -- ) ++if(NOT APPLE) ++ set_target_properties( ++ ${BLASLIB} PROPERTIES ++ VERSION ${LAPACK_VERSION} ++ SOVERSION ${LAPACK_MAJOR_VERSION} + ) ++endif() lapack_install_library(${BLASLIB}) if( TEST_FORTRAN_COMPILER ) diff --git a/CBLAS/src/CMakeLists.txt b/CBLAS/src/CMakeLists.txt -index a8152297a..fc09e98f2 100644 +index a8152297a..aded4feec 100644 --- a/CBLAS/src/CMakeLists.txt +++ b/CBLAS/src/CMakeLists.txt -@@ -121,8 +121,6 @@ add_library(${CBLASLIB} ${SOURCES}) +@@ -121,9 +121,14 @@ add_library(${CBLASLIB} ${SOURCES}) set_target_properties( ${CBLASLIB} PROPERTIES LINKER_LANGUAGE C - VERSION ${LAPACK_VERSION} - SOVERSION ${LAPACK_MAJOR_VERSION} ++) ++if(NOT APPLE) ++ set_target_properties( ++ ${CBLASLIB} PROPERTIES ++ VERSION ${LAPACK_VERSION} ++ SOVERSION ${LAPACK_MAJOR_VERSION} ) ++endif() if(HAS_ATTRIBUTE_WEAK_SUPPORT) target_compile_definitions(${CBLASLIB} PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT) + endif() diff --git a/LAPACKE/CMakeLists.txt b/LAPACKE/CMakeLists.txt -index e78079c0e..3b990fd2a 100644 +index e78079c0e..eb3bb4d29 100644 --- a/LAPACKE/CMakeLists.txt +++ b/LAPACKE/CMakeLists.txt -@@ -92,8 +92,6 @@ add_library(${LAPACKELIB} ${SOURCES}) +@@ -92,9 +92,14 @@ add_library(${LAPACKELIB} ${SOURCES}) set_target_properties( ${LAPACKELIB} PROPERTIES LINKER_LANGUAGE C - VERSION ${LAPACK_VERSION} - SOVERSION ${LAPACK_MAJOR_VERSION} ++) ++if(NOT APPLE) ++ set_target_properties( ++ ${LAPACKELIB} PROPERTIES ++ VERSION ${LAPACK_VERSION} ++ SOVERSION ${LAPACK_MAJOR_VERSION} ) ++endif() target_include_directories(${LAPACKELIB} PUBLIC $ + $ diff --git a/SRC/CMakeLists.txt b/SRC/CMakeLists.txt -index 5d2e07258..2b5d1f423 100644 +index 5d2e07258..c10ba7b9d 100644 --- a/SRC/CMakeLists.txt +++ b/SRC/CMakeLists.txt -@@ -515,11 +515,6 @@ endif() +@@ -515,11 +515,13 @@ endif() list(REMOVE_DUPLICATES SOURCES) add_library(${LAPACKLIB} ${SOURCES}) @@ -65,7 +90,36 @@ index 5d2e07258..2b5d1f423 100644 - ${LAPACKLIB} PROPERTIES - VERSION ${LAPACK_VERSION} - SOVERSION ${LAPACK_MAJOR_VERSION} -- ) ++if(NOT APPLE) ++ set_target_properties( ++ ${LAPACKLIB} PROPERTIES ++ VERSION ${LAPACK_VERSION} ++ SOVERSION ${LAPACK_MAJOR_VERSION} + ) ++endif() if( TEST_FORTRAN_COMPILER ) add_dependencies( ${LAPACKLIB} run_test_zcomplexabs run_test_zcomplexdiv run_test_zcomplexmult run_test_zminMax ) +diff --git a/TESTING/MATGEN/CMakeLists.txt b/TESTING/MATGEN/CMakeLists.txt +index 0b3f89ed2..4a1297a20 100644 +--- a/TESTING/MATGEN/CMakeLists.txt ++++ b/TESTING/MATGEN/CMakeLists.txt +@@ -49,11 +49,13 @@ list(REMOVE_DUPLICATES SOURCES) + + add_library(${TMGLIB} ${SOURCES}) + +-set_target_properties( +- ${TMGLIB} PROPERTIES +- VERSION ${LAPACK_VERSION} +- SOVERSION ${LAPACK_MAJOR_VERSION} +-) ++if(NOT APPLE) ++ set_target_properties( ++ ${TMGLIB} PROPERTIES ++ VERSION ${LAPACK_VERSION} ++ SOVERSION ${LAPACK_MAJOR_VERSION} ++ ) ++endif() + + target_link_libraries(${TMGLIB} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}) + lapack_install_library(${TMGLIB}) diff --git a/recipe/patches/0002-cmake-allow-setting-a-prefix-for-the-library-names.patch b/recipe/patches/0002-cmake-allow-setting-a-prefix-for-the-library-names.patch new file mode 100644 index 0000000..1795119 --- /dev/null +++ b/recipe/patches/0002-cmake-allow-setting-a-prefix-for-the-library-names.patch @@ -0,0 +1,24 @@ +From 38f4f68a123d443b06951f4b5de4f694ba3f35b7 Mon Sep 17 00:00:00 2001 +From: "Jose E. Roman" +Date: Sat, 1 Apr 2023 11:07:38 +0200 +Subject: [PATCH 2/3] cmake: allow setting a prefix for the library names + +--- + CMakeLists.txt | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 68a7767b8..d2baecd11 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -10,6 +10,10 @@ set( + ${LAPACK_MAJOR_VERSION}.${LAPACK_MINOR_VERSION}.${LAPACK_PATCH_VERSION} + ) + ++# Allow setting a prefix for the library names ++set(CMAKE_STATIC_LIBRARY_PREFIX "lib${LIBRARY_PREFIX}") ++set(CMAKE_SHARED_LIBRARY_PREFIX "lib${LIBRARY_PREFIX}") ++ + # Add the CMake directory for custom CMake modules + set(CMAKE_MODULE_PATH "${LAPACK_SOURCE_DIR}/CMAKE" ${CMAKE_MODULE_PATH}) + diff --git a/recipe/patches/0002-don-t-declare-RowMajorStrg-as-extern-on-windows.patch b/recipe/patches/0002-don-t-declare-RowMajorStrg-as-extern-on-windows.patch deleted file mode 100644 index 15c0c7f..0000000 --- a/recipe/patches/0002-don-t-declare-RowMajorStrg-as-extern-on-windows.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 835b924e4874774129a9452934bd5508fb96db04 Mon Sep 17 00:00:00 2001 -From: "H. Vetinari" -Date: Sat, 26 Oct 2024 20:13:34 +1100 -Subject: [PATCH 2/3] don't declare RowMajorStrg as extern on windows - -on platforms with HAS_ATTRIBUTE_WEAK_SUPPORT, this presumably plays a role in -the linker shenanigans with cblas_xerbla, but on windows it just blows up ---- - CBLAS/testing/c_c2chke.c | 2 +- - CBLAS/testing/c_c3chke.c | 2 +- - CBLAS/testing/c_d2chke.c | 2 +- - CBLAS/testing/c_d3chke.c | 2 +- - CBLAS/testing/c_s2chke.c | 2 +- - CBLAS/testing/c_s3chke.c | 2 +- - CBLAS/testing/c_z2chke.c | 2 +- - CBLAS/testing/c_z3chke.c | 2 +- - 8 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/CBLAS/testing/c_c2chke.c b/CBLAS/testing/c_c2chke.c -index 33a0261f5..fb8656f57 100644 ---- a/CBLAS/testing/c_c2chke.c -+++ b/CBLAS/testing/c_c2chke.c -@@ -33,7 +33,7 @@ void F77_c2chke(char *rout) { - BETA[2] = {0.0,0.0}, - RALPHA = 0.0; - extern int cblas_info, cblas_lerr, cblas_ok; -- extern int RowMajorStrg; -+ int RowMajorStrg = TRUE; - extern char *cblas_rout; - - #ifndef HAS_ATTRIBUTE_WEAK_SUPPORT -diff --git a/CBLAS/testing/c_c3chke.c b/CBLAS/testing/c_c3chke.c -index 7057c7a2c..cfe433c88 100644 ---- a/CBLAS/testing/c_c3chke.c -+++ b/CBLAS/testing/c_c3chke.c -@@ -33,7 +33,7 @@ void F77_c3chke(char * rout) { - BETA[2] = {0.0,0.0}, - RALPHA = 0.0, RBETA = 0.0; - extern int cblas_info, cblas_lerr, cblas_ok; -- extern int RowMajorStrg; -+ int RowMajorStrg = TRUE; - extern char *cblas_rout; - - cblas_ok = TRUE ; -diff --git a/CBLAS/testing/c_d2chke.c b/CBLAS/testing/c_d2chke.c -index 73e8aceec..f58501fb5 100644 ---- a/CBLAS/testing/c_d2chke.c -+++ b/CBLAS/testing/c_d2chke.c -@@ -31,7 +31,7 @@ void F77_d2chke(char *rout) { - Y[2] = {0.0,0.0}, - ALPHA=0.0, BETA=0.0; - extern int cblas_info, cblas_lerr, cblas_ok; -- extern int RowMajorStrg; -+ int RowMajorStrg = TRUE; - extern char *cblas_rout; - - #ifndef HAS_ATTRIBUTE_WEAK_SUPPORT -diff --git a/CBLAS/testing/c_d3chke.c b/CBLAS/testing/c_d3chke.c -index 9a1ba3cc5..66f85666a 100644 ---- a/CBLAS/testing/c_d3chke.c -+++ b/CBLAS/testing/c_d3chke.c -@@ -31,7 +31,7 @@ void F77_d3chke(char *rout) { - C[2] = {0.0,0.0}, - ALPHA=0.0, BETA=0.0; - extern int cblas_info, cblas_lerr, cblas_ok; -- extern int RowMajorStrg; -+ int RowMajorStrg = TRUE; - extern char *cblas_rout; - - #ifndef HAS_ATTRIBUTE_WEAK_SUPPORT -diff --git a/CBLAS/testing/c_s2chke.c b/CBLAS/testing/c_s2chke.c -index a781bd505..4ca0941cc 100644 ---- a/CBLAS/testing/c_s2chke.c -+++ b/CBLAS/testing/c_s2chke.c -@@ -31,7 +31,7 @@ void F77_s2chke(char *rout) { - Y[2] = {0.0,0.0}, - ALPHA=0.0, BETA=0.0; - extern int cblas_info, cblas_lerr, cblas_ok; -- extern int RowMajorStrg; -+ int RowMajorStrg = TRUE; - extern char *cblas_rout; - - #ifndef HAS_ATTRIBUTE_WEAK_SUPPORT -diff --git a/CBLAS/testing/c_s3chke.c b/CBLAS/testing/c_s3chke.c -index 425d6a702..135ee32ac 100644 ---- a/CBLAS/testing/c_s3chke.c -+++ b/CBLAS/testing/c_s3chke.c -@@ -31,7 +31,7 @@ void F77_s3chke(char *rout) { - C[2] = {0.0,0.0}, - ALPHA=0.0, BETA=0.0; - extern int cblas_info, cblas_lerr, cblas_ok; -- extern int RowMajorStrg; -+ int RowMajorStrg = TRUE; - extern char *cblas_rout; - - #ifndef HAS_ATTRIBUTE_WEAK_SUPPORT -diff --git a/CBLAS/testing/c_z2chke.c b/CBLAS/testing/c_z2chke.c -index 65e552da3..712200177 100644 ---- a/CBLAS/testing/c_z2chke.c -+++ b/CBLAS/testing/c_z2chke.c -@@ -33,7 +33,7 @@ void F77_z2chke(char *rout) { - BETA[2] = {0.0,0.0}, - RALPHA = 0.0; - extern int cblas_info, cblas_lerr, cblas_ok; -- extern int RowMajorStrg; -+ int RowMajorStrg = TRUE; - extern char *cblas_rout; - - #ifndef HAS_ATTRIBUTE_WEAK_SUPPORT -diff --git a/CBLAS/testing/c_z3chke.c b/CBLAS/testing/c_z3chke.c -index 30840489a..bb996a0af 100644 ---- a/CBLAS/testing/c_z3chke.c -+++ b/CBLAS/testing/c_z3chke.c -@@ -33,7 +33,7 @@ void F77_z3chke(char * rout) { - BETA[2] = {0.0,0.0}, - RALPHA = 0.0, RBETA = 0.0; - extern int cblas_info, cblas_lerr, cblas_ok; -- extern int RowMajorStrg; -+ int RowMajorStrg = TRUE; - extern char *cblas_rout; - - cblas_ok = TRUE ; diff --git a/recipe/patches/0003-add-DLL-import-export-machinery-for-RowMajorStrg.patch b/recipe/patches/0003-add-DLL-import-export-machinery-for-RowMajorStrg.patch new file mode 100644 index 0000000..fe78a9c --- /dev/null +++ b/recipe/patches/0003-add-DLL-import-export-machinery-for-RowMajorStrg.patch @@ -0,0 +1,61 @@ +From 686995b99f1d8dc1984a2ed96e1932a085dd2ff0 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Fri, 8 Nov 2024 14:35:19 +1100 +Subject: [PATCH 3/3] add DLL import/export machinery for RowMajorStrg + +Suggested-By: Isuru Fernando +--- + CBLAS/include/cblas.h | 9 +++++++++ + CBLAS/src/CMakeLists.txt | 3 +++ + CBLAS/src/cblas_globals.c | 10 ++++++++-- + 3 files changed, 20 insertions(+), 2 deletions(-) + +diff --git a/CBLAS/include/cblas.h b/CBLAS/include/cblas.h +index f7d411571..4ac2d7793 100644 +--- a/CBLAS/include/cblas.h ++++ b/CBLAS/include/cblas.h +@@ -4,6 +4,15 @@ + #include + #include + ++#ifdef _MSC_VER ++# ifdef CBLAS_BUILDING_DLL ++# define CBLAS_DLL __declspec(dllexport) ++# else ++# define CBLAS_DLL __declspec(dllimport) ++# endif ++#else ++# define CBLAS_DLL ++#endif + + #ifdef __cplusplus + extern "C" { /* Assume C declarations for C++ */ +diff --git a/CBLAS/src/CMakeLists.txt b/CBLAS/src/CMakeLists.txt +index aded4feec..b1c6318bf 100644 +--- a/CBLAS/src/CMakeLists.txt ++++ b/CBLAS/src/CMakeLists.txt +@@ -129,6 +129,9 @@ if(NOT APPLE) + SOVERSION ${LAPACK_MAJOR_VERSION} + ) + endif() ++if(BUILD_SHARED_LIBS) ++ target_compile_definitions(cblas PRIVATE CBLAS_BUILDING_DLL) ++endif() + if(HAS_ATTRIBUTE_WEAK_SUPPORT) + target_compile_definitions(${CBLASLIB} PRIVATE HAS_ATTRIBUTE_WEAK_SUPPORT) + endif() +diff --git a/CBLAS/src/cblas_globals.c b/CBLAS/src/cblas_globals.c +index 5d91a18c9..b7bf74e23 100644 +--- a/CBLAS/src/cblas_globals.c ++++ b/CBLAS/src/cblas_globals.c +@@ -1,2 +1,8 @@ +- int CBLAS_CallFromC=0; +- int RowMajorStrg=0; ++#ifdef _MSC_VER ++# define CBLAS_DLL __declspec(dllexport) ++#else ++# define CBLAS_DLL ++#endif ++ ++CBLAS_DLL int CBLAS_CallFromC=0; ++CBLAS_DLL int RowMajorStrg=0; diff --git a/recipe/patches/0003-use-__declspec-selectany-for-cblas_xerbla-s-RowMajor.patch b/recipe/patches/0003-use-__declspec-selectany-for-cblas_xerbla-s-RowMajor.patch deleted file mode 100644 index d41918c..0000000 --- a/recipe/patches/0003-use-__declspec-selectany-for-cblas_xerbla-s-RowMajor.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 873da7545d4622ed403011ac38222b7fb7cbe43e Mon Sep 17 00:00:00 2001 -From: "H. Vetinari" -Date: Sun, 27 Oct 2024 00:15:33 +1100 -Subject: [PATCH 3/3] use __declspec(selectany) for cblas_xerbla's RowMajorStrg - on windows - ---- - CBLAS/testing/c_xerbla.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CBLAS/testing/c_xerbla.c b/CBLAS/testing/c_xerbla.c -index c3f14c364..313c2a0e3 100644 ---- a/CBLAS/testing/c_xerbla.c -+++ b/CBLAS/testing/c_xerbla.c -@@ -9,7 +9,7 @@ void cblas_xerbla(CBLAS_INT info, const char *rout, const char *form, ...) - { - extern int cblas_lerr, cblas_info, cblas_ok; - extern int link_xerbla; -- extern int RowMajorStrg; -+ extern __declspec(selectany) int RowMajorStrg; - extern char *cblas_rout; - - /* Initially, c__3chke may call this routine with