Skip to content

build(cmake): split libcuopt into cuopt_base / cuopt_routing / cuopt_lp component libs#1622

Draft
ramakrishnap-nv wants to merge 3 commits into
mainfrom
feat/split-routing-lp-libs
Draft

build(cmake): split libcuopt into cuopt_base / cuopt_routing / cuopt_lp component libs#1622
ramakrishnap-nv wants to merge 3 commits into
mainfrom
feat/split-routing-lp-libs

Conversation

@ramakrishnap-nv

Copy link
Copy Markdown
Collaborator

Summary

  • Introduces three STATIC component libraries (cuopt_base, cuopt_routing, cuopt_lp) compiled with PIC, letting downstream consumers link only what they need
  • Umbrella libcuopt.so is unchanged from a consumer perspective — it whole-archives all three statics so existing -lcuopt links keep working (required for GamsPy/GAMS integration)
  • Re-exposes component statics' transitive PUBLIC deps (rmm, raft, CCCL, CUDA libs) on the umbrella so test binaries and cmake consumers get the correct source-fetched include paths
  • Adds libcuopt_base.a, libcuopt_routing.a, libcuopt_lp.a to conda package_contents check so CI fails fast if any component library is missing

Test plan

  • Local C++ build passes (98% tests pass; 3 pre-existing failures: WAYPOINT_MATRIXTEST identical on main, DOC_EXAMPLE_TEST temp-file isolation bug, CLI_TEST PATH shadowing by Python client)
  • CI conda cpp build + test

🤖 Generated with Claude Code

ramakrishnap-nv and others added 3 commits July 24, 2026 13:48
…lp + umbrella

Introduce three STATIC component libraries that logically partition the
cuOpt sources by domain, then fold them into the existing libcuopt.so
umbrella via --whole-archive (LINK_LIBRARY:WHOLE_ARCHIVE).

Component libraries:
- cuopt_base   — utilities + linear algebra (logger, work scheduler)
- cuopt_routing — VRP / routing engine; links cuopt_base
- cuopt_lp      — LP / MIP / numerical optimization; links cuopt_base

Umbrella:
- cuopt SHARED  — re-exports all symbols from the three statics via
  --whole-archive; backward-compatible for GAMS (-lcuopt / libcuopt.so)

CMake aliases exposed: cuopt::base, cuopt::routing, cuopt::lp, cuopt::cuopt

No source files moved. External build output (libcuopt.so, headers,
install layout) is unchanged. SKIP_ROUTING_BUILD=ON continues to work
by omitting cuopt_routing from the build and umbrella link.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
Four issues found while validating the library split locally:

- cuopt_routing was missing OpenMP::OpenMP_CUDA, causing routing CUDA
  files to reject #pragma omp directives as unknown in CUDA compiler mode
- cuopt_lp was missing simde::simde, required by the fast MPS parser
  (io/experimental_mps_fast/) which uses SIMD intrinsics via simde headers
- The umbrella cuopt target was missing src/io in its private include
  dirs, causing gRPC mapper files (grpc_problem_mapper.cpp) that include
  mps_parser_internal.hpp to fail to compile
- WHOLE_ARCHIVE linkage on the umbrella was PUBLIC, propagating the static
  sub-libs as link dependencies to all consumers (test binaries). This
  caused double-definition errors when tests linked both libcuopt.so and
  the statics. Changed to PRIVATE and re-exposed the statics' transitive
  PUBLIC deps (rmm, raft, CCCL, CUDA libs) directly on the umbrella so
  that consumers receive the correct source-fetched include dirs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
Add libcuopt_base.a, libcuopt_routing.a, and libcuopt_lp.a to the
package_contents file check so CI fails fast if any of the three
component static libraries are missing from the installed package.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 24, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant