From 1488c09a1e0e862cf599d3d26255ae36c8132174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sat, 3 Sep 2022 12:45:02 +0100 Subject: [PATCH] [OpenBLAS] Update to v0.3.21 (#5414) * [OpenBLAS] Update to v0.3.21 * [OpenBLAS] Need to push the new platform before using `platforms` * [OpenBLAS] Add patch which may fix issue with building C tests for FreeBSD --- .../OpenBLAS32@0.3.21/build_tarballs.jl | 17 ++ ...ts-when-NOFORTRAN-is-not-given-at-al.patch | 43 +++++ .../patches/neoverse-generic-kernels.patch | 19 ++ .../patches/openblas-ofast-power.patch | 31 ++++ .../bundled/patches/openblas-winexit.patch | 170 ++++++++++++++++++ O/OpenBLAS/OpenBLAS@0.3.21/build_tarballs.jl | 18 ++ ...ts-when-NOFORTRAN-is-not-given-at-al.patch | 43 +++++ .../patches/neoverse-generic-kernels.patch | 19 ++ .../patches/openblas-ofast-power.patch | 31 ++++ .../bundled/patches/openblas-winexit.patch | 170 ++++++++++++++++++ O/OpenBLAS/common.jl | 11 +- 11 files changed, 569 insertions(+), 3 deletions(-) create mode 100644 O/OpenBLAS/OpenBLAS32@0.3.21/build_tarballs.jl create mode 100644 O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/0001-Fix-building-tests-when-NOFORTRAN-is-not-given-at-al.patch create mode 100644 O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/neoverse-generic-kernels.patch create mode 100644 O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/openblas-ofast-power.patch create mode 100644 O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/openblas-winexit.patch create mode 100644 O/OpenBLAS/OpenBLAS@0.3.21/build_tarballs.jl create mode 100644 O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/0001-Fix-building-tests-when-NOFORTRAN-is-not-given-at-al.patch create mode 100644 O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/neoverse-generic-kernels.patch create mode 100644 O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/openblas-ofast-power.patch create mode 100644 O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/openblas-winexit.patch diff --git a/O/OpenBLAS/OpenBLAS32@0.3.21/build_tarballs.jl b/O/OpenBLAS/OpenBLAS32@0.3.21/build_tarballs.jl new file mode 100644 index 00000000000..aaa3c7c31c9 --- /dev/null +++ b/O/OpenBLAS/OpenBLAS32@0.3.21/build_tarballs.jl @@ -0,0 +1,17 @@ +using BinaryBuilder + +include("../common.jl") + +# Collection of sources required to build OpenBLAS +name = "OpenBLAS32" +version = v"0.3.21" + +sources = openblas_sources(version) +script = openblas_script(openblas32=true) +platforms = openblas_platforms() +products = openblas_products() +dependencies = openblas_dependencies(platforms) + +# Build the tarballs +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; + preferred_gcc_version=v"6", lock_microarchitecture=false, julia_compat="1.9") diff --git a/O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/0001-Fix-building-tests-when-NOFORTRAN-is-not-given-at-al.patch b/O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/0001-Fix-building-tests-when-NOFORTRAN-is-not-given-at-al.patch new file mode 100644 index 00000000000..c4e1b738a9a --- /dev/null +++ b/O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/0001-Fix-building-tests-when-NOFORTRAN-is-not-given-at-al.patch @@ -0,0 +1,43 @@ +From d54971fe20a355d225e304cdf8606818675050ce Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Mon, 8 Aug 2022 11:20:38 -0500 +Subject: [PATCH 1/1] Fix building tests when NOFORTRAN is not given at all + +--- + ctest/Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/ctest/Makefile b/ctest/Makefile +index 236913c3..0fb2450d 100644 +--- a/ctest/Makefile ++++ b/ctest/Makefile +@@ -237,7 +237,7 @@ endif + + ifeq ($(BUILD_DOUBLE),1) + # Double real +-ifeq ($(NOFORTRAN),0) ++ifeq ($(NOFORTRAN), $(filter 0 2,$(NOFORTRAN))) + xdcblat1: $(dtestl1o) c_dblat1.o $(TOPDIR)/$(LIBNAME) + $(FC) $(FLDFLAGS) -o xdcblat1 c_dblat1.o $(dtestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB) + xdcblat2: $(dtestl2o) c_dblat2.o $(TOPDIR)/$(LIBNAME) +@@ -256,7 +256,7 @@ endif + + ifeq ($(BUILD_COMPLEX),1) + # Single complex +-ifeq ($(NOFORTRAN),0) ++ifeq ($(NOFORTRAN), $(filter 0 2,$(NOFORTRAN))) + xccblat1: $(ctestl1o) c_cblat1.o $(TOPDIR)/$(LIBNAME) + $(FC) $(FLDFLAGS) -o xccblat1 c_cblat1.o $(ctestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB) + xccblat2: $(ctestl2o) c_cblat2.o $(TOPDIR)/$(LIBNAME) +@@ -278,7 +278,7 @@ endif + + ifeq ($(BUILD_COMPLEX16),1) + # Double complex +-ifeq ($(NOFORTRAN),0) ++ifeq ($(NOFORTRAN), $(filter 0 2,$(NOFORTRAN))) + xzcblat1: $(ztestl1o) c_zblat1.o $(TOPDIR)/$(LIBNAME) + $(FC) $(FLDFLAGS) -o xzcblat1 c_zblat1.o $(ztestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB) + xzcblat2: $(ztestl2o) c_zblat2.o $(TOPDIR)/$(LIBNAME) +-- +2.37.2 + diff --git a/O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/neoverse-generic-kernels.patch b/O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/neoverse-generic-kernels.patch new file mode 100644 index 00000000000..ab37e3783bf --- /dev/null +++ b/O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/neoverse-generic-kernels.patch @@ -0,0 +1,19 @@ +diff --git a/kernel/arm64/KERNEL.NEOVERSEN1 b/kernel/arm64/KERNEL.NEOVERSEN1 +index ea010db4..074d7215 100644 +--- a/kernel/arm64/KERNEL.NEOVERSEN1 ++++ b/kernel/arm64/KERNEL.NEOVERSEN1 +@@ -91,10 +91,10 @@ IDAMAXKERNEL = iamax_thunderx2t99.c + ICAMAXKERNEL = izamax_thunderx2t99.c + IZAMAXKERNEL = izamax_thunderx2t99.c + +-SNRM2KERNEL = scnrm2_thunderx2t99.c +-DNRM2KERNEL = dznrm2_thunderx2t99.c +-CNRM2KERNEL = scnrm2_thunderx2t99.c +-ZNRM2KERNEL = dznrm2_thunderx2t99.c ++SNRM2KERNEL = nrm2.S ++DNRM2KERNEL = nrm2.S ++CNRM2KERNEL = znrm2.S ++ZNRM2KERNEL = znrm2.S + + DDOTKERNEL = dot_thunderx2t99.c + SDOTKERNEL = dot_thunderx2t99.c diff --git a/O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/openblas-ofast-power.patch b/O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/openblas-ofast-power.patch new file mode 100644 index 00000000000..405e3f75813 --- /dev/null +++ b/O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/openblas-ofast-power.patch @@ -0,0 +1,31 @@ +diff --git a/Makefile.power b/Makefile.power +index 28a0bae0..b4869fbd 100644 +--- a/Makefile.power ++++ b/Makefile.power +@@ -11,7 +11,7 @@ endif + + ifeq ($(CORE), POWER10) + ifneq ($(C_COMPILER), PGI) +-CCOMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math ++CCOMMON_OPT += -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math + ifeq ($(F_COMPILER), IBM) + FCOMMON_OPT += -O2 -qrecur -qnosave + else +@@ -22,7 +22,7 @@ endif + + ifeq ($(CORE), POWER9) + ifneq ($(C_COMPILER), PGI) +-CCOMMON_OPT += -Ofast -mvsx -fno-fast-math ++CCOMMON_OPT += -mvsx -fno-fast-math + ifeq ($(C_COMPILER), GCC) + ifneq ($(GCCVERSIONGT4), 1) + $(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended) +@@ -59,7 +59,7 @@ endif + + ifeq ($(CORE), POWER8) + ifneq ($(C_COMPILER), PGI) +-CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math ++CCOMMON_OPT += -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math + else + CCOMMON_OPT += -fast -Mvect=simd -Mcache_align + endif diff --git a/O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/openblas-winexit.patch b/O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/openblas-winexit.patch new file mode 100644 index 00000000000..33389f34a40 --- /dev/null +++ b/O/OpenBLAS/OpenBLAS32@0.3.21/bundled/patches/openblas-winexit.patch @@ -0,0 +1,170 @@ +diff --git a/driver/others/memory.c b/driver/others/memory.c +index 6e654ccf..1d2f9f12 100644 +--- a/driver/others/memory.c ++++ b/driver/others/memory.c +@@ -1534,7 +1534,7 @@ void CONSTRUCTOR gotoblas_init(void) { + + } + +-void DESTRUCTOR gotoblas_quit(void) { ++void gotoblas_quit(void) { + + if (gotoblas_initialized == 0) return; + +@@ -1572,75 +1572,11 @@ void DESTRUCTOR gotoblas_quit(void) { + } + + #if defined(_MSC_VER) && !defined(__clang__) +-BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) +-{ +- switch (ul_reason_for_call) +- { +- case DLL_PROCESS_ATTACH: +- gotoblas_init(); +- break; +- case DLL_THREAD_ATTACH: +- break; +- case DLL_THREAD_DETACH: +-#if defined(SMP) +- blas_thread_memory_cleanup(); +-#endif +- break; +- case DLL_PROCESS_DETACH: +- gotoblas_quit(); +- break; +- default: +- break; +- } +- return TRUE; +-} +- +-/* +- This is to allow static linking. +- Code adapted from Google performance tools: +- https://gperftools.googlecode.com/git-history/perftools-1.0/src/windows/port.cc +- Reference: +- https://sourceware.org/ml/pthreads-win32/2008/msg00028.html +- http://ci.boost.org/svn-trac/browser/trunk/libs/thread/src/win32/tss_pe.cpp +-*/ +-static int on_process_term(void) +-{ +- gotoblas_quit(); +- return 0; +-} + #ifdef _WIN64 + #pragma comment(linker, "/INCLUDE:_tls_used") + #else + #pragma comment(linker, "/INCLUDE:__tls_used") + #endif +- +-#ifdef _WIN64 +-#pragma const_seg(".CRT$XLB") +-#else +-#pragma data_seg(".CRT$XLB") +-#endif +- +-#ifdef _WIN64 +-static const PIMAGE_TLS_CALLBACK dll_callback(HINSTANCE h, DWORD ul_reason_for_call, PVOID pv) = DllMain; +-#pragma const_seg() +-#else +-static void (APIENTRY *dll_callback)(HINSTANCE h, DWORD ul_reason_for_call, PVOID pv) = DllMain; +-#pragma data_seg() +-#endif +- +-#ifdef _WIN64 +-#pragma const_seg(".CRT$XTU") +-#else +-#pragma data_seg(".CRT$XTU") +-#endif +- +-#ifdef _WIN64 +-static const int(*p_process_term)(void) = on_process_term; +-#pragma const_seg() +-#else +-static int(*p_process_term)(void) = on_process_term; +-#pragma data_seg() +-#endif + #endif + + #if (defined(C_PGI) || (!defined(C_SUN) && defined(F_INTERFACE_SUN))) && (defined(ARCH_X86) || defined(ARCH_X86_64)) +@@ -3146,7 +3082,7 @@ void CONSTRUCTOR gotoblas_init(void) { + + } + +-void DESTRUCTOR gotoblas_quit(void) { ++void gotoblas_quit(void) { + + if (gotoblas_initialized == 0) return; + +@@ -3175,71 +3111,6 @@ void DESTRUCTOR gotoblas_quit(void) { + #endif + } + +-#if defined(_MSC_VER) && !defined(__clang__) +-BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) +-{ +- switch (ul_reason_for_call) +- { +- case DLL_PROCESS_ATTACH: +- gotoblas_init(); +- break; +- case DLL_THREAD_ATTACH: +- break; +- case DLL_THREAD_DETACH: +- break; +- case DLL_PROCESS_DETACH: +- gotoblas_quit(); +- break; +- default: +- break; +- } +- return TRUE; +-} +- +-/* +- This is to allow static linking. +- Code adapted from Google performance tools: +- https://gperftools.googlecode.com/git-history/perftools-1.0/src/windows/port.cc +- Reference: +- https://sourceware.org/ml/pthreads-win32/2008/msg00028.html +- http://ci.boost.org/svn-trac/browser/trunk/libs/thread/src/win32/tss_pe.cpp +-*/ +-static int on_process_term(void) +-{ +- gotoblas_quit(); +- return 0; +-} +-#ifdef _WIN64 +-#pragma comment(linker, "/INCLUDE:_tls_used") +-#else +-#pragma comment(linker, "/INCLUDE:__tls_used") +-#endif +- +-#ifdef _WIN64 +-#pragma const_seg(".CRT$XLB") +-#else +-#pragma data_seg(".CRT$XLB") +-#endif +-static void (APIENTRY *dll_callback)(HINSTANCE h, DWORD ul_reason_for_call, PVOID pv) = DllMain; +-#ifdef _WIN64 +-#pragma const_seg() +-#else +-#pragma data_seg() +-#endif +- +-#ifdef _WIN64 +-#pragma const_seg(".CRT$XTU") +-#else +-#pragma data_seg(".CRT$XTU") +-#endif +-static int(*p_process_term)(void) = on_process_term; +-#ifdef _WIN64 +-#pragma const_seg() +-#else +-#pragma data_seg() +-#endif +-#endif +- + #if (defined(C_PGI) || (!defined(C_SUN) && defined(F_INTERFACE_SUN))) && (defined(ARCH_X86) || defined(ARCH_X86_64)) + /* Don't call me; this is just work around for PGI / Sun bug */ + void gotoblas_dummy_for_PGI(void) { diff --git a/O/OpenBLAS/OpenBLAS@0.3.21/build_tarballs.jl b/O/OpenBLAS/OpenBLAS@0.3.21/build_tarballs.jl new file mode 100644 index 00000000000..3d1135ae23d --- /dev/null +++ b/O/OpenBLAS/OpenBLAS@0.3.21/build_tarballs.jl @@ -0,0 +1,18 @@ +using BinaryBuilder + +include("../common.jl") + +# Collection of sources required to build OpenBLAS +name = "OpenBLAS" +version = v"0.3.21" + +sources = openblas_sources(version) +script = openblas_script(;aarch64_ilp64=true, num_64bit_threads=512) +platforms = openblas_platforms(;experimental=true) +push!(platforms, Platform("x86_64", "linux"; sanitize="memory")) +products = openblas_products() +dependencies = openblas_dependencies(platforms) + +# Build the tarballs +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; + preferred_gcc_version=v"6", lock_microarchitecture=false, julia_compat="1.9") diff --git a/O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/0001-Fix-building-tests-when-NOFORTRAN-is-not-given-at-al.patch b/O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/0001-Fix-building-tests-when-NOFORTRAN-is-not-given-at-al.patch new file mode 100644 index 00000000000..c4e1b738a9a --- /dev/null +++ b/O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/0001-Fix-building-tests-when-NOFORTRAN-is-not-given-at-al.patch @@ -0,0 +1,43 @@ +From d54971fe20a355d225e304cdf8606818675050ce Mon Sep 17 00:00:00 2001 +From: Isuru Fernando +Date: Mon, 8 Aug 2022 11:20:38 -0500 +Subject: [PATCH 1/1] Fix building tests when NOFORTRAN is not given at all + +--- + ctest/Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/ctest/Makefile b/ctest/Makefile +index 236913c3..0fb2450d 100644 +--- a/ctest/Makefile ++++ b/ctest/Makefile +@@ -237,7 +237,7 @@ endif + + ifeq ($(BUILD_DOUBLE),1) + # Double real +-ifeq ($(NOFORTRAN),0) ++ifeq ($(NOFORTRAN), $(filter 0 2,$(NOFORTRAN))) + xdcblat1: $(dtestl1o) c_dblat1.o $(TOPDIR)/$(LIBNAME) + $(FC) $(FLDFLAGS) -o xdcblat1 c_dblat1.o $(dtestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB) + xdcblat2: $(dtestl2o) c_dblat2.o $(TOPDIR)/$(LIBNAME) +@@ -256,7 +256,7 @@ endif + + ifeq ($(BUILD_COMPLEX),1) + # Single complex +-ifeq ($(NOFORTRAN),0) ++ifeq ($(NOFORTRAN), $(filter 0 2,$(NOFORTRAN))) + xccblat1: $(ctestl1o) c_cblat1.o $(TOPDIR)/$(LIBNAME) + $(FC) $(FLDFLAGS) -o xccblat1 c_cblat1.o $(ctestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB) + xccblat2: $(ctestl2o) c_cblat2.o $(TOPDIR)/$(LIBNAME) +@@ -278,7 +278,7 @@ endif + + ifeq ($(BUILD_COMPLEX16),1) + # Double complex +-ifeq ($(NOFORTRAN),0) ++ifeq ($(NOFORTRAN), $(filter 0 2,$(NOFORTRAN))) + xzcblat1: $(ztestl1o) c_zblat1.o $(TOPDIR)/$(LIBNAME) + $(FC) $(FLDFLAGS) -o xzcblat1 c_zblat1.o $(ztestl1o) $(LIB) $(EXTRALIB) $(CEXTRALIB) + xzcblat2: $(ztestl2o) c_zblat2.o $(TOPDIR)/$(LIBNAME) +-- +2.37.2 + diff --git a/O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/neoverse-generic-kernels.patch b/O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/neoverse-generic-kernels.patch new file mode 100644 index 00000000000..ab37e3783bf --- /dev/null +++ b/O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/neoverse-generic-kernels.patch @@ -0,0 +1,19 @@ +diff --git a/kernel/arm64/KERNEL.NEOVERSEN1 b/kernel/arm64/KERNEL.NEOVERSEN1 +index ea010db4..074d7215 100644 +--- a/kernel/arm64/KERNEL.NEOVERSEN1 ++++ b/kernel/arm64/KERNEL.NEOVERSEN1 +@@ -91,10 +91,10 @@ IDAMAXKERNEL = iamax_thunderx2t99.c + ICAMAXKERNEL = izamax_thunderx2t99.c + IZAMAXKERNEL = izamax_thunderx2t99.c + +-SNRM2KERNEL = scnrm2_thunderx2t99.c +-DNRM2KERNEL = dznrm2_thunderx2t99.c +-CNRM2KERNEL = scnrm2_thunderx2t99.c +-ZNRM2KERNEL = dznrm2_thunderx2t99.c ++SNRM2KERNEL = nrm2.S ++DNRM2KERNEL = nrm2.S ++CNRM2KERNEL = znrm2.S ++ZNRM2KERNEL = znrm2.S + + DDOTKERNEL = dot_thunderx2t99.c + SDOTKERNEL = dot_thunderx2t99.c diff --git a/O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/openblas-ofast-power.patch b/O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/openblas-ofast-power.patch new file mode 100644 index 00000000000..405e3f75813 --- /dev/null +++ b/O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/openblas-ofast-power.patch @@ -0,0 +1,31 @@ +diff --git a/Makefile.power b/Makefile.power +index 28a0bae0..b4869fbd 100644 +--- a/Makefile.power ++++ b/Makefile.power +@@ -11,7 +11,7 @@ endif + + ifeq ($(CORE), POWER10) + ifneq ($(C_COMPILER), PGI) +-CCOMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math ++CCOMMON_OPT += -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math + ifeq ($(F_COMPILER), IBM) + FCOMMON_OPT += -O2 -qrecur -qnosave + else +@@ -22,7 +22,7 @@ endif + + ifeq ($(CORE), POWER9) + ifneq ($(C_COMPILER), PGI) +-CCOMMON_OPT += -Ofast -mvsx -fno-fast-math ++CCOMMON_OPT += -mvsx -fno-fast-math + ifeq ($(C_COMPILER), GCC) + ifneq ($(GCCVERSIONGT4), 1) + $(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended) +@@ -59,7 +59,7 @@ endif + + ifeq ($(CORE), POWER8) + ifneq ($(C_COMPILER), PGI) +-CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math ++CCOMMON_OPT += -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math + else + CCOMMON_OPT += -fast -Mvect=simd -Mcache_align + endif diff --git a/O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/openblas-winexit.patch b/O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/openblas-winexit.patch new file mode 100644 index 00000000000..33389f34a40 --- /dev/null +++ b/O/OpenBLAS/OpenBLAS@0.3.21/bundled/patches/openblas-winexit.patch @@ -0,0 +1,170 @@ +diff --git a/driver/others/memory.c b/driver/others/memory.c +index 6e654ccf..1d2f9f12 100644 +--- a/driver/others/memory.c ++++ b/driver/others/memory.c +@@ -1534,7 +1534,7 @@ void CONSTRUCTOR gotoblas_init(void) { + + } + +-void DESTRUCTOR gotoblas_quit(void) { ++void gotoblas_quit(void) { + + if (gotoblas_initialized == 0) return; + +@@ -1572,75 +1572,11 @@ void DESTRUCTOR gotoblas_quit(void) { + } + + #if defined(_MSC_VER) && !defined(__clang__) +-BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) +-{ +- switch (ul_reason_for_call) +- { +- case DLL_PROCESS_ATTACH: +- gotoblas_init(); +- break; +- case DLL_THREAD_ATTACH: +- break; +- case DLL_THREAD_DETACH: +-#if defined(SMP) +- blas_thread_memory_cleanup(); +-#endif +- break; +- case DLL_PROCESS_DETACH: +- gotoblas_quit(); +- break; +- default: +- break; +- } +- return TRUE; +-} +- +-/* +- This is to allow static linking. +- Code adapted from Google performance tools: +- https://gperftools.googlecode.com/git-history/perftools-1.0/src/windows/port.cc +- Reference: +- https://sourceware.org/ml/pthreads-win32/2008/msg00028.html +- http://ci.boost.org/svn-trac/browser/trunk/libs/thread/src/win32/tss_pe.cpp +-*/ +-static int on_process_term(void) +-{ +- gotoblas_quit(); +- return 0; +-} + #ifdef _WIN64 + #pragma comment(linker, "/INCLUDE:_tls_used") + #else + #pragma comment(linker, "/INCLUDE:__tls_used") + #endif +- +-#ifdef _WIN64 +-#pragma const_seg(".CRT$XLB") +-#else +-#pragma data_seg(".CRT$XLB") +-#endif +- +-#ifdef _WIN64 +-static const PIMAGE_TLS_CALLBACK dll_callback(HINSTANCE h, DWORD ul_reason_for_call, PVOID pv) = DllMain; +-#pragma const_seg() +-#else +-static void (APIENTRY *dll_callback)(HINSTANCE h, DWORD ul_reason_for_call, PVOID pv) = DllMain; +-#pragma data_seg() +-#endif +- +-#ifdef _WIN64 +-#pragma const_seg(".CRT$XTU") +-#else +-#pragma data_seg(".CRT$XTU") +-#endif +- +-#ifdef _WIN64 +-static const int(*p_process_term)(void) = on_process_term; +-#pragma const_seg() +-#else +-static int(*p_process_term)(void) = on_process_term; +-#pragma data_seg() +-#endif + #endif + + #if (defined(C_PGI) || (!defined(C_SUN) && defined(F_INTERFACE_SUN))) && (defined(ARCH_X86) || defined(ARCH_X86_64)) +@@ -3146,7 +3082,7 @@ void CONSTRUCTOR gotoblas_init(void) { + + } + +-void DESTRUCTOR gotoblas_quit(void) { ++void gotoblas_quit(void) { + + if (gotoblas_initialized == 0) return; + +@@ -3175,71 +3111,6 @@ void DESTRUCTOR gotoblas_quit(void) { + #endif + } + +-#if defined(_MSC_VER) && !defined(__clang__) +-BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) +-{ +- switch (ul_reason_for_call) +- { +- case DLL_PROCESS_ATTACH: +- gotoblas_init(); +- break; +- case DLL_THREAD_ATTACH: +- break; +- case DLL_THREAD_DETACH: +- break; +- case DLL_PROCESS_DETACH: +- gotoblas_quit(); +- break; +- default: +- break; +- } +- return TRUE; +-} +- +-/* +- This is to allow static linking. +- Code adapted from Google performance tools: +- https://gperftools.googlecode.com/git-history/perftools-1.0/src/windows/port.cc +- Reference: +- https://sourceware.org/ml/pthreads-win32/2008/msg00028.html +- http://ci.boost.org/svn-trac/browser/trunk/libs/thread/src/win32/tss_pe.cpp +-*/ +-static int on_process_term(void) +-{ +- gotoblas_quit(); +- return 0; +-} +-#ifdef _WIN64 +-#pragma comment(linker, "/INCLUDE:_tls_used") +-#else +-#pragma comment(linker, "/INCLUDE:__tls_used") +-#endif +- +-#ifdef _WIN64 +-#pragma const_seg(".CRT$XLB") +-#else +-#pragma data_seg(".CRT$XLB") +-#endif +-static void (APIENTRY *dll_callback)(HINSTANCE h, DWORD ul_reason_for_call, PVOID pv) = DllMain; +-#ifdef _WIN64 +-#pragma const_seg() +-#else +-#pragma data_seg() +-#endif +- +-#ifdef _WIN64 +-#pragma const_seg(".CRT$XTU") +-#else +-#pragma data_seg(".CRT$XTU") +-#endif +-static int(*p_process_term)(void) = on_process_term; +-#ifdef _WIN64 +-#pragma const_seg() +-#else +-#pragma data_seg() +-#endif +-#endif +- + #if (defined(C_PGI) || (!defined(C_SUN) && defined(F_INTERFACE_SUN))) && (defined(ARCH_X86) || defined(ARCH_X86_64)) + /* Don't call me; this is just work around for PGI / Sun bug */ + void gotoblas_dummy_for_PGI(void) { diff --git a/O/OpenBLAS/common.jl b/O/OpenBLAS/common.jl index 1962a1afc9d..fdc1e3fb743 100644 --- a/O/OpenBLAS/common.jl +++ b/O/OpenBLAS/common.jl @@ -1,8 +1,13 @@ using BinaryBuilder +using BinaryBuilderBase: sanitize # Collection of sources required to build OpenBLAS function openblas_sources(version::VersionNumber; kwargs...) openblas_version_sources = Dict( + v"0.3.21" => [ + ArchiveSource("https://github.com/xianyi/OpenBLAS/archive/v0.3.21.tar.gz", + "f36ba3d7a60e7c8bcc54cd9aaa9b1223dd42eaf02c811791c37e8ca707c241ca") + ], v"0.3.20" => [ ArchiveSource("https://github.com/xianyi/OpenBLAS/archive/v0.3.20.tar.gz", "8495c9affc536253648e942908e88e097f2ec7753ede55aca52e5dead3029e3c") @@ -221,11 +226,11 @@ function openblas_products(;kwargs...) ] end -function openblas_dependencies(;kwargs...) +function openblas_dependencies(platforms; kwargs...) return [ Dependency("CompilerSupportLibraries_jll"), HostBuildDependency("FlangClassic_jll"), - BuildDependency("LLVMCompilerRT_jll"), - BuildDependency("FlangClassic_RTLib_jll", platforms=[Platform("x86_64", "linux"; sanitize="memory")]) + BuildDependency("LLVMCompilerRT_jll"; platforms=filter(p -> sanitize(p)=="memory", platforms)), + BuildDependency("FlangClassic_RTLib_jll"; platforms=filter(p -> sanitize(p)=="memory", platforms)) ] end