Skip to content
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e9d25d7
[OpenBLAS] Update to 0.3.30
imciner2 Jun 19, 2025
e5dbd41
Add patch to fix compilation of SBGEMM Neoversev1 kernel
imciner2 Jun 20, 2025
ca77865
Remove old patch
imciner2 Jun 20, 2025
255afe7
Increase LLVM version to get newer aarch64 instructions
imciner2 Jun 20, 2025
b1d9941
Add printing of build flags to make it obvious what we do
imciner2 Oct 3, 2025
25b2ed7
Merge branch 'master' into im/ob0.3.30
eschnett Dec 30, 2025
43bbf5f
Correct aarch64 build problems
eschnett Dec 31, 2025
51854bc
OpenBLAS: Correct aarch64 build problems
eschnett Dec 31, 2025
da7d7c5
OpenBLAS: Correct Darwin patch
eschnett Dec 31, 2025
401f1ad
Merge branch 'master' into eschnett/openblas-0.3.30
eschnett Jan 12, 2026
cef04a7
OpenBLAS: Save state
eschnett Jan 13, 2026
d32b938
Merge branch 'master' into eschnett/openblas-0.3.30
eschnett Jan 16, 2026
0d1e203
Add bfloat16 for all platforms
eschnett Jan 16, 2026
e60dca6
OpenBLAS: Reduce build parallelism
eschnett Jan 16, 2026
c0fbcf7
OpenBLAS: Reduce build parallelism
eschnett Jan 16, 2026
559c696
OpenBLAS: Build with LLVM 18
eschnett Jan 16, 2026
2d9613a
OpenBLAS: Add float16 support
eschnett Jan 17, 2026
a8a1bd2
Merge branch 'master' into eschnett/openblas-0.3.31
eschnett Feb 15, 2026
20f51e6
OpenBLAS: Disable -Werror, or try to
eschnett Feb 16, 2026
268e40b
OpenBLAS: Correct x86_64-apple build
eschnett Feb 16, 2026
fed83f9
OpenBLAS: All working now
eschnett Feb 17, 2026
80547c5
OpenBLAS: Undo accidental delete
eschnett Feb 17, 2026
92adfcf
Use GCC 11 except for aarch64-*-darwin*
eschnett Feb 17, 2026
c98c48d
Correct platform selection
eschnett Feb 17, 2026
f8deaf3
Debug platform selection
eschnett Feb 17, 2026
d9ac582
Debug platform selection
eschnett Feb 17, 2026
517f59f
Debug platform selection
eschnett Feb 17, 2026
7ce67d6
Debug platform selection
eschnett Feb 18, 2026
67fc816
Require GCC 12
eschnett Feb 18, 2026
1ab7574
Trigger rebuild
eschnett Feb 18, 2026
f788045
Trigger rebuild
eschnett Feb 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions O/OpenBLAS/OpenBLAS32@0.3.31/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using BinaryBuilder

include("../common.jl")

# Collection of sources required to build OpenBLAS
name = "OpenBLAS32"
version = v"0.3.31"

sources = openblas_sources(version)
script = openblas_script(openblas32=true, bfloat16=true, float16=true)
platforms = openblas_platforms(; version)
products = openblas_products()
preferred_gcc_version = v"11"
preferred_llvm_version = v"18.1.7"
dependencies = openblas_dependencies(platforms; llvm_compilerrt_version=preferred_llvm_version)

# Do we build all platforms, or those specified as arguments?
platform_args = filter(arg -> !startswith(arg, "--"), ARGS)
if !isempty(platform_args)
@assert length(platform_args) == 1
platforms = BinaryBuilderBase.parse_platform.(split(platform_args[1], ","))
end

aarch64_darwin_preferred_gcc_version = v"15"

# The regular options, excluding the list of platforms
option_args = filter(arg -> startswith(arg, "--"), ARGS)
non_register_option_args = filter(arg -> arg != "--register", option_args)

for (n,platform) in enumerate(platforms)
# We register the build products only after the last build.
args = n == length(platforms) ? option_args : non_register_option_args

build_tarballs(args, name, version, sources, script, non_msan_platforms, products, dependencies;
julia_compat="1.11",
lock_microarchitecture=false,
preferred_gcc_version =
arch(platform) == "aarch64" && Sys.isapple(platform) ?
aarch64_darwin_preferred_gcc_version : preferred_gcc_version,
preferred_llvm_version=preferred_llvm_version,
)
end

# Build trigger: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/driver/others/dynamic_riscv64.c b/driver/others/dynamic_riscv64.c
index 726f76d79..919663b22 100644
--- a/driver/others/dynamic_riscv64.c
+++ b/driver/others/dynamic_riscv64.c
@@ -99,7 +99,7 @@ struct riscv_hwprobe {
#define RISCV_HWPROBE_IMA_V (1 << 2)
#define RISCV_HWPROBE_EXT_ZFH (1 << 27)
#define RISCV_HWPROBE_EXT_ZVFH (1 << 30)
-#define RISCV_HWPROBE_EXT_ZVFBFWMA (1 << 54)
+#define RISCV_HWPROBE_EXT_ZVFBFWMA (1ULL << 54)

#ifndef NR_riscv_hwprobe
#ifndef NR_arch_specific_syscall
@@ -152,6 +152,7 @@ char* gotoblas_corename(void) {
static gotoblas_t* get_coretype(void) {
uint64_t vector_mask;
unsigned vlenb = 0;
+ char coremsg[128];

#if !defined(OS_LINUX)
return NULL;
170 changes: 170 additions & 0 deletions O/OpenBLAS/OpenBLAS32@0.3.31/bundled/patches/50-openblas-winexit.patch
Original file line number Diff line number Diff line change
@@ -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) {
53 changes: 53 additions & 0 deletions O/OpenBLAS/OpenBLAS@0.3.31/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using BinaryBuilder
using BinaryBuilderBase

include("../common.jl")

# Collection of sources required to build OpenBLAS
name = "OpenBLAS"
version = v"0.3.31"

sources = openblas_sources(version)
script = openblas_script(; aarch64_ilp64=true, num_64bit_threads=512, bfloat16=true)
platforms = openblas_platforms(; version)
# Note: The msan build doesn't use gfortran, and we thus don't expand the gfortran versions
push!(platforms, Platform("x86_64", "linux"; sanitize="memory"))
products = openblas_products()
preferred_gcc_version = v"11"
preferred_llvm_version = v"18.1.7"
dependencies = openblas_dependencies(platforms; llvm_compilerrt_version=preferred_llvm_version)

# Everything below is necessary only because we need to build msan platforms with a different LLVM version.
# We can only build msan platforms with LLVM 13, but we need to build non-msan builds with LLVM 17 to get bfloat16 support.
#
# For the love of god, can someone PLEASE just build msan support for a modern LLVM?

# Do we build all platforms, or those specified as arguments?
platform_args = filter(arg -> !startswith(arg, "--"), ARGS)
if !isempty(platform_args)
@assert length(platform_args) == 1
platforms = BinaryBuilderBase.parse_platform.(split(platform_args[1], ","))
end

msan_preferred_llvm_version = v"13.0.1+0"
aarch64_darwin_preferred_gcc_version = v"15"

# The regular options, excluding the list of platforms
option_args = filter(arg -> startswith(arg, "--"), ARGS)
non_register_option_args = filter(arg -> arg != "--register", option_args)

for (n,platform) in enumerate(platforms)
# We register the build products only after the last build.
args = n == length(platforms) ? option_args : non_register_option_args

build_tarballs(args, name, version, sources, script, non_msan_platforms, products, dependencies;
julia_compat="1.11",
lock_microarchitecture=false,
preferred_gcc_version =
arch(platform) == "aarch64" && Sys.isapple(platform) ?
aarch64_darwin_preferred_gcc_version : preferred_gcc_version,
preferred_llvm_version = sanitize(platform) == "memory" ? msan_preferred_llvm_version : preferred_llvm_version,
)
end

# Build trigger: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/driver/others/dynamic_riscv64.c b/driver/others/dynamic_riscv64.c
index 726f76d79..919663b22 100644
--- a/driver/others/dynamic_riscv64.c
+++ b/driver/others/dynamic_riscv64.c
@@ -99,7 +99,7 @@ struct riscv_hwprobe {
#define RISCV_HWPROBE_IMA_V (1 << 2)
#define RISCV_HWPROBE_EXT_ZFH (1 << 27)
#define RISCV_HWPROBE_EXT_ZVFH (1 << 30)
-#define RISCV_HWPROBE_EXT_ZVFBFWMA (1 << 54)
+#define RISCV_HWPROBE_EXT_ZVFBFWMA (1ULL << 54)

#ifndef NR_riscv_hwprobe
#ifndef NR_arch_specific_syscall
@@ -152,6 +152,7 @@ char* gotoblas_corename(void) {
static gotoblas_t* get_coretype(void) {
uint64_t vector_mask;
unsigned vlenb = 0;
+ char coremsg[128];

#if !defined(OS_LINUX)
return NULL;
Loading