Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
20ad11d
refactor(tests): link internal tests against cuopt_static
ramakrishnap-nv Jul 16, 2026
de93a4d
refactor(tests): consolidate internal numopt tests into single binary
ramakrishnap-nv Jul 16, 2026
e6589c1
fix(tests): make combined internal test binaries link and run
ramakrishnap-nv Jul 16, 2026
a59bd8c
style(tests): remove stale comments from empty CMakeLists stubs
ramakrishnap-nv Jul 16, 2026
bd27745
refactor(tests): remove empty dual_simplex and socp CMakeLists stubs
ramakrishnap-nv Jul 16, 2026
0e5689a
fix(build): link PSLP directly on cuopt shared target
ramakrishnap-nv Jul 16, 2026
90e5d79
refactor(tests): delete CUOPT_TEST_PROGRAM_MAIN from combined-binary …
ramakrishnap-nv Jul 16, 2026
3e58684
refactor(tests): replace runtime cuSPARSE check with compile-time macro
ramakrishnap-nv Jul 17, 2026
c9476b2
fix(tests): require error when mixed precision is unsupported
ramakrishnap-nv Jul 17, 2026
1f52c5e
fix(tests): fix invalid CSR in problem_test create_problem helper
ramakrishnap-nv Jul 17, 2026
545ce45
fix(test): check runtime cuSPARSE version in pdlp_precision_mixed test
ramakrishnap-nv Jul 17, 2026
0effbce
fix(tests): restore RMM setup in ROUTING_UNIT_TEST
ramakrishnap-nv Jul 20, 2026
755ec5d
fix(tests): fix malformed SPDX block comment in internal/main.cu
ramakrishnap-nv Jul 20, 2026
8f23153
fix(build): add OpenMP::OpenMP_CUDA to cuopt_objs PRIVATE deps
ramakrishnap-nv Jul 20, 2026
c159896
fix(build): add simde::simde to cuopt_objs PRIVATE deps
ramakrishnap-nv Jul 21, 2026
3a55206
fix(tests): add missing symmetric QCMATRIX entry in fast parser edge …
ramakrishnap-nv Jul 21, 2026
5ec9425
Merge branch 'main' into refactor/test-static-link-for-internal-tests
ramakrishnap-nv Jul 22, 2026
6610d44
check symbols script
arhag23 Jul 23, 2026
2ca4e80
Symbol visibility controls and exports
arhag23 Jul 23, 2026
b1644c1
Merge remote-tracking branch 'upstream/main' into fix-symbol-visibili…
ramakrishnap-nv Jul 24, 2026
6f3f476
fix(tests): link internal-symbol tests against cuopt_static
ramakrishnap-nv Jul 27, 2026
63402ae
Merge remote-tracking branch 'upstream/main' into fix-symbol-visibili…
ramakrishnap-nv Jul 27, 2026
0db00c3
Merge branch 'main' into fix-symbol-visibility-remove-internal
ramakrishnap-nv Jul 27, 2026
969511b
style(tests): drop stray blank comment line in base_fixture.hpp
ramakrishnap-nv Jul 27, 2026
b0ce83e
fix(ci): make check_symbols.sh executable
ramakrishnap-nv Jul 27, 2026
d51eaed
Merge branch 'main' into fix-symbol-visibility-remove-internal
ramakrishnap-nv Jul 27, 2026
2980061
refactor(tests): consolidate L0 routing tests into ROUTING_INTERNAL_TEST
ramakrishnap-nv Jul 27, 2026
e9d92d7
refactor(tests): combine disabled L1 routing tests into one binary
ramakrishnap-nv Jul 28, 2026
eed31e1
style(tests): bump copyright year to 2026 on L1 routing test files
ramakrishnap-nv Jul 28, 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
84 changes: 84 additions & 0 deletions ci/check_symbols.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

set -eEuo pipefail

echo "checking for symbol visibility issues"

LIBRARY="${1}"

echo ""
echo "Checking exported symbols in '${LIBRARY}'"
symbol_file="$(mktemp)"
match_file="$(mktemp)"
trap 'rm -f "${symbol_file}" "${match_file}"' EXIT

# Ignore WEAK and UNIQUE symbols since UNIQUE symbols should be exported and
# WEAK symbols may come from template instantiations.
# Ignore symbols containing "_error" since these are likely exception types
# and should be exported.

readelf --dyn-syms --wide "${LIBRARY}" \
| awk '$7 != "UND" && $5 != "WEAK" && $5 != "UNIQUE"' \
| c++filt --no-params \
| awk '$0 !~ /_error/' \
> "${symbol_file}"

patterns=(
'cub::'
'thrust::'
'raft::'
'rmm::'
'cuopt::mathematical_optimization::detail'
'cuopt::routing::detail'
'cuopt::detail'
'grpc::'
'google::protobuf'
'tbb::'
'absl::'
'dejavu::'
'papilo::'
'boost::'
)

failed=0

for pattern in "${patterns[@]}"; do
echo "Checking for '${pattern}' symbols..."

awk -v pattern="${pattern}" '
BEGIN { has_trailing_scope = (substr(pattern, length(pattern) - 1) == "::") }
$1 ~ /^[0-9]+:/ {
symbol = ""
for (i = 8; i <= NF; ++i) {
symbol = symbol (i == 8 ? "" : " ") $i
}

sub(/<.*/, "", symbol)
sub(/^.*[[:space:]](for|to)[[:space:]]+/, "", symbol)

if (has_trailing_scope) {
matched = (index(symbol, pattern) == 1)
} else {
matched = (symbol == pattern || index(symbol, pattern "::") == 1)
}

if (matched) { print }
}
' "${symbol_file}" > "${match_file}"

matches=$(awk 'END { print NR }' "${match_file}")
if [[ "${matches}" -ne 0 ]]; then
sed -n '1,20p' "${match_file}"
echo "ERROR: Found exported symbols in ${LIBRARY} matching the pattern ${pattern}."
echo "ERROR: Total matching symbols: ${matches}"
failed=1
fi
done

if [[ "${failed}" -ne 0 ]]; then
exit 1
fi

echo "No symbol visibility issues found in ${LIBRARY}"
2 changes: 2 additions & 0 deletions conda/recipes/libcuopt/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ outputs:
script:
content: |
cmake --install cpp/build
./ci/check_symbols.sh cpp/build/libcuopt.so
dynamic_linking:
overlinking_behavior: "error"
prefix_detection:
Expand All @@ -118,6 +119,7 @@ outputs:
build:
- cmake ${{ cmake_version }}
- ${{ stdlib("c") }}
- binutils
host:
- libboost-devel
- cuda-version =${{ cuda_version }}
Expand Down
6 changes: 6 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@ if (NOT SKIP_GRPC_BUILD)
# at runtime with "undefined symbol: absl::…::Mutex::Dtor".
set_property(SOURCE ${GRPC_INFRA_FILES} DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
APPEND PROPERTY COMPILE_OPTIONS "-DNDEBUG")
set_property(SOURCE ${PROTO_SRCS} ${GRPC_PROTO_SRCS} ${GRPC_SERVICE_SRCS} ${DATA_PROTO_SRCS} DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
APPEND PROPERTY COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:CXX>:-fvisibility=default>")
endif (NOT SKIP_GRPC_BUILD)

add_library(cuopt_objs OBJECT
Expand All @@ -518,6 +520,9 @@ add_library(cuopt_objs OBJECT

set_target_properties(cuopt_objs
PROPERTIES POSITION_INDEPENDENT_CODE ON
CXX_VISIBILITY_PRESET hidden
CUDA_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON
CXX_SCAN_FOR_MODULES OFF
)

Expand Down Expand Up @@ -620,6 +625,7 @@ target_link_libraries(cuopt_objs
PRIVATE
${CUOPT_PRIVATE_CUDA_LIBS}
simde::simde
OpenMP::OpenMP_CXX
OpenMP::OpenMP_CUDA
$<$<BOOL:${CUOPT_ENABLE_GRPC}>:protobuf::libprotobuf>
$<$<BOOL:${CUOPT_ENABLE_GRPC}>:gRPC::grpc++>
Expand Down
5 changes: 3 additions & 2 deletions cpp/include/cuopt/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
/* clang-format on */
#pragma once

#include <cuopt/export.hpp>
#include "cuopt/mathematical_optimization/constants.h"

#include <stdarg.h>

#include <raft/core/error.hpp>

namespace cuopt {
namespace CUOPT_EXPORT cuopt {

/**
* @brief Indicates different type of exceptions which cuOpt might throw
Expand Down Expand Up @@ -168,4 +169,4 @@ void execute_cuopt_fail(Args... args)
throw cuopt::logic_error(msg, error_type_t::RuntimeError);
}

} // namespace cuopt
} // namespace CUOPT_EXPORT cuopt
14 changes: 14 additions & 0 deletions cpp/include/cuopt/export.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* clang-format off */
/*
* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
/* clang-format on */

#pragma once

#if defined(__GNUC__) || defined(__clang__)
#define CUOPT_EXPORT __attribute__((visibility("default")))
#else
#define CUOPT_EXPORT
#endif
7 changes: 5 additions & 2 deletions cpp/include/cuopt/grpc/cython_grpc_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#pragma once

#include <cuopt/export.hpp>
#include <cuopt/mathematical_optimization/utilities/cython_solve.hpp>

#include <cstddef>
Expand All @@ -22,7 +23,8 @@ class data_model_view_t;
} // namespace io
} // namespace cuopt::mathematical_optimization

namespace cuopt::cython {
namespace cuopt {
namespace CUOPT_EXPORT cython {

/** Mirrors cuopt::mathematical_optimization::job_status_t for the Python bindings. */
enum class grpc_job_status_t : int {
Expand Down Expand Up @@ -166,4 +168,5 @@ class grpc_python_client_t {
std::unique_ptr<impl_t> impl_;
};

} // namespace cuopt::cython
} // namespace CUOPT_EXPORT cython
} // namespace cuopt
7 changes: 5 additions & 2 deletions cpp/include/cuopt/grpc/grpc_client_env.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

#pragma once

#include <cuopt/export.hpp>
#include "grpc_client.hpp"

namespace cuopt::mathematical_optimization {
namespace cuopt {
namespace CUOPT_EXPORT mathematical_optimization {

/** How TLS is chosen when building a grpc_client_config_t. */
enum class grpc_tls_mode_t {
Expand Down Expand Up @@ -49,4 +51,5 @@ grpc_client_config_t make_grpc_client_config(const std::string& host,
grpc_tls_mode_t tls_mode,
const grpc_explicit_tls_t* explicit_tls = nullptr);

} // namespace cuopt::mathematical_optimization
} // namespace CUOPT_EXPORT mathematical_optimization
} // namespace cuopt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

#pragma once

namespace cuopt::mathematical_optimization {
#include <cuopt/export.hpp>

namespace cuopt {
namespace CUOPT_EXPORT mathematical_optimization {

/**
* @brief Enum for execution mode (local vs remote solve)
Expand Down Expand Up @@ -51,4 +54,5 @@ execution_mode_t get_execution_mode();
*/
memory_backend_t get_memory_backend_type();

} // namespace cuopt::mathematical_optimization
} // namespace CUOPT_EXPORT mathematical_optimization
} // namespace cuopt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <cuopt/export.hpp>
#include <cuopt/mathematical_optimization/optimization_problem_interface.hpp>

#include <raft/core/handle.hpp>
Expand All @@ -18,7 +19,8 @@
#include <string>
#include <vector>

namespace cuopt::mathematical_optimization {
namespace cuopt {
namespace CUOPT_EXPORT mathematical_optimization {

namespace io {
template <typename i_t, typename f_t>
Expand Down Expand Up @@ -238,4 +240,5 @@ class cpu_optimization_problem_t : public optimization_problem_interface_t<i_t,
std::vector<std::string> row_names_{};
};

} // namespace cuopt::mathematical_optimization
} // namespace CUOPT_EXPORT mathematical_optimization
} // namespace cuopt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <cuopt/export.hpp>
#include <cuopt/mathematical_optimization/cpu_pdlp_warm_start_data.hpp>
#include <cuopt/mathematical_optimization/mip/solver_solution.hpp>
#include <cuopt/mathematical_optimization/mip/solver_stats.hpp>
Expand All @@ -18,7 +19,8 @@

#include <vector>

namespace cuopt::mathematical_optimization {
namespace cuopt {
namespace CUOPT_EXPORT mathematical_optimization {

/**
* @brief CPU-backed LP solution (uses std::vector instead of rmm::device_uvector)
Expand Down Expand Up @@ -389,4 +391,5 @@ class cpu_mip_solution_t : public mip_solution_interface_t<i_t, f_t> {
i_t num_simplex_iterations_;
};

} // namespace cuopt::mathematical_optimization
} // namespace CUOPT_EXPORT mathematical_optimization
} // namespace cuopt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@

#pragma once

#include <cuopt/export.hpp>
#include <cuopt/mathematical_optimization/pdlp/pdlp_warm_start_data.hpp>

#include <vector>

namespace cuopt::mathematical_optimization {
namespace cuopt {
namespace CUOPT_EXPORT mathematical_optimization {

// CPU version of pdlp_warm_start_data_t using std::vector for remote execution
template <typename i_t, typename f_t>
Expand Down Expand Up @@ -118,4 +121,5 @@ template <typename i_t, typename f_t>
pdlp_warm_start_data_t<i_t, f_t> convert_to_gpu_warmstart(
const cpu_pdlp_warm_start_data_t<i_t, f_t>& cpu_data, rmm::cuda_stream_view stream);

} // namespace cuopt::mathematical_optimization
} // namespace CUOPT_EXPORT mathematical_optimization
} // namespace cuopt
9 changes: 9 additions & 0 deletions cpp/include/cuopt/mathematical_optimization/cuopt_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#define CUOPT_C_API_H

#include <cuopt/mathematical_optimization/constants.h>
#include <cuopt/export.hpp>

#include <stdint.h>

Expand All @@ -17,6 +18,10 @@
extern "C" {
#endif

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC visibility push(default)
#endif

/**
* @brief A ``cuOptOptimizationProblem`` object contains a representation of
* an LP, MIP, QP, or QCQP. It is created by ``cuOptCreateProblem``,
Expand Down Expand Up @@ -1163,6 +1168,10 @@ cuopt_int_t cuOptGetProblemStringArrayAttribute(cuOptOptimizationProblem problem
const char** strings_out,
cuopt_int_t count);

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC visibility pop
#endif

#ifdef __cplusplus
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#pragma once

#include <cuopt/export.hpp>
#include <cuopt/mathematical_optimization/io/mps_data_model.hpp>

#include <cstdint>
Expand All @@ -15,7 +16,9 @@
#include <type_traits>
#include <vector>

namespace cuopt::mathematical_optimization::io {
namespace cuopt {
namespace CUOPT_EXPORT mathematical_optimization {
namespace io {

/**
* @brief A representation of a linear programming (LP) optimization problem
Expand Down Expand Up @@ -482,4 +485,6 @@ class data_model_view_t {
std::vector<typename mps_data_model_t<i_t, f_t>::quadratic_constraint_t> quadratic_constraints_;
}; // class data_model_view_t

} // namespace cuopt::mathematical_optimization::io
} // namespace io
} // namespace CUOPT_EXPORT mathematical_optimization
} // namespace cuopt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@

#pragma once

#include <cuopt/export.hpp>

#include <cstdint>
#include <span>
#include <string>
#include <type_traits>
#include <vector>

namespace cuopt::mathematical_optimization::io {
namespace cuopt {
namespace CUOPT_EXPORT mathematical_optimization {
namespace io {

/**
* @brief A representation of a linear programming (LP) optimization problem
Expand Down Expand Up @@ -401,4 +405,6 @@ template <typename i_t, typename f_t>
void canonicalize_quadratic_constraints(
std::vector<typename mps_data_model_t<i_t, f_t>::quadratic_constraint_t>& constraints);

} // namespace cuopt::mathematical_optimization::io
} // namespace io
} // namespace CUOPT_EXPORT mathematical_optimization
} // namespace cuopt
Loading
Loading