mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01:00
cntk: fix build with protobuf 3.18+
This commit is contained in:
parent
0c35094470
commit
813c400edc
1 changed files with 21 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
{ lib, stdenv, fetchgit, fetchFromGitHub, cmake
|
||||
, fetchpatch
|
||||
, openblas, blas, lapack, opencv3, libzip, boost, protobuf, mpi
|
||||
, onebitSGDSupport ? false
|
||||
, cudaSupport ? false, addOpenGLRunpath, cudatoolkit, nvidia_x11
|
||||
|
@ -28,6 +29,26 @@ in stdenv.mkDerivation rec {
|
|||
sha256 = "18l9k7s966a26ywcf7flqyhm61788pcb9fj3wk61jrmgkhy2pcns";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix build with protobuf 3.18+
|
||||
# Remove with onnx submodule bump to 1.9+
|
||||
(fetchpatch {
|
||||
url = "https://github.com/onnx/onnx/commit/d3bc82770474761571f950347560d62a35d519d7.patch";
|
||||
extraPrefix = "Source/CNTKv2LibraryDll/proto/onnx/onnx_repo/";
|
||||
stripLen = 1;
|
||||
sha256 = "00raqj8wx30b06ky6cdp5vvc1mrzs7hglyi6h58hchw5lhrwkzxp";
|
||||
})
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# Fix build with protobuf 3.18+
|
||||
substituteInPlace Source/CNTKv2LibraryDll/Serialization.cpp \
|
||||
--replace 'SetTotalBytesLimit(INT_MAX, INT_MAX)' \
|
||||
'SetTotalBytesLimit(INT_MAX)' \
|
||||
--replace 'SetTotalBytesLimit(limit, limit)' \
|
||||
'SetTotalBytesLimit(limit)'
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ cmake ] ++ lib.optional cudaSupport addOpenGLRunpath;
|
||||
|
||||
# Force OpenMPI to use g++ in PATH.
|
||||
|
|
Loading…
Reference in a new issue