Skip to content

Commit 3330234

Browse files
committed
cmake: migrate to scip 10.0.0 and soplex 8.0.0
1 parent 0cc3ead commit 3330234

File tree

4 files changed

+81
-123
lines changed

4 files changed

+81
-123
lines changed

Dependencies.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Cgl=0.60.9
1010
Cbc=2.10.12
1111
GLPK=5.0
1212
HiGHS=v1.12.0
13-
Scip=v924
13+
Scip=v10.0.0
14+
Soplex=v8.0.0
1415
# Python
1516
pybind11=v2.13.6
1617
pybind11_abseil=v202402.0

cmake/dependencies/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,11 @@ if(BUILD_soplex)
353353
FetchContent_Declare(
354354
soplex
355355
GIT_REPOSITORY "https://github.com/scipopt/soplex.git"
356-
GIT_TAG "release-716"
356+
GIT_TAG "v8.0.0"
357357
GIT_SHALLOW TRUE
358358
UPDATE_COMMAND git reset --hard
359359
PATCH_COMMAND git apply --ignore-whitespace
360-
"${CMAKE_CURRENT_LIST_DIR}/../../patches/soplex-v7.1.6.patch"
360+
"${CMAKE_CURRENT_LIST_DIR}/../../patches/soplex-v8.0.0.patch"
361361
)
362362
set(SHARED ON CACHE BOOL "Soplex param" FORCE)
363363
set(ZLIB ON CACHE BOOL "Soplex param" FORCE)
@@ -383,11 +383,11 @@ if(BUILD_SCIP)
383383
FetchContent_Declare(
384384
scip
385385
GIT_REPOSITORY "https://github.com/scipopt/scip.git"
386-
GIT_TAG "v924"
386+
GIT_TAG "v10.0.0"
387387
GIT_SHALLOW TRUE
388388
UPDATE_COMMAND git reset --hard
389389
PATCH_COMMAND git apply --ignore-whitespace
390-
"${CMAKE_CURRENT_LIST_DIR}/../../patches/scip-v924.patch"
390+
"${CMAKE_CURRENT_LIST_DIR}/../../patches/scip-v10.0.0.patch"
391391
)
392392
set(SHARED ON CACHE BOOL "Scip param" FORCE)
393393
set(ZLIB ON CACHE BOOL "Scip param" FORCE)
Lines changed: 19 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index 38917b8e..a8dff6e9 100644
2+
index b3c57799..eeeca4c8 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
5-
@@ -38,9 +38,11 @@ set(CPACK_PACKAGE_VENDOR "Zuse Institute Berlin")
5+
@@ -52,9 +52,11 @@ set(CPACK_PACKAGE_VENDOR "Zuse Institute Berlin")
66
set(CPACK_PACKAGE_CONTACT "http://scipopt.org")
77
include(CPack)
88

@@ -17,98 +17,39 @@ index 38917b8e..a8dff6e9 100644
1717

1818
if(SCIPOptSuite_BINARY_DIR)
1919
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCIPOptSuite_BINARY_DIR}/bin)
20-
@@ -239,7 +241,7 @@ if(DEBUGSOL)
21-
endif()
22-
23-
#set the correct rpath for OS X
24-
-set(CMAKE_MACOSX_RPATH ON)
25-
+set(CMAKE_MACOSX_RPATH TRUE)
26-
27-
#set defines for Windows
28-
if(WIN32)
29-
@@ -412,22 +414,11 @@ endif()
30-
#search the selected LP solver library
20+
@@ -517,10 +519,10 @@ endif()
3121
message(STATUS "Finding Solver \"${LPS}\"")
3222
if(LPS STREQUAL "spx")
33-
- message(STATUS "Finding Soplex")
34-
- find_package(SOPLEX CONFIG HINTS ${SOPLEX_DIR})
35-
- if(NOT SOPLEX_FOUND)
36-
- # Utilities to automatically download missing dependencies
37-
- include(cmake/Dependencies.cmake)
38-
- find_or_download_package(
39-
- NAME SOPLEX
40-
- VERSION 7.0.1
41-
- URL https://github.com/scipopt/soplex/archive/refs/tags/release-701.tar.gz
42-
- URL_HASH SHA256=80cce994dcbe45fd52b60e31a3aeb5d2c60a7ddbaae495e0ce6bf58481675696
43-
- COMPONENTS soplex)
44-
- find_package(SOPLEX REQUIRED CONFIG HINTS _deps/local)
45-
- endif()
23+
message(STATUS "Finding Soplex")
24+
- find_package(SOPLEX REQUIRED CONFIG HINTS ${SOPLEX_DIR})
4625
- if(NOT SOPLEX_FOUND)
47-
+ message(STATUS "Finding Soplex...")
4826
+ if(NOT TARGET libsoplex-pic OR NOT TARGET libsoplex)
4927
message(FATAL_ERROR "Requested LP solver SoPlex not found.")
5028
endif()
5129
+ set(SOPLEX_FOUND TRUE)
5230
if (DEFINED SOPLEX_WITH_PAPILO)
5331
message(STATUS "SOPLEX links PAPILO")
5432
if((NOT SCIP_WITH_PAPILO)) # TODO not sure how to handle AUTOBUILD
55-
@@ -502,9 +493,9 @@ if(SOPLEX_FOUND)
33+
@@ -593,11 +595,11 @@ if(SOPLEX_FOUND)
5634
message(STATUS "Finding SOPLEX - found")
5735
# SoPlex headers can be directly included
5836
include_directories(${SOPLEX_INCLUDE_DIRS})
5937
- set(LPS_LIBRARIES ${SOPLEX_LIBRARIES})
38+
- set(LPS_PIC_LIBRARIES ${SOPLEX_PIC_LIBRARIES})
6039
+ set(LPS_LIBRARIES libsoplex)
61-
if(SHARED)
62-
- set(LPS_PIC_LIBRARIES ${SOPLEX_PIC_LIBRARIES})
63-
+ set(LPS_PIC_LIBRARIES libsoplex-pic)
64-
else()
65-
set(LPS_PIC_LIBRARIES ${LPS_LIBRARIES})
66-
endif()
67-
@@ -514,7 +505,7 @@ if(SOPLEX_FOUND)
68-
set(lpi lpi/lpi_spx2.cpp)
69-
endif()
40+
+ set(LPS_PIC_LIBRARIES libsoplex-pic)
41+
set(lpi lpi/lpi_spx.cpp)
7042
else()
7143
- message(STATUS "Support SOPLEX: OFF")
7244
+ message(FATAL_ERROR "SOPLEX not found !")
7345
endif()
7446

7547
if(CLP_FOUND)
76-
diff --git a/scip-config.cmake.in b/scip-config.cmake.in
77-
index 559552f9..682ac40a 100644
78-
--- a/scip-config.cmake.in
79-
+++ b/scip-config.cmake.in
80-
@@ -1,17 +1,16 @@
81-
if(NOT TARGET libscip)
82-
- include("${CMAKE_CURRENT_LIST_DIR}/scip-targets.cmake")
83-
-endif()
84-
+ include(CMakeFindDependencyMacro)
85-
+ if(@ZIMPL_NEEDED@)
86-
+ find_dependency(ZIMPL REQUIRED NO_MODULE)
87-
+ endif()
88-
+ if(@SOPLEX_NEEDED@)
89-
+ find_dependency(SOPLEX REQUIRED NO_MODULE)
90-
+ endif()
91-
92-
-if(@ZIMPL_NEEDED@)
93-
- set(ZIMPL_DIR "@CONF_ZIMPL_DIR@")
94-
- find_package(ZIMPL QUIET CONFIG)
95-
-endif()
96-
-
97-
-if(@SOPLEX_NEEDED@)
98-
- set(SOPLEX_DIR "@CONF_SOPLEX_DIR@")
99-
- find_package(SOPLEX QUIET CONFIG)
100-
+ include("${CMAKE_CURRENT_LIST_DIR}/scip-targets.cmake")
101-
endif()
102-
103-
+# Legacy
104-
set(SCIP_LIBRARIES libscip)
105-
set(SCIP_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
106-
set(SCIP_FOUND TRUE)
10748
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
108-
index be3760c4..b764f0b4 100644
49+
index c6ce7283..6b6b1fc8 100644
10950
--- a/src/CMakeLists.txt
11051
+++ b/src/CMakeLists.txt
111-
@@ -1115,6 +1115,13 @@ target_link_libraries(scip
52+
@@ -1213,6 +1213,13 @@ target_link_libraries(scip
11253
add_dependencies(libscip scip_update_githash)
11354
add_dependencies(scip scip_update_githash)
11455

@@ -120,10 +61,10 @@ index be3760c4..b764f0b4 100644
12061
+ INSTALL_RPATH "$ORIGIN")
12162
+endif()
12263
set_target_properties(libscip PROPERTIES
123-
VERSION ${SCIP_VERSION_MAJOR}.${SCIP_VERSION_MINOR}.${SCIP_VERSION_PATCH}.${SCIP_VERSION_SUB}
64+
VERSION ${SCIP_VERSION_MAJOR}.${SCIP_VERSION_MINOR}.${SCIP_VERSION_PATCH}
12465
SOVERSION ${SCIP_VERSION_MAJOR}.${SCIP_VERSION_MINOR}
125-
@@ -1153,17 +1160,8 @@ install(TARGETS scip libscip EXPORT scip-targets
126-
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
66+
@@ -1265,17 +1272,8 @@ install(FILES ${PROJECT_SOURCE_DIR}/LICENSE DESTINATION ${CMAKE_INSTALL_DATADIR}
67+
install(FILES ${PROJECT_SOURCE_DIR}/src/tclique/LICENSE DESTINATION ${CMAKE_INSTALL_DATADIR}/licenses/scip/tclique)
12768

12869
# Add all targets to the build-tree export set
12970
-export(TARGETS scip libscip
@@ -140,11 +81,11 @@ index be3760c4..b764f0b4 100644
14081
+#export(TARGETS scip libscip
14182
+# FILE "${PROJECT_BINARY_DIR}/scip-targets.cmake")
14283

143-
# configure the config file for the build tree
144-
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src" "${PROJECT_BINARY_DIR}")
145-
@@ -1179,18 +1177,16 @@ ${PROJECT_BINARY_DIR}/scip-config-version.cmake
146-
147-
#configure the config file for the install
84+
# Configure scip-config.cmake for the build-tree:
85+
# We add the CMake module path from the sources.
86+
@@ -1295,18 +1293,16 @@ ${PROJECT_BINARY_DIR}/scip-config-version.cmake
87+
# We add the current directory of the installed scip-config.cmake as a CMake module path.
88+
set(EXTRA_CMAKE_MODULE_PATH "\${CMAKE_CURRENT_LIST_DIR}")
14889
set(CONF_INCLUDE_DIRS "\${CMAKE_CURRENT_LIST_DIR}/../../../include")
14990
-if(SOPLEX_NEEDED)
15091
- set(CONF_SOPLEX_DIR "\${CMAKE_CURRENT_LIST_DIR}/../soplex")
Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index 96aefab..760b0f8 100644
2+
index 9511442..58a8a58 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
5-
@@ -27,6 +27,10 @@ set(CPACK_PACKAGE_VERSION_PATCH "${SOPLEX_VERSION_PATCH}")
5+
@@ -31,6 +31,10 @@ set(CPACK_PACKAGE_VERSION_PATCH "${SOPLEX_VERSION_PATCH}")
66
set(CPACK_PACKAGE_VENDOR "Zuse Institute Berlin")
77
include(CPack)
88

@@ -13,7 +13,7 @@ index 96aefab..760b0f8 100644
1313
option(ZLIB "Use ZLIB" ON)
1414
option(GMP "Use GMP" ON)
1515
option(EMSCRIPTEN_HTML "Emscripten HTML output" OFF)
16-
@@ -43,11 +47,17 @@ option(SANITIZE_THREAD "should the thread sanitizer be enabled in debug mode if
16+
@@ -44,11 +48,17 @@ option(SANITIZE "should sanitizers be enabled if available" OFF)
1717
option(COVERAGE "enable coverage support" OFF)
1818
option(PAPILO "should papilo library be linked" ON)
1919

@@ -34,12 +34,7 @@ index 96aefab..760b0f8 100644
3434

3535
# for colorized output
3636
if(NOT WIN32)
37-
@@ -65,10 +75,12 @@ if(NOT CMAKE_BUILD_TYPE)
38-
endif()
39-
40-
# set the correct rpath for OS X
41-
-set(CMAKE_MACOSX_RPATH ON)
42-
+set(CMAKE_MACOSX_RPATH TRUE)
37+
@@ -70,6 +80,8 @@ set(CMAKE_MACOSX_RPATH ON)
4338

4439
# use C++14 standard
4540
set(CMAKE_CXX_STANDARD 14)
@@ -48,7 +43,7 @@ index 96aefab..760b0f8 100644
4843

4944
# set function visibility default to hidden
5045
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
51-
@@ -123,12 +135,11 @@ if(COVERAGE)
46+
@@ -124,12 +136,11 @@ if(COVERAGE)
5247
endif()
5348

5449
if(ZLIB)
@@ -66,7 +61,7 @@ index 96aefab..760b0f8 100644
6661
endif()
6762

6863
if(GMP)
69-
@@ -170,39 +181,24 @@ else()
64+
@@ -171,42 +182,24 @@ else()
7065
set(SOPLEX_WITH_PAPILO off)
7166
endif()
7267

@@ -76,7 +71,6 @@ index 96aefab..760b0f8 100644
7671
- find_package(Boost ${BOOST_MINIMUM_VERSION}) # PaPILO requires at least Boost 1.65 (on mac 1.72)
7772
- if(Boost_FOUND)
7873
- set(SOPLEX_WITH_BOOST on)
79-
- include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
8074
- if(NOT Boost_VERSION_MACRO)
8175
- set(Boost_VERSION_MACRO ${Boost_VERSION})
8276
- endif()
@@ -89,11 +83,15 @@ index 96aefab..760b0f8 100644
8983
- Found Boost version is ${Boost_VERSION_STRING}.")
9084
- endif()
9185
- endif()
86+
- if(Boost_DIR)
87+
- message(STATUS "Found Boost: ${Boost_DIR}")
88+
- endif()
89+
- set(libs ${libs} Boost::boost)
9290
- if(MPFR) # MPFR is used within boost multiprecision, so using it without Boost does not make sense
9391
- find_package(MPFR)
9492
- endif()
9593
- if(MPFR_FOUND)
96-
- message(STATUS "SoPlex with Boost MPFR libraries")
94+
- message(STATUS "SoPlex with Boost MPFR ${MPFR_VERSION} libraries")
9795
- set(SOPLEX_WITH_MPFR on)
9896
- include_directories(${MPFR_INCLUDE_DIRS})
9997
- set(libs ${libs} ${MPFR_LIBRARIES})
@@ -123,7 +121,7 @@ index 96aefab..760b0f8 100644
123121
endif()
124122

125123
# disable fused floating point contraction to enhance reproducibility across compilers and architectures
126-
@@ -244,7 +240,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/soplex/config.h.in ${PROJECT_BINA
124+
@@ -251,7 +244,7 @@ set(EXTRA_CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
127125
configure_file(${PROJECT_SOURCE_DIR}/soplex-config.cmake.in "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/soplex-config.cmake" @ONLY)
128126

129127
add_subdirectory(src)
@@ -136,18 +134,18 @@ index 96aefab..760b0f8 100644
136134
+ add_subdirectory(check)
137135
+endif()
138136
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
139-
index 16ffb17..b5a0b56 100644
137+
index d57c5fe..11f914a 100644
140138
--- a/src/CMakeLists.txt
141139
+++ b/src/CMakeLists.txt
142-
@@ -193,25 +193,27 @@ target_link_libraries(libsoplexshared libsoplex ${libs})
140+
@@ -193,28 +193,32 @@ target_link_libraries(libsoplexshared libsoplex ${libs})
143141
set_target_properties(libsoplexshared PROPERTIES CXX_VISIBILITY_PRESET default)
144142

145143
# create soplex binary using library without pic
146144
-add_executable(soplex soplexmain.cpp)
147-
-target_link_libraries(soplex LINK_PUBLIC libsoplex ${Boost_LIBRARIES})
145+
-target_link_libraries(soplex LINK_PUBLIC libsoplex)
148146
+if(SOPLEX_SOPLEX)
149-
+ add_executable(soplex EXCLUDE_FROM_ALL soplexmain.cpp)
150-
+ target_link_libraries(soplex PRIVATE libsoplex ${Boost_LIBRARIES})
147+
+ add_executable(soplex soplexmain.cpp)
148+
+ target_link_libraries(soplex LINK_PUBLIC libsoplex)
151149

152150
-if(EMSCRIPTEN AND EMSCRIPTEN_HTML)
153151
+ if(EMSCRIPTEN AND EMSCRIPTEN_HTML)
@@ -159,40 +157,58 @@ index 16ffb17..b5a0b56 100644
159157
+ # set the install rpath to the installed destination
160158
+ set_target_properties(soplex PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
161159

162-
-if(CMAKE_BUILD_TYPE EQUAL "Debug")
163-
- find_package(Sanitizers)
164-
- add_sanitizers(soplex)
165-
+ if(CMAKE_BUILD_TYPE EQUAL "Debug")
166-
+ find_package(Sanitizers)
167-
+ add_sanitizers(soplex)
168-
+ endif()
169-
endif()
170-
171-
add_executable(example EXCLUDE_FROM_ALL example.cpp)
172-
target_link_libraries(example libsoplex)
160+
-if(SANITIZE)
161+
+ if(SANITIZE)
162+
find_package(Sanitizers)
163+
add_sanitizers(libsoplex)
164+
add_sanitizers(libsoplex-pic)
165+
add_sanitizers(libsoplexshared)
166+
add_sanitizers(soplex)
167+
get_target_property(CONF_SANITIZE_FLAGS libsoplex SANITIZE_FLAGS)
168+
-endif(SANITIZE)
169+
-
170+
-add_executable(example EXCLUDE_FROM_ALL example.cpp)
171+
-target_link_libraries(example libsoplex)
172+
+ endif(SANITIZE)
173+
+endif()
173174

174175
-# set the install rpath to the installed destination
175176
-set_target_properties(soplex PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
176-
-
177+
+if(SOPLEX_EXAMPLE)
178+
+ add_executable(example EXCLUDE_FROM_ALL example.cpp)
179+
+ target_link_libraries(example libsoplex)
180+
+endif()
181+
177182
# install the header files of soplex
178183
install(FILES ${headers} ${PROJECT_BINARY_DIR}/soplex/config.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/soplex)
179-
install(FILES soplex.h soplex.hpp soplex_interface.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
180-
@@ -237,15 +239,23 @@ install(FILES
181-
DESTINATION include/soplex/external/zstr)
184+
@@ -243,14 +247,23 @@ install(FILES
185+
install(FILES ${PROJECT_SOURCE_DIR}/src/soplex/external/zstr/License.txt DESTINATION ${CMAKE_INSTALL_DATADIR}/licenses/soplex/zstr)
182186

183187
# install the binary and the library to appropriate lcoations and add them to an export group
184188
-install(TARGETS soplex libsoplex libsoplex-pic libsoplexshared EXPORT soplex-targets
185189
+if(SOPLEX_SOPLEX)
186-
+ install(TARGETS soplex
187-
+ EXPORT soplex-targets
190+
+ install(TARGETS soplex EXPORT soplex-targets
188191
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
192+
+
193+
+ if(MSVC)
194+
+ install(FILES $<TARGET_PDB_FILE:soplex> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
195+
+ endif()
189196
+endif()
190197
+
191198
+install(TARGETS libsoplex libsoplex-pic libsoplexshared EXPORT soplex-targets
192-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
193-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
194-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
195-
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
199+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
200+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
201+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
202+
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
203+
204+
if(MSVC)
205+
- install(FILES $<TARGET_PDB_FILE:libsoplexshared> $<TARGET_PDB_FILE:soplex> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
206+
+ install(FILES $<TARGET_PDB_FILE:libsoplexshared> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
207+
endif()
208+
209+
# install license files of soplex and fmt
210+
@@ -258,8 +271,10 @@ install(FILES ${PROJECT_SOURCE_DIR}/LICENSE DESTINATION ${CMAKE_INSTALL_DATADIR}
211+
install(FILES ${PROJECT_SOURCE_DIR}/src/soplex/external/fmt/LICENSE.rst DESTINATION ${CMAKE_INSTALL_DATADIR}/licenses/soplex/fmt)
196212

197213
# Add library targets to the build-tree export set
198214
-export(TARGETS libsoplex libsoplex-pic libsoplexshared

0 commit comments

Comments
 (0)