add loongarch support for openblas
This commit is contained in:
parent
813c9eabba
commit
558b9b8777
27
0001-modify-the-ABI-for-loongarch.patch
Normal file
27
0001-modify-the-ABI-for-loongarch.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
From b13db2656d6e983a77b3d203b4af51ba15f2f815 Mon Sep 17 00:00:00 2001
|
||||||
|
From: zhaozhen <zhaozhen@loongson.cn>
|
||||||
|
Date: Thu, 9 Mar 2023 11:50:01 +0000
|
||||||
|
Subject: [PATCH] modify the ABI for loongarch64
|
||||||
|
|
||||||
|
---
|
||||||
|
OpenBLAS-0.3.18/Makefile.system | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git OpenBLAS-0.3.18/Makefile.system OpenBLAS-0.3.18/Makefile.system
|
||||||
|
index 150dbef..f9101af 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
|
||||||
|
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Name: openblas
|
Name: openblas
|
||||||
Version: 0.3.18
|
Version: 0.3.18
|
||||||
Release: 2
|
Release: 3
|
||||||
Summary: An optimized BLAS library based on GotoBLAS2 1.13 BSD version
|
Summary: An optimized BLAS library based on GotoBLAS2 1.13 BSD version
|
||||||
License: BSD-3-Clause
|
License: BSD-3-Clause
|
||||||
URL: https://github.com/xianyi/OpenBLAS/
|
URL: https://github.com/xianyi/OpenBLAS/
|
||||||
@ -10,6 +10,7 @@ Source0: https://github.com/xianyi/OpenBLAS/archive/v%{version}/openblas-
|
|||||||
Patch0000: openblas-0.2.15-system_lapack.patch
|
Patch0000: openblas-0.2.15-system_lapack.patch
|
||||||
Patch0001: openblas-0.2.5-libname.patch
|
Patch0001: openblas-0.2.5-libname.patch
|
||||||
Patch0002: openblas-0.3.7-tests.patch
|
Patch0002: openblas-0.3.7-tests.patch
|
||||||
|
Patch0003: 0001-modify-the-ABI-for-loongarch.patch
|
||||||
Requires: %{name}-devel = %{version}-%{release}
|
Requires: %{name}-devel = %{version}-%{release}
|
||||||
BuildRequires: gcc gcc-gfortran perl-devel gcc-c++
|
BuildRequires: gcc gcc-gfortran perl-devel gcc-c++
|
||||||
|
|
||||||
@ -34,7 +35,7 @@ Obsoletes: openblas-serial64_ < %{version}-%{release} openblas-openmp64_ <
|
|||||||
Obsoletes: openblas-threads64_ < %{version}-%{release} openblas-Rblas < %{version}-%{release}
|
Obsoletes: openblas-threads64_ < %{version}-%{release} openblas-Rblas < %{version}-%{release}
|
||||||
Obsoletes: openblas-static < %{version}-%{release}
|
Obsoletes: openblas-static < %{version}-%{release}
|
||||||
|
|
||||||
ExclusiveArch: x86_64 aarch64
|
ExclusiveArch: x86_64 aarch64 loongarch64
|
||||||
|
|
||||||
%description
|
%description
|
||||||
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD \
|
OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD \
|
||||||
@ -57,6 +58,7 @@ cd OpenBLAS-%{version}
|
|||||||
%endif
|
%endif
|
||||||
%patch0001 -p1 -b .libname
|
%patch0001 -p1 -b .libname
|
||||||
%patch0002 -p1 -b .tests
|
%patch0002 -p1 -b .tests
|
||||||
|
%patch0003 -p1
|
||||||
|
|
||||||
# Set source permissions
|
# Set source permissions
|
||||||
find -name \*.f -exec chmod 644 {} \;
|
find -name \*.f -exec chmod 644 {} \;
|
||||||
@ -213,6 +215,9 @@ cp -a %{_includedir}/lapacke %{buildroot}%{_includedir}/%{name}
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
# Fix name of libraries
|
# Fix name of libraries
|
||||||
|
%ifarch loongarch64
|
||||||
|
suffix="_loongson3r5"
|
||||||
|
%endif
|
||||||
slibname=`basename %{buildroot}%{_libdir}/libopenblas${suffix}-*.so .so`
|
slibname=`basename %{buildroot}%{_libdir}/libopenblas${suffix}-*.so .so`
|
||||||
mv %{buildroot}%{_libdir}/${slibname}.a %{buildroot}%{_libdir}/lib%{name}.a
|
mv %{buildroot}%{_libdir}/${slibname}.a %{buildroot}%{_libdir}/lib%{name}.a
|
||||||
if [[ "$suffix" != "" ]]; then
|
if [[ "$suffix" != "" ]]; then
|
||||||
@ -351,6 +356,9 @@ rm -rf %{buildroot}%{_libdir}/pkgconfig
|
|||||||
%{_libdir}/lib%{name}*64_.so
|
%{_libdir}/lib%{name}*64_.so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Mar 9 2023 zhaozhen <zhaozhen@loongson.cn> - 0.3.18-3
|
||||||
|
- add loongarch support for openblas
|
||||||
|
|
||||||
* Wed May 11 2022 wulei <wulei80@h-partners.com> - 0.3.18-2
|
* Wed May 11 2022 wulei <wulei80@h-partners.com> - 0.3.18-2
|
||||||
- License compliance rectification
|
- License compliance rectification
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user