Skip to content

Commit

Permalink
scip@8.1.0 (#1955)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmorel-35 committed May 6, 2024
1 parent 0864be7 commit 8e1302e
Show file tree
Hide file tree
Showing 7 changed files with 308 additions and 0 deletions.
18 changes: 18 additions & 0 deletions modules/scip/8.1.0/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module(
name = "scip",
version = "8.1.0",
compatibility_level = 1,
)

bazel_dep(
name = "bliss",
version = "0.73",
)
bazel_dep(
name = "platforms",
version = "0.0.9",
)
bazel_dep(
name = "zlib",
version = "1.2.13",
)
140 changes: 140 additions & 0 deletions modules/scip/8.1.0/patches/add_build_file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
--- /dev/null
+++ a/BUILD.bazel
@@ -0,0 +1,137 @@
+# Copyright 2010-2024 Google LLC
+# 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.
+
+exports_files(
+ ["src/lpi/lpi_glop.cpp"],
+)
+
+config_setting(
+ name = "on_linux",
+ constraint_values = [
+ "@platforms//os:linux",
+ ],
+)
+
+config_setting(
+ name = "on_macos",
+ constraint_values = [
+ "@platforms//os:macos",
+ ],
+)
+
+config_setting(
+ name = "on_windows",
+ constraint_values = [
+ "@platforms//os:windows",
+ ],
+)
+
+PLATFORM_FLAGS = select({
+ "on_linux": [
+ "-Wunknown-pragmas",
+ "-fexceptions",
+ "-DSYM=bliss",
+ ],
+ "on_macos": [
+ "-Wunknown-pragmas",
+ "-fexceptions",
+ "-DSYM=bliss",
+ ],
+ "on_windows": [
+ "/DSYM=none",
+ "/DSCIP_NO_SIGACTION",
+ "/DSCIP_NO_STRTOK_R",
+ ],
+ "//conditions:default": [],
+})
+
+PLATFORM_DEPS = select({
+ "on_linux": ["@bliss"],
+ "on_macos": ["@bliss"],
+ "on_windows": [],
+ "//conditions:default": [],
+})
+
+BLISS_FILE = select({
+ "on_linux": ["src/symmetry/compute_symmetry_bliss.cpp"],
+ "on_macos": ["src/symmetry/compute_symmetry_bliss.cpp"],
+ "on_windows": ["src/symmetry/compute_symmetry_none.cpp"],
+ "//conditions:default": ["src/symmetry/compute_symmetry_none.cpp"],
+})
+
+cc_library(
+ name = "scip",
+ srcs = glob(
+ [
+ "src/*/*.c",
+ ],
+ exclude = [
+ "src/lpi/lpi_*.c",
+ "src/nauty/*",
+ "src/scip/exprinterpret_*.c",
+ "src/scip/nlpi_filtersqp.c",
+ "src/scip/nlpi_worhp.c",
+ "src/scip/*_xyz.c",
+ "src/scip/sorttpl.c",
+ "src/symmetry/compute_symmetry_*.cpp",
+ "src/symmetry/*nauty*",
+ "src/tpi/tpi_*.c",
+ ],
+ ) + BLISS_FILE + [
+ "src/scip/exprinterpret_none.c",
+ "src/tpi/tpi_tnycthrd.c",
+ ],
+ hdrs = glob(
+ [
+ "src/*/*.h",
+ "src/*/*.hpp",
+ "src/scip/githash.c",
+ "src/scip/sorttpl.c",
+ "src/scip/buildflags.c",
+ ],
+ exclude =
+ [
+ "src/scip/*_xyz.h",
+ ],
+ ),
+ copts = [
+ "$(STACK_FRAME_UNLIMITED)", # src/scip/reader_cnf.c
+ "-DSCIP_WITH_ZLIB",
+ "-DWITH_SCIPDEF",
+ "-DSCIP_ROUNDING_FE",
+ "-DTPI_TNY", # src/tpi/type_tpi_tnycthrd.h
+ # Compile in thead-safe mode (required since we use TPI_TNYC). Note,
+ # one does not technically need to add this, as SCIP code always
+ # uses syntax like "#ifndef NPARASCIP". But let's be explicit here.
+ "-DPARASCIP",
+ "-Isrc",
+ "-Isrc/scip",
+ ] + PLATFORM_FLAGS,
+ defines = [
+ # Scip v800 optionally depends on scip/config.h and
+ # scip/scip_export.h that are generated by build system.
+ #
+ # We need every library and binary that depends on SCIP libraries to
+ # define this macro. That is why we use `defines' here instead of
+ # `copts' or `local_defines'.
+ "NO_CONFIG_HEADER",
+ ],
+ features = ["-parse_headers"],
+ includes = [
+ "src",
+ ],
+ visibility = ["//visibility:public"],
+ deps = [
+ "@zlib",
+ ] + PLATFORM_DEPS,
+)
21 changes: 21 additions & 0 deletions modules/scip/8.1.0/patches/module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- a/MODULE.bazel
+++ a/MODULE.bazel
@@ -0,0 +1,18 @@
+module(
+ name = "scip",
+ version = "8.1.0",
+ compatibility_level = 1,
+)
+
+bazel_dep(
+ name = "bliss",
+ version = "0.73",
+)
+bazel_dep(
+ name = "platforms",
+ version = "0.0.9",
+)
+bazel_dep(
+ name = "zlib",
+ version = "1.2.13",
+)
85 changes: 85 additions & 0 deletions modules/scip/8.1.0/patches/scip.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
diff --git a/src/lpi/lpi_glop.cpp b/src/lpi/lpi_glop.cpp
index 2471778a8f..673e9689e9 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/githash.c b/src/scip/githash.c
new file mode 100644
index 0000000000..d1e99c662d
--- /dev/null
+++ b/src/scip/githash.c
@@ -0,0 +1 @@
+#define SCIP_GITHASH "a740f0891e"
\ No newline at end of file
diff --git a/src/scip/scipbuildflags.c b/src/scip/scipbuildflags.c
index af5c5481bb..080cac87dc 100644
--- a/src/scip/scipbuildflags.c
+++ b/src/scip/scipbuildflags.c
@@ -30,10 +30,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/src/symmetry/compute_symmetry_bliss.cpp b/src/symmetry/compute_symmetry_bliss.cpp
index 26117a8026..2f164d133b 100644
--- a/src/symmetry/compute_symmetry_bliss.cpp
+++ b/src/symmetry/compute_symmetry_bliss.cpp
@@ -34,8 +34,8 @@
#include "compute_symmetry.h"

/* include bliss graph */
-#include <bliss/defs.hh>
-#include <bliss/graph.hh>
+#include <defs.hh>
+#include <graph.hh>

#include <string.h>
#include <vector>
17 changes: 17 additions & 0 deletions modules/scip/8.1.0/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
matrix:
platform:
- debian10
- ubuntu2004
- macos
- macos_arm64
- windows
bazel:
- 7.x
- 6.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@scip//...'
11 changes: 11 additions & 0 deletions modules/scip/8.1.0/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"url": "https://github.com/scipopt/scip/archive/refs/tags/v810.tar.gz",
"integrity": "sha256-ttr1TDfQJWSxL7Muw7t6EFcQ6wAmrer8YCr0Q1+pRoU=",
"strip_prefix": "scip-810",
"patches": {
"scip.patch": "sha256-5GXyhzZXAn9Bn3REmqbY2wqxCeDH5C2AQtYnIfdsUH8=",
"add_build_file.patch": "sha256-XwdpEOOjLN0Kqu3ecH+FHRze9I5KqtgiP1G+DYE0D3E=",
"module_dot_bazel.patch": "sha256-R/oIdQ/qxVQlLxse1/monca0AhR8ZSsQHJrjrDSPa2k="
},
"patch_strip": 1
}
16 changes: 16 additions & 0 deletions modules/scip/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"homepage": "https://github.com/scipopt/scip",
"maintainers": [
{
"email": "bcr-maintainers@bazel.build",
"name": "No Maintainer Specified"
}
],
"repository": [
"github:scipopt/scip"
],
"versions": [
"8.1.0"
],
"yanked_versions": {}
}

0 comments on commit 8e1302e

Please sign in to comment.