Skip to content

[SCIP, SCIP_PaPILO] use bliss_jll and enable boost #6054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions S/SCIP/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
using BinaryBuilder, Pkg

name = "SCIP"
version = v"800.0.300"
version = v"800.0.301"

# Collection of sources required to complete build
sources = [
ArchiveSource("https://scipopt.org/download/release/scipoptsuite-8.0.3.tgz", "5ad50eb42254c825d96f5747d8f3568dcbff0284dfbd1a727910c5a7c2899091"),
DirectorySource("./bundled"),
]

# Bash recipe for building across all platforms
Expand All @@ -17,9 +18,15 @@ script = raw"""
# remove when CMake accounts for this
if [[ "${target}" == *86*-linux-gnu ]]; then
export LDFLAGS="-lrt"
elif [[ "${target}" == *-mingw* ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this tested on windows? So far I've never managed to have the windows binaries work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change the linker would complain that it can't find bliss. I did not test it on Windows but I can give it a try in a VM later today.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is optional of course, but if it resolves the problem that would be fantastic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem to change anything, I get the same crashes on Windows (without any meaningful backtrace) when using the current SCIP_jll and with my new binaries.

# this is required to link to bliss on mingw
export LDFLAGS=-L${libdir}
fi

cd scipoptsuite*

atomic_patch -p1 ${WORKSPACE}/srcdir/patches/findbliss.patch

mkdir build
cd build/
cmake -DCMAKE_INSTALL_PREFIX=$prefix\
Expand All @@ -30,10 +37,14 @@ cmake -DCMAKE_INSTALL_PREFIX=$prefix\
-DGCG=0\
-DUG=0\
-DAMPL=0\
-DBOOST=off\
-DBOOST=ON\
-DSYM=bliss\
-DTPI=tny\
-DIPOPT_DIR=${prefix} -DIPOPT_LIBRARIES=${libdir} ..
-DIPOPT_DIR=${prefix} \
-DIPOPT_LIBRARIES=${libdir} \
-DBLISS_INCLUDE_DIR=${includedir} \
-DBLISS_LIBRARY=bliss \
..
make -j${nproc}
make install

Expand Down
41 changes: 41 additions & 0 deletions S/SCIP/bundled/patches/findbliss.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/scip/CMakeLists.txt b/scip/CMakeLists.txt
index f7831d9ce8..54915b438f 100644
--- a/scip/CMakeLists.txt
+++ b/scip/CMakeLists.txt
@@ -125,24 +125,18 @@ unset(BLISS_TARGET)
if(SYM STREQUAL "bliss")
message(STATUS "Support SYM: bliss")
set(sym symmetry/compute_symmetry_bliss.cpp)
-
- # modify configuration for bliss
- set(BUILD_SHARED_LIBS OFF)
- set(TMPFLAGS ${CMAKE_C_FLAGS})
- set(TMXFLAGS ${CMAKE_CXX_FLAGS})
- set(CMAKE_C_FLAGS -w)
- set(CMAKE_CXX_FLAGS -w)
-
- add_subdirectory(src/bliss)
-
- # undo modification
- set(CMAKE_C_FLAGS ${TMPFLAGS})
- set(CMAKE_CXX_FLAGS ${TMXFLAGS})
- set(BUILD_SHARED_LIBS ${SHARED})
-
- set(BLISS_TARGET libbliss)
- set(SYM_LIBRARIES libbliss)
- set(SYM_PIC_LIBRARIES libbliss)
+ find_package(BLISS)
+ if(BLISS_FOUND)
+ message(STATUS "BLISS found")
+ include_directories(${BLISS_INCLUDE_DIRS})
+ set(SYM_LIBRARIES ${BLISS_LIBRARIES})
+ set(SYM_PIC_LIBRARIES ${BLISS_LIBRARIES})
+ if(BLISS_DEFINITIONS STREQUAL "")
+ add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${BLISS_DEFINITIONS}>")
+ endif()
+ else()
+ message(FATAL_ERROR "BLISS not found, not using vendored BLISS")
+ endif()
elseif(SYM STREQUAL "none")
message(STATUS "Support SYM: OFF")
set(sym symmetry/compute_symmetry_none.cpp)
13 changes: 11 additions & 2 deletions S/SCIP_PaPILO/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ using BinaryBuilder, Pkg

name = "SCIP_PaPILO"

version = v"800.0.300"
version = v"800.0.301"

sources = [
ArchiveSource("https://scipopt.org/download/release/scipoptsuite-8.0.3.tgz", "5ad50eb42254c825d96f5747d8f3568dcbff0284dfbd1a727910c5a7c2899091"),
DirectorySource("./bundled"),
]

# Bash recipe for building across all platforms
script = raw"""
cd scipoptsuite*

atomic_patch -p1 ${WORKSPACE}/srcdir/patches/findbliss.patch

mkdir build
cd build/
cmake -DCMAKE_INSTALL_PREFIX=$prefix\
Expand All @@ -22,9 +26,14 @@ cmake -DCMAKE_INSTALL_PREFIX=$prefix\
-DUG=0\
-DAMPL=0\
-DGCG=0\
-DBOOST=ON\
-DSYM=bliss\
-DTPI=tny\
-DIPOPT_DIR=${prefix} -DIPOPT_LIBRARIES=${libdir} ..
-DIPOPT_DIR=${prefix} \
-DIPOPT_LIBRARIES=${libdir} \
-DBLISS_INCLUDE_DIR=${includedir} \
-DBLISS_LIBRARY=bliss \
..
make -j${nproc} scip
make papilo-executable

Expand Down
41 changes: 41 additions & 0 deletions S/SCIP_PaPILO/bundled/patches/findbliss.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/scip/CMakeLists.txt b/scip/CMakeLists.txt
index f7831d9ce8..54915b438f 100644
--- a/scip/CMakeLists.txt
+++ b/scip/CMakeLists.txt
@@ -125,24 +125,18 @@ unset(BLISS_TARGET)
if(SYM STREQUAL "bliss")
message(STATUS "Support SYM: bliss")
set(sym symmetry/compute_symmetry_bliss.cpp)
-
- # modify configuration for bliss
- set(BUILD_SHARED_LIBS OFF)
- set(TMPFLAGS ${CMAKE_C_FLAGS})
- set(TMXFLAGS ${CMAKE_CXX_FLAGS})
- set(CMAKE_C_FLAGS -w)
- set(CMAKE_CXX_FLAGS -w)
-
- add_subdirectory(src/bliss)
-
- # undo modification
- set(CMAKE_C_FLAGS ${TMPFLAGS})
- set(CMAKE_CXX_FLAGS ${TMXFLAGS})
- set(BUILD_SHARED_LIBS ${SHARED})
-
- set(BLISS_TARGET libbliss)
- set(SYM_LIBRARIES libbliss)
- set(SYM_PIC_LIBRARIES libbliss)
+ find_package(BLISS)
+ if(BLISS_FOUND)
+ message(STATUS "BLISS found")
+ include_directories(${BLISS_INCLUDE_DIRS})
+ set(SYM_LIBRARIES ${BLISS_LIBRARIES})
+ set(SYM_PIC_LIBRARIES ${BLISS_LIBRARIES})
+ if(BLISS_DEFINITIONS STREQUAL "")
+ add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${BLISS_DEFINITIONS}>")
+ endif()
+ else()
+ message(FATAL_ERROR "BLISS not found, not using vendored BLISS")
+ endif()
elseif(SYM STREQUAL "none")
message(STATUS "Support SYM: OFF")
set(sym symmetry/compute_symmetry_none.cpp)