From 7a4531aaff2904e0ecec2f6ad4ccebb75badf45d Mon Sep 17 00:00:00 2001 From: "yan.yihao 10263201" Date: Tue, 3 Jun 2025 13:58:59 +0800 Subject: [PATCH] add support for riscv build --- openblas.spec | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/openblas.spec b/openblas.spec index 28e6d17..c89ffd3 100644 --- a/openblas.spec +++ b/openblas.spec @@ -1,4 +1,4 @@ -%define anolis_release 2 +%define anolis_release 3 %bcond_with system_lapack %global lapackver 3.11.0 @@ -19,7 +19,11 @@ BuildRequires: make gcc gcc-c++ gcc-gfortran BuildRequires: perl-devel Obsoletes: %{name}-Rblas < %{EVR} +%ifnarch riscv64 %global execstack 1 +%else +%global execstack 0 +%endif %if %{execstack} BuildRequires: execstack %endif @@ -310,6 +314,9 @@ TARGET="TARGET=ARMV8 DYNAMIC_ARCH=1 DYNAMIC_OLDER=1" %ifarch loongarch64 TARGET="TARGET=LOONGSONGENERIC DYNAMIC_ARCH=1" %endif +%ifarch riscv64 +TARGET="TARGET=RISCV64_GENERIC DYNAMIC_ARCH=0" +%endif COMMON="%{optflags} -fPIC" FCOMMON="%{optflags} -fPIC -frecursive" @@ -352,6 +359,9 @@ cp -a %{_includedir}/lapacke %{buildroot}%{_includedir}/%{name} %endif suffix="" +%ifarch riscv64 +suffix="_riscv64_generic" +%endif slibname=`basename %{buildroot}%{_libdir}/libopenblas${suffix}-*.so .so` mv %{buildroot}%{_libdir}/${slibname}.a %{buildroot}%{_libdir}/lib%{name}.a if [[ "$suffix" != "" ]]; then @@ -528,6 +538,9 @@ rm -rf %{buildroot}%{_libdir}/pkgconfig %endif %changelog +* Fri May 30 2025 Yihao Yan - 0.3.28-3 +- add support for riscv build + * Thu Mar 27 2025 Wenlong Zhang - 0.3.28-2 - Fixed the undefined reference to blas_set_parameter -- Gitee