diff options
Diffstat (limited to 'ANNC.spec')
-rw-r--r-- | ANNC.spec | 31 |
1 files changed, 21 insertions, 10 deletions
@@ -20,7 +20,9 @@ URL: https://gitee.com/openeuler/ANNC Source0: %{pkg_version}.tar.gz Source1: external.tar.gz.aa Source2: external.tar.gz.ab -Source3: XNNPACK.tar.gz +Source3: external.tar.gz.ac +Source4: XNNPACK.tar.gz +Source5: v3.2.tar.gz %ifarch x86_64 Patch0: x86_64_external_files.patch %endif @@ -45,19 +47,20 @@ BuildRequires: bazel %{name} is is an AI compiler designed to optimize and compile ML model into high-performance executable code that can be executed on various targets. %prep -cat %{SOURCE1} %{SOURCE2} > external.tar.gz +cat %{SOURCE1} %{SOURCE2} %{SOURCE3} > external.tar.gz tar xf external.tar.gz -C . -tar xf %{SOURCE3} -C . %ifarch x86_64 -%patch 0 -p1 -d . +%patch0 -p1 -d . %endif - -%autosetup -S git -n %{pkg_version} +tar xf %{SOURCE4} -C . +mkdir proxy +mv %{SOURCE5} ./proxy +%setup -q -n %{pkg_version} %build export ANNC=%{build_dir} cd %{_builddir}/XNNPACK/build -CFLAGS="-fPIC" cmake .. -DXNNPACK_BUILD_BENCHMARKS=OFF \ +CFLAGS="-fPIC" CXXFLAGS="-fPIC" cmake .. -DXNNPACK_BUILD_BENCHMARKS=OFF \ -DXNNPACK_BUILD_TESTS=OFF \ -DXNNPACK_LIBRARY_TYPE=shared \ -DCMAKE_BUILD_TYPE=Release @@ -83,7 +86,8 @@ run_bazel_build() { --action_env="baila=548" \ --define tflite_with_xnnpack=false \ --jobs=%{max_jobs} \ - annc/service/cpu:libannc.so + --distdir=%{_builddir}/proxy \ + annc/service/cpu:libannc.so # --copt="-g" \ # --copt="-DNDBUG" \ # annc/service/cpu:libannc.so @@ -94,7 +98,7 @@ fix_action() { external_path=$(find . -name "external" | head -n 1) if [ -n "$external_path" ]; then rm -rf $external_path/* - cp -r %{_builddir}/external/* $external_path + cp -LR %{_builddir}/external/* $external_path else echo "Not find external directory." fi @@ -115,7 +119,8 @@ pushd %{build_dir}/python %install install -d %{install_includedir} install %{build_dir}/annc/service/cpu/kdnn_rewriter.h -t %{install_includedir} -install %{build_dir}/install/*.patch -t %{install_includedir} +install %{build_dir}/annc/service/cpu/annc_flags.h -t %{install_includedir} +cp -r %{build_dir}/install/* %{install_includedir} install %{build_dir}/python/tensorflow/kernels/* -t %{install_includedir} install -d %{install_libdir} output_path=$(find %{build_dir} -type f -name "libannc.so") @@ -133,6 +138,12 @@ pushd %{build_dir}/python /usr/bin/annc-apply-tf %changelog +* Fri Aug 22 2025 Chenhui Zheng <zhengchenhui1@huawei.com> - 0.0.2-1 +- Type:Update +- ID:NA +- SUG:NA +- DEC:Release v0.0.2 + * Mon May 12 2025 Chenhui Zheng <zhengchenhui1@huawei.com> - 0.0.1-1 - Type:Init - ID:NA |