From d56c63c3263ccebe43504e8c53d420cde840224f Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Thu, 8 Feb 2024 14:16:51 +0000 Subject: [PATCH] onnxruntime: fix aarch64-darwin ...following cbourjau s idea --- pkgs/development/libraries/eigen/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/development/libraries/eigen/default.nix b/pkgs/development/libraries/eigen/default.nix index 18fe7450d508..4befab1e7b7f 100644 --- a/pkgs/development/libraries/eigen/default.nix +++ b/pkgs/development/libraries/eigen/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitLab +, fetchpatch , cmake }: @@ -17,6 +18,20 @@ stdenv.mkDerivation rec { patches = [ ./include-dir.patch + + # Fixes e.g. onnxruntime on aarch64-darwin: + # https://hydra.nixos.org/build/248915128/nixlog/1, + # originally suggested in https://github.com/NixOS/nixpkgs/pull/258392. + # + # The patch is from + # ["Fix vectorized reductions for Eigen::half"](https://gitlab.com/libeigen/eigen/-/merge_requests/699) + # which is two years old, + # but Eigen hasn't had a release in two years either: + # https://gitlab.com/libeigen/eigen/-/issues/2699. + (fetchpatch { + url = "https://gitlab.com/libeigen/eigen/-/commit/d0e3791b1a0e2db9edd5f1d1befdb2ac5a40efe0.patch"; + hash = "sha256-8qiNpuYehnoiGiqy0c3Mcb45pwrmc6W4rzCxoLDSvj0="; + }) ]; nativeBuildInputs = [ cmake ];