Skip to content

Commit 76f5400

Browse files
committed
Merge branch 'ortools-unpatch' into hipo-ttr
2 parents 8908815 + f0f95a5 commit 76f5400

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

CMakeLists.txt

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ endif()
5757
# message("CMAKE_CXX_COMPILER_ID is ${CMAKE_CXX_COMPILER_ID}")
5858
if (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
5959
message(STATUS "Compiler is IntelLLVM")
60-
if (CMAKE_HOST_WIN32 AND CMAKE_VERSION VERSION_LESS "3.23.0")
60+
if (CMAKE_HOST_WIN32 AND CMAKE_VERSION VERSION_LESS "3.23.0")
6161
message(FATAL_ERROR "Need at least CMake 3.23 for IntelLLVM support of IntelDPCPP package on Windows")
6262
elseif(CMAKE_VERSION VERSION_LESS "3.23.0")
6363
message(FATAL_ERROR "CMake 3.20.5 is the minimum recommended for IntelLLVM on Linux")
@@ -121,9 +121,9 @@ endif()
121121

122122
option(HIGHS_COVERAGE "Activate the code coverage compilation" OFF)
123123

124-
# Address | Thread | Leak
124+
# Address | Thread | Leak
125125
# Linux atm
126-
# Only Debug is theted atm
126+
# Only Debug atm
127127
# See below for RelWithDeb info, todo test wip
128128
set(DEBUG_MEMORY "Off" CACHE STRING "Sanitizers")
129129

@@ -137,7 +137,7 @@ message(STATUS "Build pdlp with GPU: ${CUPDLP_GPU}")
137137
option(CUPDLP_FIND_CUDA "Build pdlp with GPU" OFF)
138138
message(STATUS "Use FindCUDAConf: ${CUPDLP_FIND_CUDA}")
139139

140-
if(CUPDLP_GPU AND CMAKE_VERSION VERSION_LESS "3.25.0")
140+
if(CUPDLP_GPU AND CMAKE_VERSION VERSION_LESS "3.25.0")
141141
message("CUPDLP FindCUDAConf requires CMake version minumum 3.24. Please use a higher version of CMake.")
142142
endif()
143143

@@ -173,11 +173,11 @@ if (CUPDLP_GPU)
173173
# With FindCUDAConf.cmake
174174
# Need to have the CUDA_HOME environment variable set.
175175
include(FindCUDAConf)
176-
else()
176+
else()
177177
# Without FindCUDAConf.cmake
178178
enable_language(CUDA)
179179
find_package(CUDAToolkit REQUIRED)
180-
180+
181181
set(CUDA_LIBRARY-NOTFOUND, OFF)
182182
set(CUDA_LIBRARY CUDA::cudart CUDA::cublas CUDA::cusparse)
183183
endif()
@@ -228,7 +228,7 @@ if (BUILD_CXX)
228228
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
229229
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
230230
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
231-
# for multi-config build system (e.g. xcode)
231+
# for multi-config build system (e.g. xcode)
232232
foreach(OutputConfig IN LISTS CMAKE_CONFIGURATION_TYPES)
233233
string(TOUPPER ${OutputConfig} OUTPUTCONFIG)
234234
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/${OutputConfig}/${CMAKE_INSTALL_LIBDIR})
@@ -267,14 +267,14 @@ if (BUILD_CXX)
267267
option(STDCALL "Build highs with the __stdcall convention" OFF)
268268
endif()
269269

270-
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
271-
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
272-
CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
270+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
271+
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
272+
CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
273273
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
274-
# elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
274+
# elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
275275
# not recognised by cl
276-
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++11")
277-
endif()
276+
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++11")
277+
endif()
278278

279279
# Basic type
280280
include(CMakePushCheckState)
@@ -298,7 +298,7 @@ if (BUILD_CXX)
298298
check_type_size("int *" SIZEOF_INT_P LANGUAGE CXX)
299299
message(STATUS "Found int * size: ${SIZEOF_INT_P}")
300300
cmake_pop_check_state()
301-
301+
302302
# Use current CMAKE_C_FLAGS and CMAKE_CXX_FLAGS when checking for IPO support,
303303
# instead of defaults: https://cmake.org/cmake/help/latest/policy/CMP0138.html
304304
if(MSVC AND BUILD_SHARED_LIBS)
@@ -316,7 +316,7 @@ if (BUILD_CXX)
316316
set(ipo_supported NO)
317317
message(STATUS "IPO / LTO not currently supported building HiGHS on MinGW")
318318
else()
319-
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
319+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
320320
cmake_policy(SET CMP0138 NEW)
321321
endif()
322322

@@ -394,7 +394,7 @@ else()
394394
HIGHS_HAVE_BUILTIN_CLZ)
395395
endif()
396396

397-
set(CMAKE_MACOSX_RPATH ON)
397+
set(CMAKE_MACOSX_RPATH TRUE)
398398

399399
if (BUILD_DOTNET)
400400
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
@@ -451,7 +451,7 @@ endif()
451451

452452
# For debug of cuda locally
453453

454-
# does not work with older CMake
454+
# does not work with older CMake
455455
# add_compile_options("$<$<AND:$<CONFIG:Debug,RelWithDebInfo>,$<COMPILE_LANGUAGE:CUDA>>:-G>")
456456

457457
# add_compile_options("$<$<COMPILE_LANGUAGE:CUDA>:-G>")
@@ -476,7 +476,7 @@ if(MSVC)
476476
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:-D_CRT_SECURE_NO_WARNINGS>")
477477
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:/MP>")
478478

479-
# Try to split large pdb files into objects.
479+
# Try to split large pdb files into objects.
480480
# https://github.com/tensorflow/tensorflow/issues/31610
481481
# add_compile_options("/Z7")
482482
# add_link_options("/DEBUG:FASTLINK")
@@ -637,11 +637,11 @@ if(FAST_BUILD AND HIGHS_COVERAGE)
637637
message(STATUS "Building in coverage mode")
638638

639639
# Enable coverage flags
640-
add_compile_options(-O0)
641-
add_compile_options(--coverage)
642-
add_compile_options(-fprofile-update=atomic)
640+
add_compile_options(-O0)
641+
add_compile_options(--coverage)
642+
add_compile_options(-fprofile-update=atomic)
643643

644-
add_link_options(-O0)
644+
add_link_options(-O0)
645645
add_link_options(--coverage) # Ensure coverage data is linked correctly
646646

647647
find_program(GCOV_PATH gcov)

highs/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ if(NOT FAST_BUILD)
5656
endif()
5757

5858
# set the install rpath to the installed destination
59-
set_target_properties(libhighs PROPERTIES INSTALL_RPATH
60-
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
59+
if(APPLE)
60+
set_target_properties(libhighs PROPERTIES INSTALL_RPATH "@loader_path")
61+
elseif (UNIX)
62+
set_target_properties(libhighs PROPERTIES INSTALL_RPATH "$ORIGIN")
63+
endif()
6164

6265
# install the header files of highs
6366
foreach(file ${headers})

0 commit comments

Comments
 (0)