Skip to content

Commit 69649f6

Browse files
committed
boost
1 parent 004fed1 commit 69649f6

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

python/libcuopt/CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,27 @@ FetchContent_Declare(
4646
)
4747
FetchContent_MakeAvailable(argparse)
4848

49+
# Try to find Boost in the system
50+
find_package(Boost 1.65 QUIET COMPONENTS system filesystem thread)
51+
52+
if(NOT Boost_FOUND)
53+
message(STATUS "Boost not found in system, trying alternative locations...")
54+
55+
# Try common Boost installation paths
56+
set(Boost_USE_STATIC_LIBS OFF)
57+
set(Boost_USE_MULTITHREADED ON)
58+
set(Boost_USE_STATIC_RUNTIME OFF)
59+
60+
# Try to find Boost again with more options
61+
find_package(Boost 1.65 COMPONENTS system filesystem thread)
62+
63+
if(NOT Boost_FOUND)
64+
message(FATAL_ERROR "Boost not found. Please install Boost 1.65 or later with components: system, filesystem, thread")
65+
endif()
66+
else()
67+
message(STATUS "Using system Boost installation")
68+
endif()
69+
4970
set(BUILD_TESTS OFF)
5071
set(BUILD_BENCHMARKS OFF)
5172
set(CUOPT_BUILD_TESTUTIL OFF)
@@ -54,6 +75,9 @@ set(CUDA_STATIC_RUNTIME ON)
5475
add_subdirectory(../../cpp cuopt-cpp)
5576

5677
target_link_libraries(cuopt PRIVATE argparse)
78+
if(Boost_FOUND)
79+
target_link_libraries(cuopt PRIVATE Boost::system Boost::filesystem Boost::thread)
80+
endif()
5781
target_link_libraries(cuopt_cli PRIVATE argparse)
5882

5983
set(rpaths

0 commit comments

Comments
 (0)