diff --git a/Dependencies.txt b/Dependencies.txt index fea7be5644..c29527b25e 100644 --- a/Dependencies.txt +++ b/Dependencies.txt @@ -9,7 +9,7 @@ Cgl=0.60.5 Cbc=2.10.7 GLPK=5.0 HiGHS=v1.6.0 -Scip=v810 +Scip=v900 # Python pybind11=v2.11.1 pybind11_abseil=52f2739 diff --git a/WORKSPACE b/WORKSPACE index 2fec7dbcb5..c43d336172 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -129,9 +129,9 @@ http_archive( new_git_repository( name = "scip", build_file = "//bazel:scip.BUILD.bazel", - patches = ["//bazel:scip.patch"], + patches = ["//bazel:scip-v900.patch"], patch_args = ["-p1"], - tag = "v810", + tag = "v900", remote = "https://github.com/scipopt/scip.git", ) diff --git a/bazel/BUILD.bazel b/bazel/BUILD.bazel index 5a5b1a7416..21a00f04ab 100644 --- a/bazel/BUILD.bazel +++ b/bazel/BUILD.bazel @@ -14,22 +14,19 @@ load("@rules_python//python:pip.bzl", "compile_pip_requirements") exports_files([ - "gtest.BUILD", - "glpk.BUILD", - "pcre2.BUILD", - "pcre2.patch", - "re2.patch", - "scip.BUILD", - "scip.patch", - "swig.BUILD", - "swig.patch", - "bliss.BUILD", - "bliss-0.73.patch", "archive_helper.bzl", + "bliss-0.73.patch", + "bliss.BUILD.bazel", + "glpk.BUILD.bazel", "notebook_requirements.in", "notebook_requirements.txt", "ortools_requirements.in", "ortools_requirements.txt", + "pcre2.BUILD.bazel", + "scip-v900.patch", + "scip.BUILD.bazel", + "swig.BUILD.bazel", + "swig.patch", ]) compile_pip_requirements( diff --git a/bazel/scip-v900.patch b/bazel/scip-v900.patch new file mode 100644 index 0000000000..fb82f42a48 --- /dev/null +++ b/bazel/scip-v900.patch @@ -0,0 +1,225 @@ +diff --git a/src/lpi/lpi_glop.cpp b/src/lpi/lpi_glop.cpp +index a90120188a..664cb4d097 100644 +--- a/src/lpi/lpi_glop.cpp ++++ b/src/lpi/lpi_glop.cpp +@@ -51,7 +51,6 @@ + #include "ortools/util/time_limit.h" + + #include "ortools/base/logging.h" +-#include "ortools/base/vlog_is_on.h" + + #include "lpi/lpi.h" + #include "scip/pub_message.h" +@@ -2942,12 +2941,12 @@ SCIP_RETCODE SCIPlpiSetIntpar( + SCIPdebugMessage("SCIPlpiSetIntpar: SCIP_LPPAR_LPINFO -> %d.\n", ival); + if ( ival == 0 ) + { +- (void) google::SetVLOGLevel("*", google::GLOG_INFO); ++ absl::SetFlag(&FLAGS_stderrthreshold, 2); + lpi->lp_info = false; + } + else + { +- (void) google::SetVLOGLevel("*", google::GLOG_ERROR); ++ absl::SetFlag(&FLAGS_stderrthreshold, 0); + lpi->lp_info = true; + } + break; +@@ -3190,7 +3189,7 @@ SCIP_RETCODE SCIPlpiReadLP( + + const std::string filespec(fname); + MPModelProto proto; +- if ( ! ReadFileToProto(filespec, &proto) ) ++ if ( ! ReadFileToProto(filespec, &proto).ok() ) + { + SCIPerrorMessage("Could not read <%s>\n", fname); + return SCIP_READERROR; +@@ -3214,7 +3213,7 @@ SCIP_RETCODE SCIPlpiWriteLP( + MPModelProto proto; + LinearProgramToMPModelProto(*lpi->linear_program, &proto); + const std::string filespec(fname); +- if ( ! WriteProtoToFile(filespec, proto, operations_research::ProtoWriteFormat::kProtoText, true) ) ++ if ( ! WriteProtoToFile(filespec, proto, operations_research::ProtoWriteFormat::kProtoText, true).ok() ) + { + SCIPerrorMessage("Could not write <%s>\n", fname); + return SCIP_READERROR; +diff --git a/src/scip/config.h b/src/scip/config.h +new file mode 100644 +index 0000000000..871fde8e55 +--- /dev/null ++++ b/src/scip/config.h +@@ -0,0 +1,32 @@ ++#ifndef __CONFIG_H__ ++#define __CONFIG_H__ ++ ++#define CMAKE_BUILD_TYPE "Release" ++#define SCIP_VERSION_MAJOR 9 ++#define SCIP_VERSION_MINOR 0 ++#define SCIP_VERSION_PATCH 0 ++#define SCIP_VERSION_SUB 0 ++#define SCIP_VERSION_API 114 ++/* #undef BMS_NOBLOCKMEM */ ++/* #undef SCIP_NOBUFFERMEM */ ++/* #undef WITH_DEBUG_SOLUTION */ ++/* #undef SCIP_NO_SIGACTION */ ++/* #undef SCIP_NO_STRTOK_R */ ++/* #undef TPI_NONE */ ++#define TPI_TNY ++/* #undef TPI_OMP */ ++#define SCIP_THREADSAFE ++#define WITH_SCIPDEF ++/* #undef SCIP_WITH_LAPACK */ ++/* #undef SCIP_WITH_PAPILO */ ++/* #undef SCIP_WITH_ZLIB */ ++/* #undef SCIP_WITH_READLINE */ ++/* #undef SCIP_WITH_GMP */ ++/* #undef SCIP_WITH_LPSCHECK */ ++/* #undef SCIP_WITH_ZIMPL */ ++/* #undef SCIP_WITH_AMPL */ ++#define SCIP_ROUNDING_FE ++/* #undef SCIP_ROUNDING_FP */ ++/* #undef SCIP_ROUNDING_MS */ ++ ++#endif +diff --git a/src/scip/githash.c b/src/scip/githash.c +new file mode 100644 +index 0000000000..4b1dfc587f +--- /dev/null ++++ b/src/scip/githash.c +@@ -0,0 +1 @@ ++#define SCIP_GITHASH "7205bedd94" +diff --git a/src/scip/scip_export.h b/src/scip/scip_export.h +new file mode 100644 +index 0000000000..8bf2aaefa5 +--- /dev/null ++++ b/src/scip/scip_export.h +@@ -0,0 +1,42 @@ ++ ++#ifndef SCIP_EXPORT_H ++#define SCIP_EXPORT_H ++ ++#ifdef SCIP_STATIC_DEFINE ++# define SCIP_EXPORT ++# define SCIP_NO_EXPORT ++#else ++# ifndef SCIP_EXPORT ++# ifdef libscip_EXPORTS ++/* We are building this library */ ++# define SCIP_EXPORT ++# else ++/* We are using this library */ ++# define SCIP_EXPORT ++# endif ++# endif ++ ++# ifndef SCIP_NO_EXPORT ++# define SCIP_NO_EXPORT ++# endif ++#endif ++ ++#ifndef SCIP_DEPRECATED ++# define SCIP_DEPRECATED __attribute__ ((__deprecated__)) ++#endif ++ ++#ifndef SCIP_DEPRECATED_EXPORT ++# define SCIP_DEPRECATED_EXPORT SCIP_EXPORT SCIP_DEPRECATED ++#endif ++ ++#ifndef SCIP_DEPRECATED_NO_EXPORT ++# define SCIP_DEPRECATED_NO_EXPORT SCIP_NO_EXPORT SCIP_DEPRECATED ++#endif ++ ++#if 0 /* DEFINE_NO_DEPRECATED */ ++# ifndef SCIP_NO_DEPRECATED ++# define SCIP_NO_DEPRECATED ++# endif ++#endif ++ ++#endif /* SCIP_EXPORT_H */ +diff --git a/src/scip/scipbuildflag.c b/src/scip/scipbuildflag.c +new file mode 100644 +index 0000000000..2af785150e +--- /dev/null ++++ b/src/scip/scipbuildflag.c +@@ -0,0 +1,65 @@ ++/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ ++/* */ ++/* This file is part of the program and library */ ++/* SCIP --- Solving Constraint Integer Programs */ ++/* */ ++/* Copyright (c) 2002-2024 Zuse Institute Berlin (ZIB) */ ++/* */ ++/* Licensed under the Apache License, Version 2.0 (the "License"); */ ++/* you may not use this file except in compliance with the License. */ ++/* You may obtain a copy of the License at */ ++/* */ ++/* http://www.apache.org/licenses/LICENSE-2.0 */ ++/* */ ++/* Unless required by applicable law or agreed to in writing, software */ ++/* distributed under the License is distributed on an "AS IS" BASIS, */ ++/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ ++/* See the License for the specific language governing permissions and */ ++/* limitations under the License. */ ++/* */ ++/* You should have received a copy of the Apache-2.0 license */ ++/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */ ++/* */ ++/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ ++ ++/**@file scipbuildflags.c ++ * @brief build flags methods ++ * @author Felipe Serrano ++ */ ++ ++/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ ++ ++#include "scip/scipbuildflags.h" ++ ++/** returns the flags that were used to build SCIP */ ++const char* SCIPgetBuildFlags( ++ void ++ ) ++{ ++ return " ARCH=x86_64\n\ ++ OSTYPE=Linux-6.7.5-arch1-1\n\ ++ COMP=GNU 13.2.1\n\ ++ BUILD=Release\n\ ++ DEBUGSOL=OFF\n\ ++ EXPRINT=none\n\ ++ SYM=none\n\ ++ GMP=OFF\n\ ++ IPOPT=OFF\n\ ++ WORHP=OFF\n\ ++ LPS=none\n\ ++ LPSCHECK=OFF\n\ ++ NOBLKBUFMEM=OFF\n\ ++ NOBLKMEM=OFF\n\ ++ NOBUFMEM=OFF\n\ ++ THREADSAFE=ON;FORCE\n\ ++ READLINE=OFF\n\ ++ SANITIZE_ADDRESS=OFF\n\ ++ SANITIZE_MEMORY=OFF\n\ ++ SANITIZE_UNDEFINED=OFF\n\ ++ SANITIZE_THREAD=OFF\n\ ++ SHARED=OFF\n\ ++ VERSION=9.0.0.0\n\ ++ API_VERSION=114\n\ ++ ZIMPL=OFF\n\ ++ ZLIB=ON"; ++} +diff --git a/src/symmetry/compute_symmetry_bliss.cpp b/src/symmetry/compute_symmetry_bliss.cpp +index 0ba5ea060e..10570448a0 100644 +--- a/src/symmetry/compute_symmetry_bliss.cpp ++++ b/src/symmetry/compute_symmetry_bliss.cpp +@@ -34,8 +34,9 @@ + #include "compute_symmetry.h" + + /* include bliss graph */ +-#include +-#include ++#define BLISS_VERSION "0.73" ++#include ++#include + + #include + #include diff --git a/bazel/scip.BUILD.bazel b/bazel/scip.BUILD.bazel index 6b11d719e5..d31e346730 100644 --- a/bazel/scip.BUILD.bazel +++ b/bazel/scip.BUILD.bazel @@ -82,6 +82,7 @@ cc_library( "src/scip/nlpi_filtersqp.c", "src/scip/nlpi_worhp.c", "src/scip/*_xyz.c", + "src/scip/scipbuildflags.c", "src/scip/sorttpl.c", "src/symmetry/compute_symmetry_*.cpp", "src/symmetry/*nauty*", @@ -97,7 +98,6 @@ cc_library( "src/*/*.hpp", "src/scip/githash.c", "src/scip/sorttpl.c", - "src/scip/buildflags.c", ], exclude = [ diff --git a/bazel/scip.patch b/bazel/scip.patch deleted file mode 100644 index 03e6c58e7d..0000000000 --- a/bazel/scip.patch +++ /dev/null @@ -1,85 +0,0 @@ -diff --git a/src/lpi/lpi_glop.cpp b/src/lpi/lpi_glop.cpp -index 2471778a8f..17fd1e8c34 100644 ---- a/src/lpi/lpi_glop.cpp -+++ b/src/lpi/lpi_glop.cpp -@@ -51,7 +51,6 @@ - #include "ortools/util/time_limit.h" - - #include "ortools/base/logging.h" --#include "ortools/base/vlog_is_on.h" - - #include "lpi/lpi.h" - #include "scip/pub_message.h" -@@ -2942,12 +2941,12 @@ SCIP_RETCODE SCIPlpiSetIntpar( - SCIPdebugMessage("SCIPlpiSetIntpar: SCIP_LPPAR_LPINFO -> %d.\n", ival); - if ( ival == 0 ) - { -- (void) google::SetVLOGLevel("*", google::GLOG_INFO); -+ absl::SetFlag(&FLAGS_stderrthreshold, 2); - lpi->lp_info = false; - } - else - { -- (void) google::SetVLOGLevel("*", google::GLOG_ERROR); -+ absl::SetFlag(&FLAGS_stderrthreshold, 0); - lpi->lp_info = true; - } - break; -@@ -3190,7 +3189,7 @@ SCIP_RETCODE SCIPlpiReadLP( - - const std::string filespec(fname); - MPModelProto proto; -- if ( ! ReadFileToProto(filespec, &proto) ) -+ if ( ! ReadFileToProto(filespec, &proto).ok() ) - { - SCIPerrorMessage("Could not read <%s>\n", fname); - return SCIP_READERROR; -@@ -3214,7 +3213,7 @@ SCIP_RETCODE SCIPlpiWriteLP( - MPModelProto proto; - LinearProgramToMPModelProto(*lpi->linear_program, &proto); - const std::string filespec(fname); -- if ( ! WriteProtoToFile(filespec, proto, operations_research::ProtoWriteFormat::kProtoText, true) ) -+ if ( ! WriteProtoToFile(filespec, proto, operations_research::ProtoWriteFormat::kProtoText, true).ok() ) - { - SCIPerrorMessage("Could not write <%s>\n", fname); - return SCIP_READERROR; -diff --git a/src/symmetry/compute_symmetry_bliss.cpp b/src/symmetry/compute_symmetry_bliss.cpp -index 484627c4b9..27c2895165 100644 ---- a/src/symmetry/compute_symmetry_bliss.cpp -+++ b/src/symmetry/compute_symmetry_bliss.cpp -@@ -25,5 +25,5 @@ - #include "compute_symmetry.h" - - /* include bliss graph */ --#include --#include -+#include -+#include - - #include - #include - -diff --git a/src/scip/githash.c b/src/scip/githash.c -new file mode 100644 -index 0000000000..2891bc72de ---- /dev/null -+++ b/src/scip/githash.c -@@ -0,0 +1,1 @@ -+#define SCIP_GITHASH "a740f0891e" -diff --git a/src/scip/scipbuildflags.c b/src/scip/scipbuildflags.c -index b54b9112cb..dc8e62b5e0 100644 ---- a/src/scip/scipbuildflags.c -+++ b/src/scip/scipbuildflags.c -@@ -21,10 +21,9 @@ - - /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ - -+#define SCIP_BUILDFLAGS " ARCH=x86_64\n COMP=gnu\n DEBUGSOL=false\n EXPRINT=none\n GAMS=false\n SYM=bliss\n GMP=false\n IPOPT=false\n IPOPTOPT=opt\n WORHP=false\n WORHPOPT=opt\n LPS=spx2\n LPSCHECK=false\n LPSOPT=opt\n NOBLKBUFMEM=false\n NOBLKMEM=false\n NOBUFMEM=false\n OPT=opt\n OSTYPE=linux\n PARASCIP=true\n READLINE=false\n SANITIZE=\n SHARED=false\n USRARFLAGS=\n USRCFLAGS=-fPIC\n USRCXXFLAGS=-fPIC\n USRDFLAGS=\n USRFLAGS=\n USRLDFLAGS=\n USROFLAGS=\n VERSION=7.0.1\n ZIMPL=false\n ZIMPLOPT=opt\n ZLIB=true" -+ - #include "scip/scipbuildflags.h" --#ifdef NO_CONFIG_HEADER --#include "buildflags.c" --#endif - - /** returns the flags that were used to build SCIP */ - const char* SCIPgetBuildFlags( diff --git a/cmake/dependencies/CMakeLists.txt b/cmake/dependencies/CMakeLists.txt index 3ee30fe20b..8688677a37 100644 --- a/cmake/dependencies/CMakeLists.txt +++ b/cmake/dependencies/CMakeLists.txt @@ -263,8 +263,8 @@ if(BUILD_SCIP) FetchContent_Declare( scip GIT_REPOSITORY "https://github.com/scipopt/scip.git" - GIT_TAG "v810" - PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/scip-v810.patch" + GIT_TAG "v900" + PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/scip-v900.patch" ) FetchContent_MakeAvailable(scip) set(LPI_GLOP_SRC ${scip_SOURCE_DIR}/src/lpi/lpi_glop.cpp PARENT_SCOPE) diff --git a/patches/scip-v810.patch b/patches/scip-v900.patch similarity index 94% rename from patches/scip-v810.patch rename to patches/scip-v900.patch index 6190e20eec..628716d38c 100644 --- a/patches/scip-v810.patch +++ b/patches/scip-v900.patch @@ -1,5 +1,5 @@ diff --git a/src/lpi/lpi_glop.cpp b/src/lpi/lpi_glop.cpp -index 2471778a8f..3326ac7292 100644 +index a90120188a..2c068e5e30 100644 --- a/src/lpi/lpi_glop.cpp +++ b/src/lpi/lpi_glop.cpp @@ -51,7 +51,6 @@ @@ -15,7 +15,7 @@ index 2471778a8f..3326ac7292 100644 if ( ival == 0 ) { - (void) google::SetVLOGLevel("*", google::GLOG_INFO); -+ absl::SetFlag(&FLAGS_stderrthreshold, 2); ++ absl::SetFlag(&FLAGS_stderrthreshold, 2); lpi->lp_info = false; } else