Skip to content

Commit

Permalink
python310Modules.onnx: protobuf 3.x -> 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
happysalada committed Sep 15, 2023
1 parent fcbfef1 commit ddee4ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions pkgs/development/python-modules/onnx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
, pythonOlder
, tabulate
, typing-extensions
, abseil-cpp
}:

let
Expand All @@ -36,6 +37,10 @@ in buildPythonPackage rec {
pybind11
];

buildInputs = [
abseil-cpp
];

propagatedBuildInputs = [
protobuf
numpy
Expand All @@ -61,8 +66,14 @@ in buildPythonPackage rec {
--replace 'include(googletest)' ""
substituteInPlace cmake/unittest.cmake \
--replace 'googletest)' ')'
# this should not be needed after version 1.14.1
substituteInPlace CMakeLists.txt \
--replace 'CMAKE_CXX_STANDARD 11' 'CMAKE_CXX_STANDARD 14'
'';

CXXFLAGS = "-std=c++14";

preConfigure = ''
# Set CMAKE_INSTALL_LIBDIR to lib explicitly, because otherwise it gets set
# to lib64 and cmake incorrectly looks for the protobuf library in lib64
Expand Down
4 changes: 3 additions & 1 deletion pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7510,7 +7510,9 @@ self: super: with self; {
onlykey-solo-python = callPackage ../development/python-modules/onlykey-solo-python { };

onnx = callPackage ../development/python-modules/onnx {
protobuf = protobuf3;
abseil-cpp = pkgs.abseil-cpp.override {
cxxStandard = "14";
};
};

onnxconverter-common = callPackage ../development/python-modules/onnxconverter-common {
Expand Down

0 comments on commit ddee4ee

Please sign in to comment.