Skip to content

Commit fdb6c08

Browse files
committed
conflicts
2 parents 06a394e + cb7e338 commit fdb6c08

File tree

3 files changed

+37
-11
lines changed

3 files changed

+37
-11
lines changed

CMakeLists.txt

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ option(CUPDLP_GPU "Build pdlp with GPU" OFF)
121121

122122
message(STATUS "Build pdlp with GPU: ${CUPDLP_GPU}")
123123

124-
if (NOT LINUX)
125-
set (CUPDLP_GPU OFF)
126-
message(STATUS "CUPLDP with Nvidia is only supported on Linux at the moment. Using CPU version.")
127-
endif()
124+
# if (NOT LINUX)
125+
# set (CUPDLP_GPU OFF)
126+
# message(STATUS "CUPLDP with Nvidia is only supported on Linux at the moment. Using CPU version.")
127+
# endif()
128128

129129
if (CUPDLP_GPU)
130130
set (CUPDLP_CPU OFF)
@@ -409,11 +409,16 @@ endif()
409409
add_compile_options("$<$<AND:$<CONFIG:Debug,RelWithDebInfo>,$<COMPILE_LANGUAGE:CUDA>>:-G>")
410410
# add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:-G>")
411411

412-
add_compile_options("-Wno-deprecated-declarations")
412+
if (CUPDLP_GPU AND UNIX)
413+
add_compile_options("-Wno-deprecated-declarations")
414+
endif()
413415
# add_compile_options("-Wno-implicit-function-declaration")
414416

415417
# set(CMAKE_C_FLAGS "-Wno-deprecated-declarations")
416-
set(CMAKE_C_FLAGS "-Wno-implicit-function-declaration")
418+
if (UNIX)
419+
set(CMAKE_C_FLAGS "-Wno-implicit-function-declaration")
420+
endif()
421+
417422

418423

419424
# If Visual Studio targets are being built.
@@ -426,8 +431,15 @@ if(MSVC)
426431

427432
# Try to split large pdb files into objects.
428433
# https://github.com/tensorflow/tensorflow/issues/31610
429-
add_compile_options("/Z7")
430-
add_link_options("/DEBUG:FASTLINK")
434+
# add_compile_options("/Z7")
435+
# add_link_options("/DEBUG:FASTLINK")
436+
437+
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:/Z7>")
438+
439+
if (NOT CUPDLP_GPU)
440+
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:/DEBUG:FASTLINK>")
441+
endif()
442+
431443
if(STDCALL)
432444
# /Gz - stdcall calling convention
433445
add_definitions(/Gz)

src/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,13 @@ else()
201201
set(CUPDLP_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/src/pdlp/cupdlp/")
202202

203203
add_subdirectory(pdlp/cupdlp/cuda)
204-
target_link_libraries(highs cudalin ${CUDA_LIBRARY} m)
204+
205+
if (WIN32)
206+
target_link_libraries(highs cudalin ${CUDA_LIBRARY})
207+
else()
208+
target_link_libraries(highs cudalin ${CUDA_LIBRARY} m)
209+
endif()
210+
205211
set_target_properties(highs PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
206212

207213
endif()

src/pdlp/cupdlp/cuda/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,22 @@ add_library(cudalin SHARED
77
${CUPDLP_INCLUDE_DIR}/cuda/cupdlp_cudalinalg.cu
88
)
99
set_target_properties(cudalin PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
10-
target_include_directories(cudalin PUBLIC "/usr/local/cuda/include")
10+
11+
set_target_properties(cudalin PROPERTIES CUDA_ARCHITECTURES native)
12+
13+
target_include_directories(cudalin PUBLIC "${CMAKE_CUDA_PATH}/include")
14+
1115
target_compile_definitions(cudalin
1216
PUBLIC
1317
# If the debug configuration pass the DEBUG define to the compiler
1418
$<$<CONFIG:Debug>:-DCUPDLP_DEBUG=1>
1519
)
1620

17-
target_link_libraries(cudalin ${CUDA_LIBRARY} m)
21+
if (WIN32)
22+
target_link_libraries(cudalin ${CUDA_LIBRARY})
23+
else()
24+
target_link_libraries(cudalin ${CUDA_LIBRARY} m)
25+
endif()
1826

1927
# add a test
2028
add_executable(testcudalin test_cuda_linalg.c)

0 commit comments

Comments
 (0)