ARMv7 still doesn't have runtime cpu detection.

This commit is contained in:
Susi Lehtola 2020-02-11 21:35:50 +01:00
parent 4d572b6aca
commit f3b68ef59a

View File

@ -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
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
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