diff --git a/0001-Fix-detection-of-Apple-M1-Vortex.patch b/0001-Fix-detection-of-Apple-M1-Vortex.patch new file mode 100644 index 0000000000000000000000000000000000000000..75f7099382222e42c973ddb33357e72068875427 --- /dev/null +++ b/0001-Fix-detection-of-Apple-M1-Vortex.patch @@ -0,0 +1,64 @@ +From 1cce778585d6aed9b272ae975a45196279648e24 Mon Sep 17 00:00:00 2001 +From: Martin Kroeker +Date: Mon, 4 Oct 2021 16:46:41 +0200 +Subject: [PATCH] Fix detection of Apple M1 "Vortex" + +--- + cpuid_arm64.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/cpuid_arm64.c b/cpuid_arm64.c +index 2a9399f7d..430429cd3 100644 +--- a/cpuid_arm64.c ++++ b/cpuid_arm64.c +@@ -26,7 +26,7 @@ + *****************************************************************************/ + + #include +-#ifdef OS_DARWIN ++#ifdef __APPLE__ + #include + int32_t value; + size_t length=sizeof(value); +@@ -212,9 +212,9 @@ int detect(void) + + } + #else +-#ifdef DARWIN ++#ifdef __APPLE__ + sysctlbyname("hw.cpufamily",&value,&length,NULL,0); +- if (value ==131287967) return CPU_VORTEX; ++ if (value ==131287967|| value == 458787763 ) return CPU_VORTEX; + #endif + return CPU_ARMV8; + #endif +@@ -265,7 +265,7 @@ int n=0; + + printf("#define NUM_CORES %d\n",n); + #endif +-#ifdef DARWIN ++#ifdef __APPLE__ + sysctlbyname("hw.physicalcpu_max",&value,&length,NULL,0); + printf("#define NUM_CORES %d\n",value); + #endif +@@ -420,7 +420,7 @@ void get_cpuconfig(void) + printf("#define DTB_DEFAULT_ENTRIES 64 \n"); + printf("#define DTB_SIZE 4096 \n"); + break; +-#ifdef DARWIN ++#ifdef __APPLE__ + case CPU_VORTEX: + printf("#define VORTEX \n"); + sysctlbyname("hw.l1icachesize",&value,&length,NULL,0); +@@ -431,6 +431,8 @@ void get_cpuconfig(void) + printf("#define L1_DATA_SIZE %d \n",value); + sysctlbyname("hw.l2dcachesize",&value,&length,NULL,0); + printf("#define L2_SIZE %d \n",value); ++ printf("#define DTB_DEFAULT_ENTRIES 64 \n"); ++ printf("#define DTB_SIZE 4096 \n"); + break; + #endif + } +-- +2.42.0.windows.2 + diff --git a/openblas.spec b/openblas.spec index 2356f3c4d31265417c5e63e0e5833a59e908c4c0..fc04ce8beb6da330ef17ac5eeb39be926c30a526 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 URL: https://github.com/xianyi/OpenBLAS/ @@ -12,6 +12,7 @@ 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 Patch0004: 0001-modify-the-ABI-for-loongarch.patch +Patch0005: 0001-Fix-detection-of-Apple-M1-Vortex.patch Requires: %{name}-devel = %{version}-%{release} BuildRequires: gcc gcc-gfortran perl-devel gcc-c++ @@ -74,6 +75,7 @@ cd OpenBLAS-%{version} %patch0002 -p1 -b .tests %patch0003 -p1 %patch0004 -p1 +%patch0005 -p1 # Set source permissions find -name \*.f -exec chmod 644 {} \; @@ -425,6 +427,9 @@ rm -rf %{buildroot}%{_libdir}/pkgconfig %endif %changelog +* Fri Nov 3 2023 liubo - 0.3.18-6 +- Fix detection of Apple M1 "Vortex" + * Thu Dec 1 2022 Wenlong Zhang - 0.3.18-5 - fix build error for loongarch64