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
Summary
libcuopt.socurrently exports a large internal C++/CUDA symbol surface, including CUB/Thrust/RAFT/RMM symbols and cuOptdetailimplementation symbols. This matches the RAPIDS-wide symbol visibility problem tracked in rapidsai/build-infra#53.Evidence
Local audit of
cpp/build/latest/libcuopt.sowithreadelf --dyn-syms --wide | c++filtfound approximately:cub::symbolsthrust::symbolsraft::symbolsrmm::symbolscuopt::linear_programming::detailsymbolscuopt::routing::detailsymbolsgrpc::symbolsgoogle::protobufsymbolstbb::symbolsdetect-weak-linking(https://github.com/rapidsai/detect-weak-linking) did not report default weak CUDA kernel duplicates for the sampled test executable, butcompute-sanitizerreports 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:
CUOPT_EXPORTmacro for public ABI symbols.ci/check_symbols.sh, with cuOpt-specific forbidden export patterns.References
RMM_EXPORTrapidsai/rmm#1654