Skip to content

[FEA] Static-link gRPC, protobuf, abseil, tbb, libgomp into libcuopt.so #1203

@rgsl888prabhu

Description

@rgsl888prabhu

Is your feature request related to a problem? Please describe.

libcuopt.so currently has dynamic dependencies on several non-CUDA, non-RAPIDS shared libraries — libgrpc++.so, libgrpc.so, libgpr.so, libprotobuf.so, multiple libabsl_*.so, libtbb.so, libgomp.so. These get installed automatically when users use the conda channel, but they create friction for users who don't:

  1. Java distribution (cuopt-java, PR java: cuopt-java initial release — LP/MILP/QP API + classifier JARs #1192): The classifier JAR can safely bundle RAPIDS libs (rmm, rapids_logger, mps_parser), CUDA toolkit is excluded per convention, but bundling gRPC/protobuf/abseil is unsafe due to global state and ABI instability conflicting with user-app native deps. So users have to install these via the system package manager or conda.
  2. Standalone C/C++ users: Same friction — every consumer needs the full transitive dep set, not just libcuopt.
  3. Container images: Each base image variant needs the full lib set installed.

Describe the solution you'd like

Have the C++ build static-link the following into libcuopt.so:

  • libgrpc++, libgrpc, libgpr (gRPC C++)
  • libprotobuf (protocol buffers C++)
  • libabsl_* (Abseil; gRPC dep)
  • libtbb (Intel TBB)
  • libgomp (OpenMP runtime)

What stays dynamic:

  • CUDA toolkit libs (libcublas, libcusparse, libcudss, libcublasLt, libcudart, libnvJitLink) — user-installed for licensing/size reasons
  • RAPIDS libs (librmm, librapids_logger) — bundled in JAR or conda-installed
  • libmps_parser — sibling library in this repo
  • C/C++ runtime (libstdc++, libgcc_s, libc, etc.) — system

Describe alternatives you've considered

  1. Bundle in each downstream artifact (Java JAR, future Rust/Go crates) — risky for gRPC/protobuf/abseil because they have global registries; two copies of libprotobuf in one process can crash or corrupt data. TensorFlow has been bitten by this repeatedly.
  2. Document the transitive deps as system prerequisites — current state. Works but adds friction for non-conda users.

Static linking is the standard fix used by TensorFlow's libtensorflow.so and ONNX Runtime's libonnxruntime.so, both of which static-link their gRPC/protobuf/abseil deps.

Additional context

Confirmed dynamic deps via ldd cpp/build/libcuopt.so:
```
libtbb.so.12, libgrpc++.so.1.78, libgrpc.so.52, libgpr.so.52,
libprotobuf.so.33.5.0, libabsl_*.so.2601.0.0 (many),
libgomp.so.1
```

Related: #1202 (C API stats getters — separate concern), PR #1192 (cuopt-java, which prompted this).

Metadata

Metadata

Assignees

Labels

awaiting responseThis expects a response from maintainer or contributor depending on who requested in last comment.feature requestNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions