From 9ad3dcc9b4859fd4dc041bb4db9b0ec7345b0300 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 24 Dec 2024 16:25:15 -0500 Subject: [PATCH 1/3] OpenBLAS: Build for riscv64 --- O/OpenBLAS/OpenBLAS32@0.3.28/build_tarballs.jl | 2 +- O/OpenBLAS/OpenBLAS@0.3.28/build_tarballs.jl | 2 +- O/OpenBLAS/common.jl | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/O/OpenBLAS/OpenBLAS32@0.3.28/build_tarballs.jl b/O/OpenBLAS/OpenBLAS32@0.3.28/build_tarballs.jl index ed9c6a626ec..4bf39eb55da 100644 --- a/O/OpenBLAS/OpenBLAS32@0.3.28/build_tarballs.jl +++ b/O/OpenBLAS/OpenBLAS32@0.3.28/build_tarballs.jl @@ -18,4 +18,4 @@ build_tarballs(ARGS, name, version, sources, script, platforms, products, depend preferred_gcc_version=v"11", lock_microarchitecture=false, julia_compat="1.11", preferred_llvm_version=preferred_llvm_version) -# Build trigger: 4 +# Build trigger: 5 diff --git a/O/OpenBLAS/OpenBLAS@0.3.28/build_tarballs.jl b/O/OpenBLAS/OpenBLAS@0.3.28/build_tarballs.jl index 61b2b86a175..b5c64e06339 100644 --- a/O/OpenBLAS/OpenBLAS@0.3.28/build_tarballs.jl +++ b/O/OpenBLAS/OpenBLAS@0.3.28/build_tarballs.jl @@ -19,4 +19,4 @@ build_tarballs(ARGS, name, version, sources, script, platforms, products, depend preferred_gcc_version=v"11", lock_microarchitecture=false, julia_compat="1.11", preferred_llvm_version=preferred_llvm_version) -# Build trigger: 4 +# Build trigger: 5 diff --git a/O/OpenBLAS/common.jl b/O/OpenBLAS/common.jl index b4401261f1d..d983bd900f1 100644 --- a/O/OpenBLAS/common.jl +++ b/O/OpenBLAS/common.jl @@ -182,6 +182,8 @@ function openblas_script(;num_64bit_threads::Integer=32, openblas32::Bool=false, flags+=(TARGET=ARMV7) elif [[ ${target} == powerpc64le-* ]]; then flags+=(TARGET=POWER8 DYNAMIC_ARCH=1) + elif [[ ${target} == riscv64-* ]]; then + flags+=(TARGET=RISCV64_GENERIC) fi # If we're building for x86_64 Windows gcc7+, we need to disable usage of From 7dde3cd3669de1e13b50c4ff3607f9aa7499b62b Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 24 Dec 2024 16:30:34 -0500 Subject: [PATCH 2/3] OpenBLAS: Enable DYNAMIC_ARCH for riscv64 --- O/OpenBLAS/common.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/O/OpenBLAS/common.jl b/O/OpenBLAS/common.jl index d983bd900f1..fd9868ea7b6 100644 --- a/O/OpenBLAS/common.jl +++ b/O/OpenBLAS/common.jl @@ -183,7 +183,7 @@ function openblas_script(;num_64bit_threads::Integer=32, openblas32::Bool=false, elif [[ ${target} == powerpc64le-* ]]; then flags+=(TARGET=POWER8 DYNAMIC_ARCH=1) elif [[ ${target} == riscv64-* ]]; then - flags+=(TARGET=RISCV64_GENERIC) + flags+=(TARGET=RISCV64_GENERIC DYNAMIC_ARCH=1) fi # If we're building for x86_64 Windows gcc7+, we need to disable usage of From 55f29af7e3750f1d2acd34ab5e55bf3381e4ff5b Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 24 Dec 2024 18:52:43 -0500 Subject: [PATCH 3/3] OpenBLAS: Disable DYNAMIC_ARCH for riscv64 again --- O/OpenBLAS/common.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/O/OpenBLAS/common.jl b/O/OpenBLAS/common.jl index fd9868ea7b6..d136b01ef39 100644 --- a/O/OpenBLAS/common.jl +++ b/O/OpenBLAS/common.jl @@ -183,7 +183,10 @@ function openblas_script(;num_64bit_threads::Integer=32, openblas32::Bool=false, elif [[ ${target} == powerpc64le-* ]]; then flags+=(TARGET=POWER8 DYNAMIC_ARCH=1) elif [[ ${target} == riscv64-* ]]; then - flags+=(TARGET=RISCV64_GENERIC DYNAMIC_ARCH=1) + # We would like to enable DYNAMIC_ARCH=1, but we cannot: + # GCC 12 doesn't support RISC-V vector instructions + # GCC 13 does not know the type `vfloat32m4x2_t` + flags+=(TARGET=RISCV64_GENERIC) fi # If we're building for x86_64 Windows gcc7+, we need to disable usage of