onnxruntime: add option to link full protobuf, not protobuf-lite

This can be used to fix the import of tensorflow and onnxruntime in the
same python interpreter.
This commit is contained in:
Martin Weinelt
2025-09-27 18:13:30 +02:00
committed by Pavol Rusnak
parent e7701fc6bd
commit 5f4414443c
+2 -1
View File
@@ -23,6 +23,7 @@
pythonSupport ? true,
cudaSupport ? config.cudaSupport,
ncclSupport ? config.cudaSupport,
withFullProtobuf ? false,
cudaPackages ? { },
}@inputs:
@@ -195,7 +196,7 @@ effectiveStdenv.mkDerivation rec {
(lib.cmakeFeature "ONNX_CUSTOM_PROTOC_EXECUTABLE" (lib.getExe protobuf))
(lib.cmakeBool "onnxruntime_BUILD_SHARED_LIB" true)
(lib.cmakeBool "onnxruntime_BUILD_UNIT_TESTS" doCheck)
(lib.cmakeBool "onnxruntime_USE_FULL_PROTOBUF" false)
(lib.cmakeBool "onnxruntime_USE_FULL_PROTOBUF" withFullProtobuf)
(lib.cmakeBool "onnxruntime_USE_CUDA" cudaSupport)
(lib.cmakeBool "onnxruntime_USE_NCCL" (cudaSupport && ncclSupport))
(lib.cmakeBool "onnxruntime_ENABLE_LTO" (!cudaSupport || cudaPackages.cudaOlder "12.8"))