Hide internal C++ symbols exported from libcuopt
@akifcorduk is already working on this.
Since May 14, 2026.
- Dominant language
- Cuda
- Stars
- 1k
- Forks
- 233
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 95
Description
Summary
libcuopt.so currently exports a large internal C++/CUDA symbol surface, including CUB/Thrust/RAFT/RMM symbols and cuOpt detail implementation symbols. This matches the RAPIDS-wide symbol visibility problem tracked in rapidsai/build-infra#53.
Evidence
Local audit of cpp/build/latest/libcuopt.so with readelf --dyn-syms --wide | c++filt found approximately:
- 10,383 defined dynamic symbols
- 2,020
cub::symbols - 2,318
thrust::symbols - 1,028
raft::symbols - 2,691
rmm::symbols - 2,628
cuopt::linear_programming::detailsymbols - 1,574
cuopt::routing::detailsymbols - 376
grpc::symbols - 361
google::protobufsymbols - 579
tbb::symbols
detect-weak-linking (https://github.com/rapidsai/detect-weak-linking) did not report default weak CUDA kernel duplicates for the sampled test executable, but compute-sanitizer reports duplicate CUB kernel registration in test runs and the broad exported-symbol surface increases collision risk.
Desired direction
Follow the treatment used in RAPIDS libraries such as cuML, cuDF, RAFT, and RMM:
- Set hidden-by-default visibility for cuOpt shared library targets.
- Add a
CUOPT_EXPORTmacro for public ABI symbols. - Mark public C API declarations and any public C++ API/types/template instantiations that must remain visible.
- Add a CI/package symbol check similar to cuDF's
ci/check_symbols.sh, with cuOpt-specific forbidden export patterns.
References
- rapidsai/build-infra#53
- rapidsai/cuml#8037
- rapidsai/cudf#15982
- rapidsai/raft#3006
- rapidsai/rmm#1654
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.