Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a33c9d1
build(wheel): make libcuopt a thin metapackage
ramakrishnap-nv Sep 29, 2026
4422034
ci: TEMPORARILY disable conda/java PR jobs for faster wheel-only iter…
ramakrishnap-nv Sep 29, 2026
b6a998f
fix(wheel): install the Unspecified CMake component into libcuopt too
ramakrishnap-nv Sep 29, 2026
a378050
fix(wheel): add missing mathopt/routing include dirs for client-only …
ramakrishnap-nv Sep 30, 2026
adaa637
fix(client): move status codes out of mathopt's constants.h
ramakrishnap-nv Sep 30, 2026
7fd4080
fix(wheel): drop libcuopt's dead cuopt_cli entry point
ramakrishnap-nv Sep 30, 2026
bcf829f
ci: retrigger after stuck runner
ramakrishnap-nv Sep 30, 2026
1bdcc38
fix(ci): constrain libcuopt-client/-mathopt/-routing in test scripts
ramakrishnap-nv Sep 30, 2026
c14c318
Revert "ci: TEMPORARILY disable conda/java PR jobs for faster wheel-o…
ramakrishnap-nv Sep 30, 2026
6ff4025
chore: trim redundant comments
ramakrishnap-nv Sep 30, 2026
5f66ed1
fix(release): bump libcuopt-client/-mathopt/-routing pins on release
ramakrishnap-nv Sep 30, 2026
03e1774
fix(ci): protect the 'cuda' dnf repo against transient CDN 404s
ramakrishnap-nv Sep 30, 2026
68e363d
Revert "fix(ci): protect the 'cuda' dnf repo against transient CDN 404s"
ramakrishnap-nv Sep 30, 2026
75e0957
fix(java): generate CuOptConstants from status_codes.h too
ramakrishnap-nv Sep 30, 2026
bb10b1c
fix(ci): match per-component libcuopt* wheel paths in C example heade…
ramakrishnap-nv Oct 1, 2026
4f36573
build(wheel): build libcuopt-client/-mathopt/-routing/-libcuopt in de…
ramakrishnap-nv Oct 1, 2026
01bdee6
fix(wheel): stop the per-package CMakeLists.txt short-circuit from fa…
ramakrishnap-nv Oct 1, 2026
6e28657
fix(wheel): ship Unspecified in libcuopt-client too, for the same rea…
ramakrishnap-nv Oct 1, 2026
a147831
fix(wheel): generate the gRPC proto headers even when cuopt_client is…
ramakrishnap-nv Oct 1, 2026
eea1c18
fix(docs): add status_codes.h to the Doxygen INPUT list
ramakrishnap-nv Oct 1, 2026
1b0f97b
perf(wheel): skip compiling the routing engine in libcuopt-mathopt's …
ramakrishnap-nv Oct 1, 2026
dac4627
perf(wheel): skip compiling the mathopt engine in libcuopt-routing's …
ramakrishnap-nv Oct 1, 2026
5fbe276
fix(wheel): guard cuopt_wheel_build.cmake's cuopt_cli link for SKIP_M…
ramakrishnap-nv Oct 1, 2026
49c18bb
fix(wheel): revert SKIP_GRPC_BUILD for libcuopt-mathopt, it breaks re…
ramakrishnap-nv Oct 1, 2026
b77b7c2
perf(wheel): cache the gRPC/Abseil/Protobuf source build with sccache
ramakrishnap-nv Oct 1, 2026
45562d0
style: drop comment on rapids-configure-sccache lines
ramakrishnap-nv Oct 1, 2026
2031cd2
fix(ci): find status_codes.h from its own wheel for the C examples build
ramakrishnap-nv Oct 1, 2026
1b8ec6f
fix(ci): link C examples against libcuopt_client too
ramakrishnap-nv Oct 2, 2026
798463f
fix(docs): make CLIENT_INCLUDE_PATH/CLIENT_LIBRARY_PATH explicit, doc…
ramakrishnap-nv Oct 2, 2026
c923d07
style: drop unnecessary comments from CLIENT_*_PATH changes
ramakrishnap-nv Oct 2, 2026
6f6307a
fix(docs): keep libcuopt_client.so as a direct NEEDED entry in C exam…
ramakrishnap-nv Oct 2, 2026
9777972
fix(wheel): give cuopt_mathopt/cuopt_routing their own rpath to libcu…
ramakrishnap-nv Oct 2, 2026
5538395
Merge branch 'main' into thin-libcuopt-metapackage
ramakrishnap-nv Oct 2, 2026
0ee4e1c
fix(ci): require client paths in find_cuopt_libraries' final success …
ramakrishnap-nv Oct 2, 2026
865b313
merge: pull in latest main + client-paths discovery fix
ramakrishnap-nv Oct 2, 2026
1c64d99
fix(cmake): fail loudly on unresolvable external components, scope gr…
ramakrishnap-nv Oct 2, 2026
4e64e77
fix(cmake): retry find_package(cuopt) per-component, not only when no…
ramakrishnap-nv Oct 2, 2026
8b28050
style: drop comment from find_package(cuopt) retry fix
ramakrishnap-nv Oct 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ jobs:
id-token: write
packages: read
pull-requests: read
needs: [build-details]
# Links against the client/mathopt/routing wheels' installed .so's instead of recompiling them.
needs: [build-details, wheel-build-libcuopt-client, wheel-build-libcuopt-mathopt, wheel-build-libcuopt-routing]
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@release/26.10
with:
Expand Down Expand Up @@ -291,7 +292,8 @@ jobs:
id-token: write
packages: read
pull-requests: read
needs: [build-details]
# Links against the client wheel's installed libcuopt_client.so instead of recompiling it.
needs: [build-details, wheel-build-libcuopt-client]
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@release/26.10
with:
Expand Down Expand Up @@ -334,7 +336,8 @@ jobs:
id-token: write
packages: read
pull-requests: read
needs: [build-details]
# Links against the client wheel's installed libcuopt_client.so instead of recompiling it.
needs: [build-details, wheel-build-libcuopt-client]
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@release/26.10
with:
Expand Down Expand Up @@ -371,7 +374,12 @@ jobs:
package-type: cpp
publish-wheel-search-key: cuopt_wheel_cpp_libcuopt_routing
wheel-build-cuopt:
needs: [build-details, wheel-build-libcuopt]
needs:
- build-details
- wheel-build-libcuopt
- wheel-build-libcuopt-client
- wheel-build-libcuopt-mathopt
- wheel-build-libcuopt-routing
permissions:
actions: read
contents: read
Expand Down
57 changes: 35 additions & 22 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -595,25 +595,6 @@ jobs:
script: "ci/test_java.sh"
artifact-name: "cuopt-java"
file_to_upload: "java/cuopt/target/"
wheel-build-libcuopt:
needs: [build-details, compute-matrix-filters, changed-files]
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_wheels
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@release/26.10
with:
# build for every combination of arch and CUDA version, but only for the latest Python
matrix_filter: ${{ needs.compute-matrix-filters.outputs.libcuopt_filter }}
package-type: cpp
package-name: libcuopt
build_type: pull-request
build-datetime: ${{ needs.build-details.outputs.build-datetime }}
script: ci/build_wheel_libcuopt.sh
wheel-build-libcuopt-client:
needs: [build-details, compute-matrix-filters, changed-files]
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_wheels
Expand All @@ -635,7 +616,7 @@ jobs:
build-datetime: ${{ needs.build-details.outputs.build-datetime }}
script: ci/build_wheel_libcuopt_client.sh
wheel-build-libcuopt-mathopt:
needs: [build-details, compute-matrix-filters, changed-files]
needs: [build-details, compute-matrix-filters, changed-files, wheel-build-libcuopt-client]
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_wheels
permissions:
actions: read
Expand All @@ -654,7 +635,7 @@ jobs:
build-datetime: ${{ needs.build-details.outputs.build-datetime }}
script: ci/build_wheel_libcuopt_mathopt.sh
wheel-build-libcuopt-routing:
needs: [build-details, compute-matrix-filters, changed-files]
needs: [build-details, compute-matrix-filters, changed-files, wheel-build-libcuopt-client]
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_wheels
permissions:
actions: read
Expand All @@ -672,8 +653,40 @@ jobs:
build_type: pull-request
build-datetime: ${{ needs.build-details.outputs.build-datetime }}
script: ci/build_wheel_libcuopt_routing.sh
wheel-build-libcuopt:
needs:
- build-details
- compute-matrix-filters
- changed-files
- wheel-build-libcuopt-client
- wheel-build-libcuopt-mathopt
- wheel-build-libcuopt-routing
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_wheels
permissions:
actions: read
contents: read
id-token: write
packages: read
pull-requests: read
secrets: inherit # zizmor: ignore[secrets-inherit]
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@release/26.10
with:
# build for every combination of arch and CUDA version, but only for the latest Python
matrix_filter: ${{ needs.compute-matrix-filters.outputs.libcuopt_filter }}
package-type: cpp
package-name: libcuopt
build_type: pull-request
build-datetime: ${{ needs.build-details.outputs.build-datetime }}
script: ci/build_wheel_libcuopt.sh
wheel-build-cuopt:
needs: [build-details, wheel-build-libcuopt, compute-matrix-filters, changed-files]
needs:
- build-details
- wheel-build-libcuopt
- wheel-build-libcuopt-client
- wheel-build-libcuopt-mathopt
- wheel-build-libcuopt-routing
- compute-matrix-filters
- changed-files
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python_wheels
permissions:
actions: read
Expand Down
9 changes: 9 additions & 0 deletions ci/build_wheel_cuopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ LIBCUOPT_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_

echo "libcuopt-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${LIBCUOPT_WHEELHOUSE}/libcuopt_*.whl)" >> "${PIP_CONSTRAINT}"

LIBCUOPT_CLIENT_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcuopt_client cuopt)")
echo "libcuopt-client @ file://$(echo ${LIBCUOPT_CLIENT_WHEELHOUSE}/libcuopt_client-*.whl)" >> "${PIP_CONSTRAINT}"

LIBCUOPT_MATHOPT_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcuopt_mathopt cuopt --cuda "$RAPIDS_CUDA_VERSION")")
echo "libcuopt-mathopt-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${LIBCUOPT_MATHOPT_WHEELHOUSE}/libcuopt_mathopt_*.whl)" >> "${PIP_CONSTRAINT}"

LIBCUOPT_ROUTING_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcuopt_routing cuopt --cuda "$RAPIDS_CUDA_VERSION")")
echo "libcuopt-routing-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${LIBCUOPT_ROUTING_WHEELHOUSE}/libcuopt_routing_*.whl)" >> "${PIP_CONSTRAINT}"

EXCLUDE_ARGS=(
--exclude "libraft.so"
--exclude "libcublas.so.*"
Expand Down
18 changes: 17 additions & 1 deletion ci/build_wheel_libcuopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ source rapids-init-pip
package_name="libcuopt"
package_dir="python/libcuopt"

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen "${RAPIDS_CUDA_VERSION}")"

LIBCUOPT_CLIENT_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcuopt_client cuopt)")
echo "libcuopt-client @ file://$(echo ${LIBCUOPT_CLIENT_WHEELHOUSE}/libcuopt_client-*.whl)" >> "${PIP_CONSTRAINT}"

LIBCUOPT_MATHOPT_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcuopt_mathopt cuopt --cuda "$RAPIDS_CUDA_VERSION")")
echo "libcuopt-mathopt-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${LIBCUOPT_MATHOPT_WHEELHOUSE}/libcuopt_mathopt_*.whl)" >> "${PIP_CONSTRAINT}"

LIBCUOPT_ROUTING_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcuopt_routing cuopt --cuda "$RAPIDS_CUDA_VERSION")")
echo "libcuopt-routing-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${LIBCUOPT_ROUTING_WHEELHOUSE}/libcuopt_routing_*.whl)" >> "${PIP_CONSTRAINT}"

# Install rockylinux repo
if command -v dnf &> /dev/null; then
bash ci/utils/update_rockylinux_repo.sh
Expand All @@ -25,6 +36,8 @@ elif command -v apt-get &> /dev/null; then
apt-get install -y uuid-dev
fi

source rapids-configure-sccache

# Install Protobuf + gRPC (protoc + grpc_cpp_plugin)
bash ci/utils/install_protobuf_grpc.sh

Expand All @@ -37,7 +50,7 @@ python ci/utils/install_modern_libgomp.py "${MODERN_LIBGOMP_DIR}"
# Also build our own cuDSS threading layer against this same libgomp (see cpp/CMakeLists.txt,
# cpp/src/barrier/cudss_mtlayer_cuopt.cpp), instead of cuDSS's prebuilt one, so both actually
# share one instance, not just the same flavor. Conda keeps cuDSS's default (#1219 discussion).
export SKBUILD_CMAKE_ARGS="-DOpenMP_gomp_LIBRARY:FILEPATH=${MODERN_LIBGOMP_DIR}/libgomp.so.1.0.0;-DCUOPT_BUILD_CUSTOM_CUDSS_MTLAYER=ON"
export SKBUILD_CMAKE_ARGS="-DOpenMP_gomp_LIBRARY:FILEPATH=${MODERN_LIBGOMP_DIR}/libgomp.so.1.0.0;-DCUOPT_BUILD_CUSTOM_CUDSS_MTLAYER=ON;-DCUOPT_FIND_CLIENT_EXTERNALLY=ON;-DCUOPT_FIND_MATHOPT_EXTERNALLY=ON;-DCUOPT_FIND_ROUTING_EXTERNALLY=ON"

# auditwheel repair does its own dependency resolution separately from the compiler; without
# this it can't see our fetched copy and silently vendors the old Rocky 8 system one instead.
Expand Down Expand Up @@ -99,6 +112,9 @@ EXCLUDE_ARGS=(
--exclude "libcurand.so.*"
--exclude "libcusolver.so.*"
--exclude "libcusparse.so.*"
--exclude "libcuopt_client.so"
--exclude "libcuopt_mathopt.so"
--exclude "libcuopt_routing.so"
--exclude "libnccl.so.*"
--exclude "libnvJitLink.so*"
--exclude "librapids_logger.so"
Expand Down
2 changes: 2 additions & 0 deletions ci/build_wheel_libcuopt_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ elif command -v apt-get &> /dev/null; then
apt-get install -y uuid-dev
fi

source rapids-configure-sccache

# Install Protobuf + gRPC (protoc + grpc_cpp_plugin)
bash ci/utils/install_protobuf_grpc.sh

Expand Down
7 changes: 6 additions & 1 deletion ci/build_wheel_libcuopt_mathopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ source rapids-init-pip
package_name="libcuopt_mathopt"
package_dir="python/libcuopt_mathopt"

LIBCUOPT_CLIENT_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcuopt_client cuopt)")
echo "libcuopt-client @ file://$(echo ${LIBCUOPT_CLIENT_WHEELHOUSE}/libcuopt_client-*.whl)" >> "${PIP_CONSTRAINT}"

# Install rockylinux repo
if command -v dnf &> /dev/null; then
bash ci/utils/update_rockylinux_repo.sh
Expand All @@ -29,6 +32,8 @@ elif command -v apt-get &> /dev/null; then
apt-get install -y uuid-dev
fi

source rapids-configure-sccache

# Install Protobuf + gRPC (protoc + grpc_cpp_plugin)
bash ci/utils/install_protobuf_grpc.sh

Expand All @@ -41,7 +46,7 @@ python ci/utils/install_modern_libgomp.py "${MODERN_LIBGOMP_DIR}"
# Also build our own cuDSS threading layer against this same libgomp (see cpp/CMakeLists.txt,
# cpp/src/barrier/cudss_mtlayer_cuopt.cpp), instead of cuDSS's prebuilt one, so both actually
# share one instance, not just the same flavor. Conda keeps cuDSS's default (#1219 discussion).
export SKBUILD_CMAKE_ARGS="-DOpenMP_gomp_LIBRARY:FILEPATH=${MODERN_LIBGOMP_DIR}/libgomp.so.1.0.0;-DCUOPT_BUILD_CUSTOM_CUDSS_MTLAYER=ON"
export SKBUILD_CMAKE_ARGS="-DOpenMP_gomp_LIBRARY:FILEPATH=${MODERN_LIBGOMP_DIR}/libgomp.so.1.0.0;-DCUOPT_BUILD_CUSTOM_CUDSS_MTLAYER=ON;-DCUOPT_FIND_CLIENT_EXTERNALLY=ON;-DSKIP_ROUTING_BUILD=ON"

# auditwheel repair does its own dependency resolution separately from the compiler; without
# this it can't see our fetched copy and silently vendors the old Rocky 8 system one instead.
Expand Down
7 changes: 6 additions & 1 deletion ci/build_wheel_libcuopt_routing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ source rapids-init-pip
package_name="libcuopt_routing"
package_dir="python/libcuopt_routing"

LIBCUOPT_CLIENT_WHEELHOUSE=$(rapids-download-from-github "$(rapids-artifact-name wheel_cpp libcuopt_client cuopt)")
echo "libcuopt-client @ file://$(echo ${LIBCUOPT_CLIENT_WHEELHOUSE}/libcuopt_client-*.whl)" >> "${PIP_CONSTRAINT}"

# Install rockylinux repo
if command -v dnf &> /dev/null; then
bash ci/utils/update_rockylinux_repo.sh
Expand All @@ -29,6 +32,8 @@ elif command -v apt-get &> /dev/null; then
apt-get install -y uuid-dev
fi

source rapids-configure-sccache

# Install Protobuf + gRPC (protoc + grpc_cpp_plugin)
bash ci/utils/install_protobuf_grpc.sh

Expand All @@ -41,7 +46,7 @@ python ci/utils/install_modern_libgomp.py "${MODERN_LIBGOMP_DIR}"
# Also build our own cuDSS threading layer against this same libgomp (see cpp/CMakeLists.txt,
# cpp/src/barrier/cudss_mtlayer_cuopt.cpp), instead of cuDSS's prebuilt one, so both actually
# share one instance, not just the same flavor. Conda keeps cuDSS's default (#1219 discussion).
export SKBUILD_CMAKE_ARGS="-DOpenMP_gomp_LIBRARY:FILEPATH=${MODERN_LIBGOMP_DIR}/libgomp.so.1.0.0;-DCUOPT_BUILD_CUSTOM_CUDSS_MTLAYER=ON"
export SKBUILD_CMAKE_ARGS="-DOpenMP_gomp_LIBRARY:FILEPATH=${MODERN_LIBGOMP_DIR}/libgomp.so.1.0.0;-DCUOPT_BUILD_CUSTOM_CUDSS_MTLAYER=ON;-DCUOPT_FIND_CLIENT_EXTERNALLY=ON;-DSKIP_MATHOPT_BUILD=ON;-DSKIP_GRPC_BUILD=ON"

# auditwheel repair does its own dependency resolution separately from the compiler; without
# this it can't see our fetched copy and silently vendors the old Rocky 8 system one instead.
Expand Down
3 changes: 3 additions & 0 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ DEPENDENCIES=(
cuopt-server
cuopt-sh-client
libcuopt
libcuopt-client
libcuopt-mathopt
libcuopt-routing
libcuopt-tests
libraft-headers
librmm
Expand Down
72 changes: 59 additions & 13 deletions ci/test_doc_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ GRPC_PID=""
# C library paths (set by find_cuopt_libraries)
include_path=""
lib_path=""
client_include_path=""
client_lib_path=""

# Create results directory
mkdir -p "${RESULTS_DIR}"
Expand Down Expand Up @@ -361,12 +363,14 @@ test_c_examples() {
# Clean and build
if [ -f "Makefile" ]; then
log_info " Building C examples..."
local make_vars=""
[ -n "${include_path}" ] && make_vars="${make_vars} INCLUDE_PATH=${include_path}"
[ -n "${lib_path}" ] && make_vars="${make_vars} LIBCUOPT_LIBRARY_PATH=${lib_path}"
local make_vars=()
[ -n "${include_path}" ] && make_vars+=("INCLUDE_PATH=${include_path}")
[ -n "${lib_path}" ] && make_vars+=("LIBCUOPT_LIBRARY_PATH=${lib_path}")
make_vars+=("CLIENT_INCLUDE_PATH=${client_include_path:-${include_path}}")
make_vars+=("CLIENT_LIBRARY_PATH=${client_lib_path:-${lib_path}}")

if make clean > "${RESULTS_DIR}/c-clean-${relative_path//\//_}.log" 2>&1 && \
make ${make_vars} all > "${RESULTS_DIR}/c-build-${relative_path//\//_}.log" 2>&1; then
make "${make_vars[@]}" all > "${RESULTS_DIR}/c-build-${relative_path//\//_}.log" 2>&1; then
log_success " C examples built successfully"
else
log_failure " Failed to build C examples"
Expand Down Expand Up @@ -461,6 +465,8 @@ find_cuopt_libraries() {
# Reset global variables
include_path=""
lib_path=""
client_include_path=""
client_lib_path=""

# Get Python site-packages directory
local site_packages=""
Expand All @@ -485,9 +491,10 @@ find_cuopt_libraries() {
found_header=$(find "${search_dir}" -name "cuopt_c.h" -path "*/mathematical_optimization/*" 2>/dev/null | head -1)

if [ -n "${found_header}" ]; then
# Check if this is a Python package installation (contains libcuopt/include)
if echo "${found_header}" | grep -q "/libcuopt/include/"; then
# Python package structure: /path/to/libcuopt/include/cuopt/mathematical_optimization/cuopt_c.h
# Check if this is a Python package installation (contains libcuopt*/include, e.g.
# libcuopt/ or the per-component libcuopt_client/, libcuopt_mathopt/, libcuopt_routing/)
if echo "${found_header}" | grep -qE "/libcuopt[a-z_]*/include/"; then
# Python package structure: /path/to/libcuopt*/include/cuopt/mathematical_optimization/cuopt_c.h
# Extract the include directory by going up 3 directories from the header file
include_path=$(dirname "$(dirname "$(dirname "${found_header}")")")
else
Expand All @@ -499,32 +506,71 @@ find_cuopt_libraries() {
fi

if [ -z "${lib_path}" ]; then
# Search for libcuopt.so in both lib and lib64 directories
# The C examples link -lcuopt_mathopt directly, not the libcuopt umbrella (which
# no longer bundles it -- it's in libcuopt-mathopt's own wheel since the split).
local found_lib
found_lib=$(find "${search_dir}" -name "libcuopt.so" \( -path "*/lib/*" -o -path "*/lib64/*" \) 2>/dev/null | head -1)
found_lib=$(find "${search_dir}" -name "libcuopt_mathopt.so" \( -path "*/lib/*" -o -path "*/lib64/*" \) 2>/dev/null | head -1)
if [ -n "${found_lib}" ]; then
lib_path=$(dirname "${found_lib}")
fi
fi

# Break early if both found
if [ -n "${include_path}" ] && [ -n "${lib_path}" ]; then
if [ -z "${client_include_path}" ] && [ -n "${include_path}" ] && \
[ ! -f "${include_path}/cuopt/status_codes.h" ]; then
local found_status_codes
found_status_codes=$(find "${search_dir}" -path "*/cuopt/status_codes.h" 2>/dev/null | head -1)
if [ -n "${found_status_codes}" ]; then
client_include_path=$(dirname "$(dirname "${found_status_codes}")")
fi
fi

if [ -z "${client_lib_path}" ] && [ -n "${lib_path}" ] && \
[ ! -f "${lib_path}/libcuopt_client.so" ]; then
local found_client_lib
found_client_lib=$(find "${search_dir}" -name "libcuopt_client.so" \( -path "*/lib/*" -o -path "*/lib64/*" \) 2>/dev/null | head -1)
if [ -n "${found_client_lib}" ]; then
client_lib_path=$(dirname "${found_client_lib}")
fi
fi

# Break early if everything needed is found
if [ -n "${include_path}" ] && [ -n "${lib_path}" ] && \
{ [ -n "${client_include_path}" ] || [ -f "${include_path}/cuopt/status_codes.h" ]; } && \
{ [ -n "${client_lib_path}" ] || [ -f "${lib_path}/libcuopt_client.so" ]; }; then
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
break
fi
done

if [ -z "${include_path}" ] || [ -z "${lib_path}" ]; then
local client_include_found=false
if [ -n "${client_include_path}" ] || [ -f "${include_path}/cuopt/status_codes.h" ]; then
client_include_found=true
fi
local client_lib_found=false
if [ -n "${client_lib_path}" ] || [ -f "${lib_path}/libcuopt_client.so" ]; then
client_lib_found=true
fi

if [ -z "${include_path}" ] || [ -z "${lib_path}" ] || \
[ "${client_include_found}" = false ] || [ "${client_lib_found}" = false ]; then
log_failure "Could not find cuOpt headers or libraries"
if [ -z "${include_path}" ]; then
log_failure " Missing: INCLUDE_PATH (searched for cuopt_c.h)"
fi
if [ -z "${lib_path}" ]; then
log_failure " Missing: LIBCUOPT_LIBRARY_PATH (searched for libcuopt.so)"
log_failure " Missing: LIBCUOPT_LIBRARY_PATH (searched for libcuopt_mathopt.so)"
fi
if [ "${client_include_found}" = false ]; then
log_failure " Missing: client include path (searched for status_codes.h)"
fi
if [ "${client_lib_found}" = false ]; then
log_failure " Missing: client library path (searched for libcuopt_client.so)"
fi
return 1
else
log_info "Found: INCLUDE_PATH=${include_path}"
log_info "Found: LIBCUOPT_LIBRARY_PATH=${lib_path}"
[ -n "${client_include_path}" ] && log_info "Found: client_include_path=${client_include_path}"
[ -n "${client_lib_path}" ] && log_info "Found: client_lib_path=${client_lib_path}"
return 0
fi
}
Expand Down
Loading
Loading