%global pkgvers 0 %global scdate0 20241128 %global schash0 668a518ebcfd5ae0024ebd9d540868e26ff93171 %global branch0 master %global source0 https://github.com/google/xnnpack.git %global sshort0 %{expand:%%{lua:print(('%{schash0}'):sub(1,8))}} Name: xnnpack Version: 0 Release: %{scdate0}.%{pkgvers}.git%{sshort0}%{?dist} Summary: Highly optimized library of floating-point neural network Epoch: 1 License: BSD URL: https://github.com/google/xnnpack ExclusiveArch: x86_64 aarch64 BuildRequires: cmake git fp16-devel psimd-devel fxdiv-devel cpuinfo-devel pthreadpool-devel python3 %if 0%{?rhel} >= 8 BuildRequires: gcc-toolset-12-gcc-c++ %else BuildRequires: gcc-c++ %endif %undefine _annotated_build %global __cmake_in_source_build 1 %description XNNPACK is a highly optimized library of floating-point neural network inference operators for ARM, WebAssembly, and x86 (SSE2 level) platforms. %package devel Summary: Development files Requires: %{name} = %{epoch}:%{version}-%{release} %description devel This package contains the development files. %package static Summary: Static development files Requires: %{name}-devel = %{epoch}:%{version}-%{release} %description static This package contains the static development files. %prep %setup -T -c -n %{name} git clone --depth 1 -n -b %{branch0} %{source0} . git fetch --depth 1 origin %{schash0} git reset --hard %{schash0} git log --format=fuller # c++17 sed -i 's|CXX_STANDARD 11|CXX_STANDARD 17|' CMakeLists.txt # externals sed -i '/PRIVATE fp16/d' CMakeLists.txt sed -i '/PRIVATE psimd/d' CMakeLists.txt sed -i '/PRIVATE fxdiv/d' CMakeLists.txt sed -i '/NOT TARGET clog/,/^ENDIF/d' CMakeLists.txt sed -i '/NOT TARGET cpuinfo/,/^ENDIF/d' CMakeLists.txt sed -i '/NOT TARGET pthreadpool/,/^ENDIF/d' CMakeLists.txt sed -i '/NOT TARGET fxdiv/,/^ENDIF/d' CMakeLists.txt sed -i '/NOT TARGET psimd/,/^ENDIF/d' CMakeLists.txt sed -i '/NOT TARGET fp16/,/^ENDIF/d' CMakeLists.txt sed -i -e 's|riscv|ppc64le\|riscv|g' CMakeLists.txt sed -i -e 's|XNNPACK PROPERTIES C_EXTENSIONS YES|XNNPACK PROPERTIES C_EXTENSIONS YES SOVERSION 1 VERSION 1.0|g' CMakeLists.txt %build %if 0%{?rhel} >= 8 source scl_source enable gcc-toolset-12 %endif mkdir build pushd build %ifarch aarch64 export CFLAGS="%{optflags} -Wno-incompatible-pointer-types -Wno-missing-braces -flax-vector-conversions -fPIC" %else export CFLAGS="%{optflags} -Wno-incompatible-pointer-types -Wno-missing-braces -mfma -mf16c -mavx2 -mavx -fPIC" %endif %cmake .. -Wno-dev \ -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_VERBOSE_MAKEFILE=OFF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DXNNPACK_LIBRARY_TYPE=shared \ -DXNNPACK_ENABLE_JIT=OFF \ -DXNNPACK_BUILD_TESTS=OFF \ -DXNNPACK_BUILD_BENCHMARKS=OFF \ -DXNNPACK_ENABLE_KLEIDIAI=OFF \ %if 0%{?rhel} == 8 -DXNNPACK_ENABLE_ARM_BF16=OFF \ %endif -DXNNPACK_USE_SYSTEM_LIBS=ON make %{?_smp_mflags} popd %install rm -rf %{buildroot} pushd build make install DESTDIR=%{buildroot} popd %files %license LICENSE %doc README.md %{_libdir}/lib*.so.* %files devel %license LICENSE %doc README.md %{_includedir}/* %{_libdir}/lib*.so %files static %{_libdir}/lib*.a %changelog * Tue Jul 11 2017 Cristian Balint - github update releases