%define pkg_ver 2025_12_rc2 %define ov_ver 2025.0.0 %global desc %{expand: \ Intel NPU device is an AI inference accelerator integrated with Intel client CPUs, starting from Intel Core Ultra generation of CPUs (formerly known as Meteor Lake). It enables energy-efficient execution of artificial neural network tasks.} Name: intel-npu-compiler Version: 2025.12 Release: %autorelease Summary: Intel Neural Processing Unit Compiler License: Apache-2.0 URL: https://github.com/openvinotoolkit/npu_compiler Source0: %url/archive/npu_ud_%{pkg_ver}/%{name}-%{pkg_ver}.tar.gz Source1: https://github.com/openvinotoolkit/openvino/archive/2025.0.0/openvino-%{ov_ver}.tar.gz Source2: https://github.com/intel/level-zero-npu-extensions/archive/110f48ee8eda22d8b40daeeecdbbed0fc3b08f8b/level-zero-npu-extensions-110f48e.tar.gz Source3: https://github.com/openvinotoolkit/npu_plugin_elf/archive/ce501d3059c81fd6bd0ad7165ab823838fa5d851/npu_plugin_elf-ce501d3.tar.gz Source4: https://github.com/intel/npu-nn-cost-model/archive/a965531d3d3a37748cc5ab7feac342b35baaf7b4/npu-nn-cost-model-a965531.tar.gz Source5: https://github.com/intel/npu-plugin-llvm/arhcive/0d1145010d6d2ba48a945c824ed0ca03254b94ed/npu-plugin-llvm-0d11450.tar.gz Source6: https://github.com/google/flatbuffers/archive/6df40a2471737b27271bdd9b900ab5f3aec746c7/flatbuffers-6df40a2.tar.gz Source7: dependencies.cmake Patch0: npu-disable-git.patch Patch1: npu-disable-yaml-cpp.patch Patch2: npu-driver-compiler-include.patch Patch3: npu-compiler-fix-install.patch Patch4: npu-vpux-driver-compiler.patch Patch5: npu-level-zero.patch ExclusiveArch: x86_64 BuildRequires: cmake %if 0%{?fedora} > 42 || 0%{?rhel} > 10 BuildRequires: gcc14 BuildRequires: gcc14-c++ %else BuildRequires: gcc BuildRequires: gcc-c++ %endif BuildRequires: gflags-devel BuildRequires: libedit-devel BuildRequires: libffi-devel BuildRequires: libxml2-devel BuildRequires: openblas-devel BuildRequires: oneapi-level-zero-devel BuildRequires: pugixml-devel BuildRequires: tbb-devel BuildRequires: xbyak-devel BuildRequires: yaml-cpp-devel # openvino Provides: bundled(openvino) # level-zero-npu-extension Provides: bundled(level-zero-npu-extensions) # openvino-npu_plugin_elf Provides: bundled(openvino-npu_plugin_elf) # npu-nn-cost-mode Provides: bundled(npu-nn-cost-model) # npu-plugin-llvm Provides: bundled(npu-plugin-llvm) # flatbuffers Provides: bundled(flatbuffers) %description %{desc} %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for applications that use %{name}. %prep %autosetup -N -n npu_compiler-npu_ud_%{pkg_ver} %patch -P 0 -p1 %patch -P 1 -p1 %patch -P 2 -p1 %patch -P 3 -p1 %patch -P 4 -p1 # disable mlir_compiler_static link sed -i '/npu_mlir_compiler_static/d' src/vpux_driver_compiler/src/vpux_compiler_l0/CMakeLists.txt # disable test sed -i '/^add_subdirectory(test)/s/^/#/' src/vpux_driver_compiler/CMakeLists.txt # extract openvino tar xf %{SOURCE1} # extract openvino npu-plugin rm -rf openvino-%{ov_ver}/src/plugins/intel_npu/thirdparty/level-zero-ext tar xf %{SOURCE2} mv level-* openvino-%{ov_ver}/src/plugins/intel_npu/thirdparty/level-zero-ext %patch -d openvino-%{ov_ver} -P 5 -p1 # extract npu_plugin_elf tar xf %{SOURCE3} rm -rf thirdparty/elf mv npu_plugin_elf-* thirdparty/elf # extract npu-nn-cost-model tar xf %{SOURCE4} rm -rf thirdparty/vpucostmodel mv npu-nn-cost-model-* thirdparty/vpucostmodel # extract npu-plugin-llvm tar xf %{SOURCE5} rm -rf thirdparty/llvm-project mv npu-plugin-llvm-* thirdparty/llvm-project # disable atomic builtins sed -i '/^include(CheckAtomic)/s/^/#/' thirdparty/llvm-project/llvm/cmake/config-ix.cmake # extract flatbuffers tar xf %{SOURCE6} rm -rf thirdparty/flatbuffers mv flatbuffers-* thirdparty/flatbuffers # Remove openvino thirdparty deps rm -rf openvino-%{ov_ver}/thirdparty/* cp %{SOURCE7} openvino-%{ov_ver}/thirdparty/ # openvino gcc-15 include cstdint sed -i '/#include .*/a#include ' openvino-%{ov_ver}/src/core/include/openvino/core/type/bfloat16.hpp sed -i '/#include .*/a#include ' openvino-%{ov_ver}/src/core/include/openvino/core/type/float16.hpp sed -i '/#include .*/a#include ' openvino-%{ov_ver}/src/core/include/openvino/core/type/float8_e4m3.hpp sed -i '/#include .*/a#include ' openvino-%{ov_ver}/src/core/include/openvino/core/type/float8_e5m2.hpp sed -i '/#include .*/a#include ' openvino-%{ov_ver}/src/core/include/openvino/core/type/float8_e8m0.hpp sed -i '/#include .*/a#include ' openvino-%{ov_ver}/src/core/include/openvino/core/type/float4_e2m1.hpp sed -i '/#include .*/a#include ' openvino-%{ov_ver}/src/core/dev_api/openvino/core/type/nf4.hpp sed -i '/#include .*/a#include ' openvino-%{ov_ver}/src/common/snippets/include/snippets/utils/debug_caps_config.hpp sed -i '/#include .*/a#include ' openvino-%{ov_ver}/src/plugins/intel_npu/src/plugin/npuw/partitioning/online/graph.hpp sed -i '/#include .*/a#include ' openvino-%{ov_ver}/src/plugins/intel_npu/src/plugin/npuw/serialization.hpp sed -i '/#include .*/a#include ' openvino-%{ov_ver}/src/plugins/intel_npu/tools/protopipe/src/graph.hpp sed -i '/#include .*/a#include ' openvino-%{ov_ver}/src/plugins/intel_npu/tools/protopipe/src/scenario/criterion.hpp %build export NPU_PLUGIN_HOME="$PWD" export OPENVINO_HOME="$PWD/openvino-%{ov_ver}" export CFLAGS="${CFLAGS/-Werror=format-security/} -Wno-error=stringop-overflow -Wno-error=maybe-uninitialized -Wno-error=dangling-reference -Wno-error=template-id-cdtor" export CXXFLAGS="${CXXFLAGS/-Werror=format-security/} -Wno-error=stringop-overflow -Wno-error=maybe-uninitialized -Wno-error=dangling-reference -Wno-error=template-id-cdtor" %cmake -S openvino-%{ov_ver} \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ %if 0%{?fedora} > 42 || 0%{?rhel} > 10 -DCMAKE_C_COMPILER=gcc-14 \ -DCMAKE_CXX_COMPILER=g++-14 \ %else -DCMAKE_C_COMPILER=gcc \ -DCMAKE_CXX_COMPILER=g++ \ %endif -DENABLE_CLANG_FORMAT=OFF \ -DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \ -DENABLE_QSPECTRE=OFF \ -DENABLE_INTEGRITYCHECK=OFF \ -DENABLE_SANITIZER=OFF \ -DENABLE_UB_SANITIZER=OFF \ -DENABLE_THREAD_SANITIZER=OFF \ -DENABLE_COVERAGE=OFF \ -DENABLE_FASTER_BUILD=OFF \ -DENABLE_CPPLINT=OFF \ -DENABLE_CPPLINT_REPORT=OFF \ -DENABLE_GAPI_PREPROCESSING=OFF \ -DENABLE_NCC_STYLE=OFF \ -DENABLE_UNSAFE_LOCATIONS=OFF \ -DENABLE_FUZZING=OFF \ -DENABLE_PROFILING_ITT=OFF \ -DENABLE_STRICT_DEPENDENCIES=OFF \ -DENABLE_DEBUG_CAPS=OFF \ -DENABLE_AUTO=OFF \ -DENABLE_AUTO_BATCH=OFF \ -DENABLE_HETERO=OFF \ -DENABLE_INTEL_CPU=OFF \ -DENABLE_MLAS_FOR_CPU=OFF \ -DENABLE_MLAS_FOR_CPU_DEFAULT=OFF \ -DENABLE_INTEL_GNA=OFF \ -DENABLE_INTEL_GPU=OFF \ -DENABLE_SYSTEM_LEVEL_ZERO=ON \ -DENABLE_INTEL_NPU=ON \ -DENABLE_NPU_PLUGIN_ENGINE=OFF \ -DENABLE_ONEDNN_FOR_GPU=OFF \ -DENABLE_MULTI=OFF \ -DENABLE_PROXY=OFF \ -DENABLE_TEMPLATE=OFF \ -DENABLE_OV_ONNX_FRONTEND=OFF \ -DENABLE_OV_PADDLE_FRONTEND=OFF \ -DENABLE_OV_JAX_FRONTEND=OFF \ -DENABLE_OV_IR_FRONTEND=ON \ -DENABLE_OV_PYTORCH_FRONTEND=OFF \ -DENABLE_OV_TF_FRONTEND=OFF \ -DENABLE_OV_TF_LITE_FRONTEND=OFF \ -DENABLE_PYTHON=OFF \ -DENABLE_JS=OFF \ -DENABLE_SYSTEM_LIBS_DEFAULT=ON \ -DENABLE_SYSTEM_OPENCL=OFF \ -DENABLE_SYSTEM_PUGIXML=ON \ -DENABLE_SYSTEM_PROTOBUF=OFF \ -DTHREADING=TBB \ -DENABLE_SYSTEM_TBB=ON \ -DTBB_LIB_INSTALL_DIR=%{_libdir} \ -DENABLE_TBBBIND_2_5=OFF \ -DENABLE_TBB_RELEASE_ONLY=ON \ -DENABLE_SAMPLES=OFF \ -DENABLE_TESTS=OFF \ -DBUILD_SHARED_LIBS=ON \ -DENABLE_PRIVATE_TESTS=OFF \ -DENABLE_NPU_LSP_SERVER=OFF \ -DENABLE_PREBUILT_LLVM_MLIR_LIBS=OFF \ -DOPENVINO_EXTRA_MODULES=$NPU_PLUGIN_HOME \ -DBLAS_LIBRARIES=%{_libdir} \ -DLibEdit_LIBRARIES=%{_libdir}/libedit.so \ -DLibEdit_INCLUDE_DIRS=%{_includedir}/histedit.h \ -DENABLE_DEVELOPER_BUILD=OFF \ -DENABLE_MLIR_COMPILER=OFF \ -DBUILD_COMPILER_FOR_DRIVER=ON \ -DENABLE_DRIVER_COMPILER_ADAPTER=OFF \ -DENABLE_SOURCE_PACKAGE=OFF \ %cmake_build %install %cmake_install # remove openvino files rm -v %{buildroot}/usr/setupvars.sh rm -rfv %{buildroot}/usr/install_dependencies rm -rfv %{buildroot}/usr/licenses rm -rfv %{buildroot}/usr/runtime rm -rfv %{buildroot}/usr/src %files %license LICENSE %{_bindir}/compile_tool %{_libdir}/libnpu_driver_compiler.so.2025 %{_libdir}/libnpu_driver_compiler.so.%{version} %files devel %{_includedir}/npu_driver_compiler.h %{_libdir}/libnpu_driver_compiler.so %changelog %autochangelog