From f3b68ef59a7a48b494ec725d9aec8e164ea6a3c5 Mon Sep 17 00:00:00 2001 From: Susi Lehtola Date: Tue, 11 Feb 2020 21:35:50 +0100 Subject: [PATCH] ARMv7 still doesn't have runtime cpu detection. --- openblas.spec | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/openblas.spec b/openblas.spec index e580bab..6e4b99e 100644 --- a/openblas.spec +++ b/openblas.spec @@ -371,7 +371,8 @@ export AVX="NO_AVX2=1" %endif %ifarch armv7hl -TARGET="TARGET=ARMV7 DYNAMIC_ARCH=1 DYNAMIC_OLDER=1" +# ARM v7 still doesn't have runtime cpu detection... +TARGET="TARGET=ARMV7 DYNAMIC_ARCH=0" %endif %ifarch ppc64 TARGET="TARGET=POWER6 DYNAMIC_ARCH=1 DYNAMIC_OLDER=1" @@ -446,10 +447,20 @@ cp -a %{_includedir}/lapacke %{buildroot}%{_includedir}/%{name} # Fix i686-x86_64 multilib difference %multilib_fix_c_header --file %{_includedir}/openblas/openblas_config.h -# Fix name of libraries -slibname=`basename %{buildroot}%{_libdir}/libopenblas-*.so .so` +# Fix name of libraries: runtime CPU detection has none +suffix="" +# but archs that don't have it do have one +%ifarch armv7hl +suffix="_armv7" +%endif +slibname=`basename %{buildroot}%{_libdir}/libopenblas${suffix}-*.so .so` mv %{buildroot}%{_libdir}/${slibname}.a %{buildroot}%{_libdir}/lib%{name}.a -sname=${slibname} +if [[ "$suffix" != "" ]]; then + sname=$(echo $slibname | sed "s|$suffix||g") + mv %{buildroot}%{_libdir}/${slibname}.so %{buildroot}%{_libdir}/${sname}.so +else + sname=${slibname} +fi # Install the Rblas library mkdir -p %{buildroot}%{_libdir}/R/lib/ @@ -482,8 +493,13 @@ install -D -p -m 644 serial64/${slibname64}.a %{buildroot}%{_libdir}/lib%{name}6 slibname64_=`echo ${slibname} | sed "s|lib%{name}|lib%{name}64_|g"` install -D -p -m 644 serial64_/${slibname64_}.a %{buildroot}%{_libdir}/lib%{name}64_.a -sname64=${slibname64} -sname64_=${slibname64_} +if [[ "$suffix" != "" ]]; then + sname64=$(echo ${slibname64} | sed "s|$suffix||g") + sname64_=$(echo ${slibname64_} | sed "s|$suffix||g") +else + sname64=${slibname64} + sname64_=${slibname64_} +fi install -D -p -m 755 serial64/${slibname64}.so %{buildroot}%{_libdir}/${sname64}.so install -D -p -m 755 serial64_/${slibname64_}.so %{buildroot}%{_libdir}/${sname64_}.so