From d93a9b4610b60112b64caa0f699b7e8a5ca370f9 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 18 Aug 2025 09:41:28 +0000 Subject: automatic import of ANNC --- ANNC.spec | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'ANNC.spec') diff --git a/ANNC.spec b/ANNC.spec index 36ef014..fca393d 100644 --- a/ANNC.spec +++ b/ANNC.spec @@ -11,7 +11,7 @@ Summary: %{name} is an AI compiler designed to optimize and compile ML model into high-performance executable code that can be executed on various targets. Name: ANNC -Version: 0.0.1 +Version: 0.0.2 Release: 1 # Package onnxruntime and SafeInt have MIT License. # Package onnx has Apache License 2.0. @@ -52,13 +52,29 @@ tar -xzf annc_external.tar.gz -C . %autosetup -S git -n %{pkg_version} %build +export ANNC=%{build_dir} +cd %{build_dir}/annc/service/cpu/xla/libs +bash xnnpack.sh -cd %{build_dir} +export XNNPACK_BASE="$ANNC/annc/service/cpu/xla/libs" +export XNNPACK_DIR="$XNNPACK_BASE/XNNPACK" + +CPLUS_INCLUDE_PATH+="$ANNC/annc/service/cpu/xla:" +CPLUS_INCLUDE_PATH+="$ANNC/annc/service/:" +CPLUS_INCLUDE_PATH+="$XNNPACK_DIR/:" +CPLUS_INCLUDE_PATH+="$XNNPACK_DIR/include/:" +CPLUS_INCLUDE_PATH+="$XNNPACK_DIR/src/:" +CPLUS_INCLUDE_PATH+="$XNNPACK_DIR/build/pthreadpool-source/include/:" +export CPLUS_INCLUDE_PATH + +export LD_LIBRARY_PATH=$XNNPACK_DIR:$LD_LIBRARY_PATH run_bazel_build() { bazel --output_user_root=./output \ - build -c opt --copt="-DANNC_ENABLED_GRAPH_OPT" \ - --copt="-DANNC_ENABLED_OPENBLAS" \ + build -c opt \ + --verbose_failures \ + --action_env="baila=548" \ + --define tflite_with_xnnpack=false \ --copt="-g" \ --copt="-DNDBUG" \ annc/service/cpu:libannc.so @@ -76,6 +92,7 @@ fix_action() { run_bazel_build } +cd %{build_dir} if run_bazel_build; then echo "Build succeeded." else @@ -94,6 +111,7 @@ install %{build_dir}/python/tensorflow/kernels/* -t %{install_includedir} install -d %{install_libdir} output_path=$(find %{build_dir} -type f -name "libannc.so") install ${output_path} -t %{install_libdir} +install %{build_dir}/annc/service/cpu/xla/libs/XNNPACK/build/*.so -t %{install_libdir} pushd %{build_dir}/python %py3_install -- cgit v1.2.3