Skip to content

Hide internal C++ symbols exported from libcuopt #1213

Description

@bdice

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::detail symbols
  • 1,574 cuopt::routing::detail symbols
  • 376 grpc:: symbols
  • 361 google::protobuf symbols
  • 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_EXPORT macro 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

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions