File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727# Install Protobuf + gRPC (protoc + grpc_cpp_plugin)
2828bash ci/utils/install_protobuf_grpc.sh
2929
30- # The fast MPS parser requires OpenMP 5 symbols from the active GCC toolset. Pin FindOpenMP to
31- # that compiler's libgomp instead of the older system runtime on Rocky/RHEL wheel builders .
30+ # The wheel must link against the active GCC toolset's OpenMP runtime. Rocky/RHEL's system
31+ # libgomp is older and does not provide the OpenMP 5 symbols required by libcuopt .
3232CXX_COMPILER=" ${CXX:- g++} "
3333GOMP_LIBRARY=" $( " ${CXX_COMPILER} " -print-file-name=libgomp.so) "
3434if [[ " ${GOMP_LIBRARY} " != /* || ! -f " ${GOMP_LIBRARY} " ]]; then
3535 echo " Could not resolve libgomp from ${CXX_COMPILER} : '${GOMP_LIBRARY} '" >&2
3636 exit 1
3737fi
3838
39- export SKBUILD_CMAKE_ARGS=" -DCUOPT_BUILD_WHEELS=ON;-DDISABLE_DEPRECATION_WARNING=ON;-DOpenMP_gomp_LIBRARY:FILEPATH=${GOMP_LIBRARY} "
39+ if ! readelf --dyn-syms --wide " ${GOMP_LIBRARY} " | \
40+ grep ' omp_fulfill_event' > /dev/null; then
41+ echo " ${GOMP_LIBRARY} does not provide omp_fulfill_event" >&2
42+ exit 1
43+ fi
44+
45+ echo " Using OpenMP runtime from ${CXX_COMPILER} : ${GOMP_LIBRARY} "
46+
47+ export SKBUILD_CMAKE_ARGS=" \
48+ -DCUOPT_BUILD_WHEELS=ON;\
49+ -DDISABLE_DEPRECATION_WARNING=ON;\
50+ -DOpenMP_gomp_LIBRARY:FILEPATH=${GOMP_LIBRARY} ;\
51+ -DCUOPT_OPENMP_RUNTIME_LIBRARY:FILEPATH=${GOMP_LIBRARY} "
4052
4153# OpenSSL 3 hints for libcuopt's own find_package(OpenSSL).
4254#
Original file line number Diff line number Diff line change @@ -15,6 +15,14 @@ project(
1515 LANGUAGES CXX CUDA
1616)
1717
18+ option (CUOPT_BUILD_WHEELS "Configure wheel-specific linkage" OFF )
19+ set (
20+ CUOPT_OPENMP_RUNTIME_LIBRARY
21+ ""
22+ CACHE FILEPATH
23+ "Exact OpenMP runtime to link into wheel binaries"
24+ )
25+
1826# Debug: Print CUDA compiler version early
1927message (STATUS "=============================================================" )
2028message (STATUS "libcuopt: CMAKE_CUDA_COMPILER_VERSION = ${CMAKE_CUDA_COMPILER_VERSION } " )
@@ -69,6 +77,39 @@ target_link_libraries(cuopt_cli PRIVATE
6977 argparse
7078)
7179
80+ if (CUOPT_BUILD_WHEELS)
81+ if (NOT IS_ABSOLUTE "${CUOPT_OPENMP_RUNTIME_LIBRARY} " OR
82+ NOT EXISTS "${CUOPT_OPENMP_RUNTIME_LIBRARY} " )
83+ message (
84+ FATAL_ERROR
85+ "CUOPT_OPENMP_RUNTIME_LIBRARY must name an existing absolute library"
86+ )
87+ endif ()
88+
89+ message (
90+ STATUS
91+ "Wheel OpenMP runtime: ${CUOPT_OPENMP_RUNTIME_LIBRARY} "
92+ )
93+
94+ # Keep the exact OpenMP runtime attached even when the executable's only
95+ # reference to it comes through libcuopt.so.
96+ foreach (_target IN ITEMS cuopt cuopt_cli cuopt_grpc_server)
97+ if (TARGET ${_target} )
98+ target_link_libraries (
99+ ${_target}
100+ PRIVATE
101+ "-Wl,--no-as-needed"
102+ "${CUOPT_OPENMP_RUNTIME_LIBRARY} "
103+ "-Wl,--as-needed"
104+ )
105+ endif ()
106+ endforeach ()
107+
108+ # Report unresolved runtime symbols while linking libcuopt.so rather than
109+ # deferring the failure until cuopt_cli or cuopt_grpc_server is linked.
110+ target_link_options (cuopt PRIVATE "LINKER:-z,defs" )
111+ endif ()
112+
72113set (rpaths
73114 "$ORIGIN/../lib64"
74115 "$ORIGIN/../../rapids_logger/lib64"
You can’t perform that action at this time.
0 commit comments