Skip to content

Commit 4a9b5c3

Browse files
committed
macos and stray m on win GPU
1 parent 1be00f5 commit 4a9b5c3

File tree

2 files changed

+46
-35
lines changed

2 files changed

+46
-35
lines changed

CMakeLists.txt

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,25 @@ message(STATUS "Build pdlp with GPU: ${CUPDLP_GPU}")
127127
# endif()
128128

129129
if (CUPDLP_GPU)
130+
if (WIN32)
131+
set(BUILD_SHARED_LIBS ON)
132+
endif()
133+
130134
set (CUPDLP_CPU OFF)
131-
# With FindCUDAConf.cmake
132-
# default cuda_home on linux
133-
# set(CUDA_HOME "/usr/local/cuda" CACHE STRING "Cuda path to install")
134-
# message(NOTICE "Set build cuPDLP with CUDA")
135-
# list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
136-
# include(FindCUDAConf.cmake)
137-
138-
# With deleted FindCUDAConf.cmake
139-
find_package(CUDAToolkit REQUIRED)
140-
set(CUDA_LIBRARY-NOTFOUND, OFF)
141-
set(CUDA_LIBRARY CUDA::cudart CUDA::cublas CUDA::cusparse)
142-
143-
message(NOTICE "Set build cuPDLP with CUDA")
135+
136+
# With FindCUDAConf.cmake
137+
# default cuda_home on linux
138+
# set(CUDA_HOME "/usr/local/cuda" CACHE STRING "Cuda path to install")
139+
# message(NOTICE "Set build cuPDLP with CUDA")
140+
# list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
141+
# include(FindCUDAConf.cmake)
142+
143+
# With deleted FindCUDAConf.cmake
144+
find_package(CUDAToolkit REQUIRED)
145+
set(CUDA_LIBRARY-NOTFOUND, OFF)
146+
set(CUDA_LIBRARY CUDA::cudart CUDA::cublas CUDA::cusparse)
147+
148+
message(NOTICE "Set build cuPDLP with CUDA")
144149
else()
145150
set (CUPDLP_CPU ON)
146151
set(CUDA_LIBRARY-NOTFOUND true)
@@ -229,8 +234,9 @@ if (BUILD_CXX)
229234
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
230235
CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
231236
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
232-
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
233-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++11")
237+
# elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
238+
# not recognised by cl
239+
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++11")
234240
endif()
235241

236242
# Basic type

check/CMakeLists.txt

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY))
113113
target_link_libraries(unit_tests highs Catch)
114114

115115
if (CUPDLP_GPU)
116-
target_link_libraries(unit_tests cudalin ${CUDA_LIBRARY} m)
116+
if (WIN32)
117+
target_link_libraries(unit_tests cudalin ${CUDA_LIBRARY})
118+
else()
119+
target_link_libraries(unit_tests cudalin ${CUDA_LIBRARY} m)
120+
endif()
117121
target_include_directories(unit_tests PRIVATE ${HIGHS_SOURCE_DIR}/src/pdlp/cupdlp/cuda)
118122
set_target_properties(unit_tests PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
119123
endif()
@@ -291,24 +295,25 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY))
291295
"standata\; 1.25769951\;"
292296
"standgub\; 1.2576993\;"
293297
)
294-
endif()
298+
else()
295299
# CUPDLP_GPU or CPU with native termination.
296-
if (CUPDLP_FORCE_NATIVE)
297-
set(pdlpInstances
298-
"25fv47\; 5.5018360\;"
299-
"adlittle\; 2.254953\;"
300-
"afiro\;-4.64753126\;"
301-
"avgas\;-7.75000038\;"
302-
"blending\;-3.19999999\;"
303-
"chip\;-9.000000020\;"
304-
"e226\;-1.163892070\;"
305-
"scrs8\; 9.042970154\;"
306-
"sctest\; 5.750000001\;"
307-
"shell\; 1.2088253471\;"
308-
"stair\;-2.512669020\;"
309-
"standata\; 1.257699155\;"
310-
"standgub\; 1.257700132\;"
311-
)
300+
if (CUPDLP_FORCE_NATIVE)
301+
set(pdlpInstances
302+
"25fv47\; 5.5018360\;"
303+
"adlittle\; 2.254953\;"
304+
"afiro\;-4.64753126\;"
305+
"avgas\;-7.75000038\;"
306+
"blending\;-3.19999999\;"
307+
"chip\;-9.000000020\;"
308+
"e226\;-1.163892070\;"
309+
"scrs8\; 9.042970154\;"
310+
"sctest\; 5.750000001\;"
311+
"shell\; 1.2088253471\;"
312+
"stair\;-2.512669020\;"
313+
"standata\; 1.257699155\;"
314+
"standgub\; 1.257700132\;"
315+
)
316+
endif()
312317
endif()
313318
endif()
314319
elseif(WIN32)
@@ -335,9 +340,9 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY))
335340
"afiro\;-4.64753142\;"
336341
"avgas\;-7.749999999\;"
337342
"blending\;-3.19999999\;"
338-
"chip\;-8.9999988715\;"
343+
"chip\;-8.99999999\;"
339344
"e226\;-1.163892\;"
340-
"scrs8\; 9.04296953\;"
345+
"scrs8\; 9.04296954\;"
341346
"sctest\; 5.749999936\;"
342347
"shell\; 1.2088253460\;"
343348
"stair\;-2.5126695\;"

0 commit comments

Comments
 (0)