1
0
forked from jengelh/xxhash

Compare commits

..

No commits in common. "fix-dispatch" and "master" have entirely different histories.

View File

@ -59,32 +59,30 @@ Headers and other development files for xxHash.
%autosetup -p1 -n xxHash-%{version} %autosetup -p1 -n xxHash-%{version}
%build %build
# upstream make -O3 mandatory to get performance gain
tmpflags="$(echo %{optflags} | sed 's,-O2,-O3,g')"
# ALLOW_AVX just means "we guarantee we policed our %%optflags". # ALLOW_AVX just means "we guarantee we policed our %%optflags".
export CFLAGS="${tmpflags} -DXXH_X86DISPATCH_ALLOW_AVX=1" export CFLAGS="%{optflags} -DXXH_X86DISPATCH_ALLOW_AVX=1"
export CXXFLAGS="${CFLAGS}" export CXXFLAGS="$CFLAGS"
export LDFLAGS="%{?build_ldflags}" export LDFLAGS="%{?build_ldflags}"
# DISPATCH=1 if you want AVX2/AVX512. But it does not seem to perform any # DISPATCH=1 if you want AVX2/AVX512. But it does not seem to perform any
# better than the lowest-denomimation code on at least the 1135G7 and 5950X # better than the lowest-denomimation code on at least the 1135G7 and 5950X
# CPUs, and for both LP64 as well as ILP32 — it seems to be all within margin # CPUs, and for both LP64 as well as ILP32 — it seems to be all within margin
# of error. # of error.
%make_build prefix=%{_prefix} libdir=%{_libdir} DISPATCH=1 %make_build prefix=%{_prefix} libdir=%{_libdir}
%install %install
export CFLAGS="${tmpflags} -DXXH_X86DISPATCH_ALLOW_AVX=1" export CFLAGS="%{optflags} -DXXH_X86DISPATCH_ALLOW_AVX=1"
export CXXFLAGS="${CFLAGS}" export CXXFLAGS="%{optflags}"
export LDFLAGS="%{?build_ldflags}" export LDFLAGS="%{?build_ldflags}"
%make_install prefix=%{_prefix} libdir=%{_libdir} DISPATCH=1 %make_install prefix=%{_prefix} libdir=%{_libdir}
rm -rf %{buildroot}%{_libdir}/libxxhash.a rm -rf %{buildroot}%{_libdir}/libxxhash.a
%check %check
export CFLAGS="${tmpflags}" export CFLAGS="%{optflags}"
export CXXFLAGS="${CFLAGS}" export CXXFLAGS="%{optflags}"
export LDFLAGS="%{?build_ldflags}" export LDFLAGS="%{?build_ldflags}"
# not safe for parallel execution as it removes xxhash.o and recreates it with different flags # not safe for parallel execution as it removes xxhash.o and recreates it with different flags
# the list is taken from test-all with non-working/irrelevant ones (such as ones that change the toolchain) removed # the list is taken from test-all with non-working/irrelevant ones (such as ones that change the toolchain) removed
%make_build -j1 DISPATCH=1 test test-unicode listL120 trailingWhitespace test-xxh-nnn-sums %make_build -j1 test test-unicode listL120 trailingWhitespace test-xxh-nnn-sums
%ldconfig_scriptlets -n libxxhash0 %ldconfig_scriptlets -n libxxhash0
@ -106,7 +104,6 @@ export LDFLAGS="%{?build_ldflags}"
%files devel %files devel
%{_includedir}/xxhash.h %{_includedir}/xxhash.h
%{_includedir}/xxh3.h %{_includedir}/xxh3.h
%{_includedir}/xxh_x86dispatch.h
%{_libdir}/pkgconfig/libxxhash.pc %{_libdir}/pkgconfig/libxxhash.pc
%{_libdir}/libxxhash.so %{_libdir}/libxxhash.so