diff --git a/modify-the-ABI-for-loongarch.patch b/modify-the-ABI-for-loongarch.patch new file mode 100644 index 0000000000000000000000000000000000000000..fdf06c6c3694568efcb909fbdda557887e19e918 --- /dev/null +++ b/modify-the-ABI-for-loongarch.patch @@ -0,0 +1,43 @@ +From 15f793d0d1a38f1e203d7d50df3947201731c34d Mon Sep 17 00:00:00 2001 +From: Wenlong Zhang +Date: Wed, 30 Nov 2022 09:27:01 +0000 +Subject: [PATCH] modify the ABI for loongarch + +--- + OpenBLAS-0.3.18/Makefile.system | 4 ++-- + OpenBLAS-0.3.18/Makefile.system.libname | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git OpenBLAS-0.3.18/Makefile.system OpenBLAS-0.3.18/Makefile.system +index 17310b0..19f04b5 100644 +--- OpenBLAS-0.3.18/Makefile.system ++++ OpenBLAS-0.3.18/Makefile.system +@@ -869,8 +869,8 @@ endif + + ifeq ($(ARCH), loongarch64) + ifeq ($(CORE), LOONGSON3R5) +-CCOMMON_OPT += -march=loongarch64 -mabi=lp64 +-FCOMMON_OPT += -march=loongarch64 -mabi=lp64 ++CCOMMON_OPT += -march=loongarch64 -mabi=lp64d ++FCOMMON_OPT += -march=loongarch64 -mabi=lp64d + endif + endif + +diff --git OpenBLAS-0.3.18/Makefile.system.libname OpenBLAS-0.3.18/Makefile.system.libname +index 150dbef..f9101af 100644 +--- OpenBLAS-0.3.18/Makefile.system.libname ++++ OpenBLAS-0.3.18/Makefile.system.libname +@@ -869,8 +869,8 @@ endif + + ifeq ($(ARCH), loongarch64) + ifeq ($(CORE), LOONGSON3R5) +-CCOMMON_OPT += -march=loongarch64 -mabi=lp64 +-FCOMMON_OPT += -march=loongarch64 -mabi=lp64 ++CCOMMON_OPT += -march=loongarch64 -mabi=lp64d ++FCOMMON_OPT += -march=loongarch64 -mabi=lp64d + endif + endif + +-- +2.33.0 + diff --git a/openblas.spec b/openblas.spec index 48f57323f76c9961e8f3f9fa91fca8ce47e3cebb..683c7a3f6573b413ef8cd110fc862f4bc053c1de 100644 --- a/openblas.spec +++ b/openblas.spec @@ -2,7 +2,7 @@ Name: openblas Version: 0.3.18 -Release: 5 +Release: 6 Summary: An optimized BLAS library based on GotoBLAS2 1.13 BSD version License: BSD-3-Clause URL: https://github.com/xianyi/OpenBLAS/ @@ -12,6 +12,8 @@ Patch0001: openblas-0.2.5-libname.patch Patch0002: openblas-0.3.7-tests.patch Patch0003: rm-make-test-from-Makefile-and-add-this-to-spec-in-f.patch +Patch1000: modify-the-ABI-for-loongarch.patch + Requires: %{name}-devel = %{version}-%{release} BuildRequires: gcc gcc-gfortran perl-devel gcc-c++ @@ -48,7 +50,7 @@ Obsoletes: openblas-serial64_ < %{version}-%{release} openblas-openmp64_ < Obsoletes: openblas-threads64_ < %{version}-%{release} openblas-Rblas < %{version}-%{release} %endif -ExclusiveArch: x86_64 aarch64 riscv64 +ExclusiveArch: x86_64 aarch64 loongarch64 riscv64 %description OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD \ @@ -72,6 +74,7 @@ cd OpenBLAS-%{version} %patch0001 -p1 -b .libname %patch0002 -p1 -b .tests %patch0003 -p1 +%patch1000 -p1 # Set source permissions find -name \*.f -exec chmod 644 {} \; @@ -288,6 +291,9 @@ cp -a %{_includedir}/lapacke %{buildroot}%{_includedir}/%{name} %ifarch aarch64 suffix="_armv8" %endif +%ifarch loongarch64 +suffix="_loongson3r5" +%endif %ifarch riscv64 suffix="_riscv64_generic" %endif @@ -434,6 +440,9 @@ rm -rf %{buildroot}%{_libdir}/pkgconfig %endif %changelog +* Mon Aug 14 2023 yangchenguang - 0.3.18-6 +- Add loongarch64 support + * Fri Jun 30 2023 xiaoqianlv - 0.3.18-5 - add support for riscv