Change:
Meaningful errors Full logs: system: host os: multi-user?: sandbox: version: channels(root): channels(jarrod): nixpkgs: Source file with issue:  I tried to locate where is defined, but was unable to.
Edited the issue and I'm not sure if GitHub retroactively sends notifications, so pardon the double-mention:
Will be fixed by .

Discussion:
<ins> From a29cffa646356228d6ec7bd7ce21fe3ab90fdd19 Mon Sep 17 00:00:00 2001 From: Someone Serge <sergei.kozlukov@aalto.fi> Date: Wed, 7 Feb 2024 16:59:09 +0000 Subject: [PATCH] eigen: allow dependency injection --- cmake/external/eigen.cmake | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cmake/external/eigen.cmake b/cmake/external/eigen.cmake index c0f7ddc50e..996b83d18a 100644 --- a/cmake/external/eigen.cmake +++ b/cmake/external/eigen.cmake @@ -1,4 +1,3 @@ - if (onnxruntime_USE_PREINSTALLED_EIGEN) add_library(eigen INTERFACE) file(TO_CMAKE_PATH ${eigen_SOURCE_PATH} eigen_INCLUDE_DIRS) @@ -10,14 +9,21 @@ else () URL ${DEP_URL_eigen} URL_HASH SHA1=${DEP_SHA1_eigen} PATCH_COMMAND ${Patch_EXECUTABLE} --ignore-space-change --ignore-whitespace < ${PROJECT_SOURCE_DIR}/patches/eigen/Fix_Eigen_Build_Break.patch +            FIND_PACKAGE_ARGS NAMES Eigen3 ) else() FetchContent_Declare( eigen URL ${DEP_URL_eigen} URL_HASH SHA1=${DEP_SHA1_eigen} +            FIND_PACKAGE_ARGS NAMES Eigen3 ) endif() -    FetchContent_Populate(eigen) -    set(eigen_INCLUDE_DIRS  "${eigen_SOURCE_DIR}") +    FetchContent_MakeAvailable(eigen) +    add_library(eigen ALIAS Eigen3::Eigen) + +    # Onnxruntime doesn't always use `eigen` as a target in +    # `target_link_libraries`, sometimes it just uses +    # `target_include_directories`: +    get_target_property(eigen_INCLUDE_DIRS Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES) endif() -- 2.42.0 </ins>

, lib , fetchFromGitHub , fetchFromGitLab <del> , fetchpatch , fetchurl </del> , Foundation , abseil-cpp , cmake <ins> , eigen , gtest </ins> , libpng , nlohmann_json , nsync

, zlib , microsoft-gsl , iconv <del> , gtest </del> , protobuf_21 , pythonSupport ? true }:

sha256 = "sha256-BYL7wxsYRI45l8C3VwxYIIocn5TzJnBtU0UZ9pHwwZw="; }; <del> eigen = fetchFromGitLab { owner = "libeigen"; repo = "eigen"; rev = "d10b27fe37736d2944630ecd7557cefa95cf87c9"; sha256 = "sha256-Lmco0s9gIm9sIw7lCr5Iewye3RmrHEE4HLfyzRkQCm0="; }; </del> mp11 = fetchFromGitHub { owner = "boostorg"; repo = "mp11"; rev = "boost-1.79.0"; <del> sha256 = "sha256-ZxgPDLvpISrjpEHKpLGBowRKGfSwTf6TBfJD18yw+LM="; </del> <ins> hash = "sha256-ZxgPDLvpISrjpEHKpLGBowRKGfSwTf6TBfJD18yw+LM="; </ins> }; safeint = fetchFromGitHub { owner = "dcleblanc"; repo = "safeint"; rev = "ff15c6ada150a5018c5ef2172401cb4529eac9c0"; <del> sha256 = "sha256-PK1ce4C0uCR4TzLFg+elZdSk5DdPCRhhwT3LvEwWnPU="; </del> <ins> hash = "sha256-PK1ce4C0uCR4TzLFg+elZdSk5DdPCRhhwT3LvEwWnPU="; </ins> }; pytorch_cpuinfo = fetchFromGitHub {

repo = "cpuinfo"; # There are no tags in the repository rev = "5916273f79a21551890fd3d56fc5375a78d1598d"; <del> sha256 = "sha256-nXBnloVTuB+AVX59VDU/Wc+Dsx94o92YQuHp3jowx2A="; </del> <ins> hash = "sha256-nXBnloVTuB+AVX59VDU/Wc+Dsx94o92YQuHp3jowx2A="; </ins> }; flatbuffers = fetchFromGitHub { owner = "google"; repo = "flatbuffers"; rev = "v1.12.0"; <del> sha256 = "sha256-L1B5Y/c897Jg9fGwT2J3+vaXsZ+lfXnskp8Gto1p/Tg="; </del> <ins> hash = "sha256-L1B5Y/c897Jg9fGwT2J3+vaXsZ+lfXnskp8Gto1p/Tg="; </ins> }; gtest' = gtest.overrideAttrs (oldAttrs: rec {

rev = "v${version}"; hash = "sha256-LVLEn+e7c8013pwiLzJiiIObyrlbBHYaioO/SWbItPQ="; }; <del> }); </del> <ins> }); onnx = fetchFromGitHub { owner = "onnx"; repo = "onnx"; rev = "refs/tags/v1.14.1"; hash = "sha256-ZVSdk6LeAiZpQrrzLxphMbc1b3rNUMpcxcXPP8s/5tE="; }; </ins> in stdenv.mkDerivation rec { pname = "onnxruntime"; <del> version = "1.15.1"; </del> <ins> version = "1.16.3"; </ins> src = fetchFromGitHub { owner = "microsoft"; repo = "onnxruntime"; <del> rev = "v${version}"; sha256 = "sha256-SnHo2sVACc++fog7Tg6f2LK/Sv/EskFzN7RZS7D113s="; </del> <ins> rev = "refs/tags/v${version}"; hash = "sha256-bTW9Pc3rvH+c8VIlDDEtAXyA3sajVyY5Aqr6+SxaMF4="; </ins> fetchSubmodules = true; }; <ins> patches = [ # If you stumble on these patches trying to update onnxruntime, check # `git blame` and ping the introducers. # Context: we want the upstream to # - always try find_package first (FIND_PACKAGE_ARGS), # - use MakeAvailable instead of the low-level Populate, # - use Eigen3::Eigen as the target name (as declared by libeigen/eigen). ./0001-eigen-allow-dependency-injection.patch ]; </ins> nativeBuildInputs = [ cmake pkg-config python3Packages.python protobuf_21 ] ++ lib.optionals pythonSupport (with python3Packages; [ <del> setuptools wheel </del> pip <ins> python </ins> pythonOutputDistHook <ins> setuptools wheel </ins> ]); buildInputs = [ <ins> eigen </ins> libpng zlib nlohmann_json <del> nsync re2 </del> microsoft-gsl <del> ] ++ lib.optionals pythonSupport [ python3Packages.numpy python3Packages.pybind11 python3Packages.packaging ] ++ lib.optionals stdenv.isDarwin [ </del> <ins> ] ++ lib.optionals pythonSupport (with python3Packages; [ numpy pybind11 packaging ]) ++ lib.optionals stdenv.isDarwin [ </ins> Foundation iconv ];

"-DFETCHCONTENT_QUIET=OFF" "-DFETCHCONTENT_SOURCE_DIR_ABSEIL_CPP=${abseil-cpp.src}" "-DFETCHCONTENT_SOURCE_DIR_DATE=${howard-hinnant-date}" <del> "-DFETCHCONTENT_SOURCE_DIR_EIGEN=${eigen}" </del> "-DFETCHCONTENT_SOURCE_DIR_FLATBUFFERS=${flatbuffers}" "-DFETCHCONTENT_SOURCE_DIR_GOOGLE_NSYNC=${nsync.src}" "-DFETCHCONTENT_SOURCE_DIR_MP11=${mp11}" <del> "-DFETCHCONTENT_SOURCE_DIR_ONNX=${python3Packages.onnx.src}" </del> <ins> "-DFETCHCONTENT_SOURCE_DIR_ONNX=${onnx}" </ins> "-DFETCHCONTENT_SOURCE_DIR_PYTORCH_CPUINFO=${pytorch_cpuinfo}" "-DFETCHCONTENT_SOURCE_DIR_RE2=${re2.src}" "-DFETCHCONTENT_SOURCE_DIR_SAFEINT=${safeint}"

postPatch = '' substituteInPlace cmake/libonnxruntime.pc.cmake.in  <del> --replace '$'{prefix}/@CMAKE_INSTALL_ @CMAKE_INSTALL_ </del> <ins> --replace-fail '$'{prefix}/@CMAKE_INSTALL_ @CMAKE_INSTALL_ </ins> '' + lib.optionalString (stdenv.hostPlatform.system == "aarch64-linux") '' # https://github.com/NixOS/nixpkgs/pull/226734#issuecomment-1663028691 rm -v onnxruntime/test/optimizer/nhwc_transformer_test.cc ''; postBuild = lib.optionalString pythonSupport '' <del> python ../setup.py bdist_wheel </del> <ins> ${python3Packages.python.interpreter} ../setup.py bdist_wheel </ins> ''; postInstall = ''