Change:
When trying to get openvino in a shell, something fails to build with a linker error similar to shell nixpkgs#openvino OpenVINO builds successfully and it's provided in a shell. The nix build log is attached. Please run and paste the result.
Web-viewable logs on hydra:
Would also be nice to have a more recent version that could work with frigate.
The original error meant that tbb was built with gcc 11, while openvino was built using gcc 10.

Discussion:
<ins> diff --git a/cmake/developer_package/linux_name.cmake b/cmake/developer_package/linux_name.cmake index 3e8c775770..2d5e00fb8b 100644 --- a/cmake/developer_package/linux_name.cmake +++ b/cmake/developer_package/linux_name.cmake @@ -6,25 +6,7 @@ include(target_flags) if(LINUX) function(get_linux_name res_var) -        if(EXISTS "/etc/lsb-release") -            # linux version detection using cat /etc/lsb-release -            file(READ "/etc/lsb-release" release_data) -            set(name_regex "DISTRIB_ID=([^ n]*)n") -            set(version_regex "DISTRIB_RELEASE=([0-9]+(.[0-9]+)?)") -        else() -            execute_process(COMMAND find -L /etc/ -maxdepth 1 -type f -name *-release -exec cat {} ; -                            OUTPUT_VARIABLE release_data -                            RESULT_VARIABLE result) -            string(REPLACE "Red Hat" "CentOS" release_data "${release_data}") -            set(name_regex "NAME="([^ "n]*).*"n") -            set(version_regex "VERSION="([0-9]+(.[0-9]+)?)[^n]*"") -        endif() - -        string(REGEX MATCH ${name_regex} name ${release_data}) -        set(os_name ${CMAKE_MATCH_1}) - -        string(REGEX MATCH ${version_regex} version ${release_data}) -        set(os_name "${os_name} ${CMAKE_MATCH_1}") +        set(os_name "NixOS @version@") if(os_name) set(${res_var} ${os_name} PARENT_SCOPE) </ins>

{ lib <del> , addOpenGLRunpath , autoPatchelfHook </del> , stdenv , fetchFromGitHub , fetchpatch <ins> , fetchurl , substituteAll # build , addOpenGLRunpath , autoPatchelfHook </ins> , cmake , git <ins> , libarchive , pkg-config , python , shellcheck # runtime , libusb1 , libxml2 , opencv </ins> , protobuf <ins> , pugixml </ins> , tbb <del> , opencv , unzip , shellcheck , srcOnly , python , enablePython ? false </del> }: let <ins> # See FIRMWARE_PACKAGE_VERSION in src/plugins/intel_myriad/myriad_dependencies.cmake myriad_firmware_version = "20221129_35"; myriad_usb_firmware = fetchurl { url = "https://storage.openvinotoolkit.org/dependencies/myriad/firmware_usb-ma2x8x_${myriad_firmware_version}.zip"; hash = "sha256-HKNWbSlMjSafOgrS9WmenbsmeaJKRVssw0NhIwPYZ70="; }; myriad_pcie_firmware = fetchurl { url = "https://storage.openvinotoolkit.org/dependencies/myriad/firmware_pcie-ma2x8x_${myriad_firmware_version}.zip"; hash = "sha256-VmfrAoKQ++ySIgAxWQul+Hd0p7Y4sTF44Nz4RHpO6Mo="; }; </ins> <del> onnx_src = srcOnly { name = "onnx-patched"; src = fetchFromGitHub { owner = "onnx"; repo = "onnx"; rev = "v1.8.1"; sha256 = "+1zNnZ4lAyVYRptfk0PV7koIX9FqcfD1Ah33qj/G2rA="; }; patches = [ # Fix build with protobuf 3.18+ # Remove with onnx 1.9 release (fetchpatch { url = "https://github.com/onnx/onnx/commit/d3bc82770474761571f950347560d62a35d519d7.patch"; sha256 = "0vdsrklkzhdjaj8wdsl4icn93q3961g8dx35zvff0nhpr08wjb7y"; }) ]; </del> <ins> # See GNA_VERSION in cmake/dependencies.cmake gna_version = "03.00.00.1910"; gna = fetchurl { url = "https://storage.openvinotoolkit.org/dependencies/gna/gna_${gna_version}.zip"; hash = "sha256-iU3bwK40WfBFE7hTsMq8MokN1Oo3IooCK2oyEBvbt/g="; </ins> }; <ins> tbbbind_version = "2_5"; tbbbind = fetchurl { url = "https://download.01.org/opencv/master/openvinotoolkit/thirdparty/linux/tbbbind_${tbbbind_version}_static_lin_v2.tgz"; hash = "sha256-hl54lMWEAiM8rw0bKIBW4OarK/fJ0AydxgVhxIS8kPQ="; }; </ins> in stdenv.mkDerivation rec { pname = "openvino"; <del> version = "2021.2"; </del> <ins> version = "2022.3.0"; </ins> src = fetchFromGitHub { owner = "openvinotoolkit"; repo = "openvino"; <del> rev = version; sha256 = "pv4WTfY1U5GbA9Yj07UOLQifvVH3oDfWptxxYW5IwVQ="; </del> <ins> rev = "refs/tags/${version}"; </ins> fetchSubmodules = true; <ins> hash = "sha256-Ie58zTNatiYZZQJ8kJh/+HlSetQjhAtf2Us83z1jGv4="; </ins> }; <ins> outputs = [ "out" "python" ]; nativeBuildInputs = [ addOpenGLRunpath autoPatchelfHook cmake git libarchive pkg-config (python.withPackages (ps: with ps; [ cython pybind11 setuptools ])) shellcheck ]; patches = [ (substituteAll { src = ./cmake.patch; inherit (lib) version; }) ]; postPatch = '' mkdir -p temp/vpu/firmware/{pcie,usb}-ma2x8x pushd temp/vpu/firmware bsdtar -xf ${myriad_pcie_firmware} -C pcie-ma2x8x echo "${myriad_pcie_firmware.url}" > pcie-ma2x8x/ie_dependency.info bsdtar -xf ${myriad_usb_firmware} -C usb-ma2x8x echo "${myriad_usb_firmware.url}" > usb-ma2x8x/ie_dependency.info popd mkdir -p temp/gna_${gna_version} pushd temp/ bsdtar -xf ${gna} autoPatchelf gna_${gna_version} echo "${gna.url}" > gna_${gna_version}/ie_dependency.info popd mkdir -p temp/tbbbind_${tbbbind_version} pushd temp/tbbbind_${tbbbind_version} bsdtar -xf ${tbbbind} echo "${tbbbind.url}" > ie_dependency.info popd ''; </ins> dontUseCmakeBuildDir = true; cmakeFlags = [ <del> "-DNGRAPH_USE_SYSTEM_PROTOBUF:BOOL=ON" "-DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=ON" "-DFETCHCONTENT_SOURCE_DIR_EXT_ONNX:STRING=${onnx_src}" "-DENABLE_VPU:BOOL=OFF" "-DTBB_DIR:STRING=${tbb}" </del> <ins> "-DCMAKE_PREFIX_PATH:PATH=${placeholder "out"}" "-DCMAKE_MODULE_PATH:PATH=${placeholder "out"}/lib/cmake" "-DENABLE_LTO:BOOL=ON" # protobuf "-DENABLE_SYSTEM_PROTOBUF:BOOL=OFF" "-DProtobuf_LIBRARIES=${protobuf}/lib/libprotobuf${stdenv.hostPlatform.extensions.sharedLibrary}" # tbb "-DENABLE_SYSTEM_TBB:BOOL=ON" # opencv </ins> "-DENABLE_OPENCV:BOOL=ON" <del> "-DOPENCV:STRING=${opencv}" "-DENABLE_GNA:BOOL=OFF" "-DENABLE_SPEECH_DEMO:BOOL=OFF" </del> <ins> "-DOpenCV_DIR=${opencv}/lib/cmake/opencv4/" # pugixml "-DENABLE_SYSTEM_PUGIXML:BOOL=ON" # onednn "-DENABLE_ONEDNN_FOR_GPU:BOOL=OFF" # intel gna "-DENABLE_INTEL_GNA:BOOL=ON" # python "-DENABLE_PYTHON:BOOL=ON" # tests "-DENABLE_CPPLINT:BOOL=OFF" </ins> "-DBUILD_TESTING:BOOL=OFF" <del> "-DENABLE_CLDNN_TESTS:BOOL=OFF" "-DNGRAPH_INTERPRETER_ENABLE:BOOL=ON" "-DNGRAPH_TEST_UTIL_ENABLE:BOOL=OFF" "-DNGRAPH_UNIT_TEST_ENABLE:BOOL=OFF" </del> "-DENABLE_SAMPLES:BOOL=OFF" <del> "-DENABLE_CPPLINT:BOOL=OFF" ] ++ lib.optionals enablePython [ "-DENABLE_PYTHON:BOOL=ON" </del> ]; <del> preConfigure = '' # To make install openvino inside /lib instead of /python substituteInPlace inference-engine/ie_bridges/python/CMakeLists.txt  --replace 'DESTINATION python/''${PYTHON_VERSION}/openvino' 'DESTINATION lib/''${PYTHON_VERSION}/site-packages/openvino'  --replace 'DESTINATION python/''${PYTHON_VERSION}' 'DESTINATION lib/''${PYTHON_VERSION}/site-packages/openvino' substituteInPlace inference-engine/ie_bridges/python/src/openvino/inference_engine/CMakeLists.txt  --replace 'python/''${PYTHON_VERSION}/openvino/inference_engine' 'lib/''${PYTHON_VERSION}/site-packages/openvino/inference_engine' # Used to download OpenCV based on Linux Distro and make it use system OpenCV substituteInPlace inference-engine/cmake/dependencies.cmake  --replace 'include(linux_name)' ' '  --replace 'if (ENABLE_OPENCV)' 'if (ENABLE_OPENCV AND NOT DEFINED OPENCV)' cmakeDir=$PWD mkdir ../build cd ../build ''; autoPatchelfIgnoreMissingDeps = [ "libngraph_backend.so" ]; nativeBuildInputs = [ cmake autoPatchelfHook addOpenGLRunpath unzip </del> <ins> autoPatchelfIgnoreMissingDeps = [ "libngraph_backend.so" </ins> ]; buildInputs = [ <del> git protobuf </del> <ins> libusb1 libxml2 </ins> opencv <del> python </del> <ins> protobuf pugixml </ins> tbb <del> shellcheck ] ++ lib.optionals enablePython (with python.pkgs; [ cython pybind11 ]); </del> <ins> ]; enableParallelBuilding = true; postInstall = '' pushd $out/python/python${lib.versions.majorMinor python.version} mkdir -p $python mv ./* $python/ popd rm -r $out/python ''; </ins> postFixup = '' # Link to OpenCL

homepage = "https://docs.openvinotoolkit.org/"; license = with licenses; [ asl20 ]; platforms = platforms.all; <del> broken = (stdenv.isLinux && stdenv.isx86_64) # at 2022-09-23 || stdenv.isDarwin; # Cannot find macos sdk </del> <ins> broken = stdenv.isDarwin; # Cannot find macos sdk </ins> maintainers = with maintainers; [ tfmoraes ]; }; }

<ins> { lib , buildPythonPackage , openvino-native , numpy , python }: buildPythonPackage { pname = "openvino"; inherit (openvino-native) version; format = "other"; src = openvino-native.python; propagatedBuildInputs = [ numpy ]; installPhase = '' runHook preInstall mkdir -p $out/${python.sitePackages} cp -Rv * $out/${python.sitePackages}/ runHook postInstall ''; pythonImportsCheck = [ "ngraph" "openvino" "openvino.runtime" ]; meta = with lib; { description = "OpenVINO(TM) Runtime"; homepage = "https://github.com/openvinotoolkit/openvino"; license = licenses.asl20; maintainers = with maintainers; [ hexa ]; }; } </ins>

openring = callPackage ../applications/misc/openring { }; <del> openvino = callPackage ../development/libraries/openvino { stdenv = gcc10StdenvCompat; python = python3; }; </del> <ins> openvino = callPackage ../development/libraries/openvino { python = python3; }; </ins> phonetisaurus = callPackage ../development/libraries/phonetisaurus { # https://github.com/AdolfVonKleist/Phonetisaurus/issues/70

opentracing = callPackage ../development/python-modules/opentracing { }; <del> openvino = toPythonModule (pkgs.openvino.override { inherit (self) python; enablePython = true; }); </del> <ins> openvino = callPackage ../development/python-modules/openvino { openvino-native = pkgs.openvino.override { inherit python; }; }; </ins> openwebifpy = callPackage ../development/python-modules/openwebifpy { };