Skip to content

Commit 6ceaaa4

Browse files
committed
add PIE settings to cuopt_grpc_server build (match cuopt_cli)
this is necessary for cuopt_grpc_server binary to be visible in CI on amd64
1 parent 995a8b1 commit 6ceaaa4

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

cpp/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,12 +787,15 @@ set_target_properties(cuopt_grpc_server
787787
CXX_STANDARD 20
788788
CXX_STANDARD_REQUIRED ON
789789
CXX_SCAN_FOR_MODULES OFF
790+
POSITION_INDEPENDENT_CODE ON
790791
)
791792

792793
target_compile_options(cuopt_grpc_server
793794
PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${CUOPT_CXX_FLAGS}>"
794795
)
795796

797+
target_link_options(cuopt_grpc_server PRIVATE -pie)
798+
796799
target_include_directories(cuopt_grpc_server
797800
PRIVATE
798801
"${CMAKE_CURRENT_SOURCE_DIR}/src"

python/cuopt/cuopt/tests/linear_programming/test_cpu_only_execution.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,12 @@ def _start_grpc_server_fixture(port_offset):
438438
stdout=subprocess.DEVNULL,
439439
stderr=subprocess.DEVNULL,
440440
)
441+
time.sleep(0.5)
442+
if proc.poll() is not None:
443+
pytest.skip(
444+
f"cuopt_grpc_server exited immediately (rc={proc.returncode}), "
445+
"binary may be unable to load shared libraries in this environment"
446+
)
441447
if not _wait_for_port(port, timeout=15):
442448
proc.kill()
443449
proc.wait()

0 commit comments

Comments
 (0)