diff --git a/openblas.spec b/openblas.spec index 28e6d17e1f3aec8ec92b9b7207ade0d390f42f11..2289c3efab9baf97aef24c2e3a9ad185cead32d6 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 @@ -33,8 +37,13 @@ BuildRequires: lapack-static Provides: bundled(lapack) = %{lapackver} %endif +%if 0%{?__isa_bits} == 64 %global build64 1 %bcond_without cpp_thread_check +%else +%global build64 0 +%bcond_with cpp_thread_check +%endif %if %{with system_lapack} %if %build64 @@ -310,6 +319,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" @@ -345,6 +357,7 @@ make -C openmp64_ $TARGET USE_THREAD=1 USE_OPENMP=1 FC=gfortran CC=gcc COMMON_ %endif %install +rm -rf %{buildroot} make -C serial USE_THREAD=0 PREFIX=%{buildroot} OPENBLAS_LIBRARY_DIR=%{buildroot}%{_libdir} OPENBLAS_INCLUDE_DIR=%{buildroot}%{_includedir}/%name OPENBLAS_BINARY_DIR=%{buildroot}%{_bindir} OPENBLAS_CMAKE_DIR=%{buildroot}%{_libdir}/cmake install %if %{with system_lapack} && %{lapacke} @@ -352,6 +365,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 +544,9 @@ rm -rf %{buildroot}%{_libdir}/pkgconfig %endif %changelog +* Sun Apr 27 2025 Shangtong Guo - 0.3.28-3 +- add support for riscv64 build + * Thu Mar 27 2025 Wenlong Zhang - 0.3.28-2 - Fixed the undefined reference to blas_set_parameter