-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
293 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module( | ||
name = "scip", | ||
version = "9.2.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", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
+) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "9.2.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", | ||
+) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=9.2.0\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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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//...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"url": "https://github.com/scipopt/scip/archive/refs/tags/v920.tar.gz", | ||
"integrity": "sha256-a22dc20f44e99bfec071889fd5af2bfc57c4af14b76d777d1312006616346f7c=", | ||
"strip_prefix": "scip-920", | ||
"patches": { | ||
"scip.patch": "sha256-c67e7cf41c7dc420f60ea00b08e2cb8d2f0a2fef51cb321d573119d0bf5b9193=", | ||
"add_build_file.patch": "sha256-5f076910e3a32cdd0aaaedde707f851d1cdef48e4aaad8223f51be0d81340f71=", | ||
"module_dot_bazel.patch": "sha256-b64196a7a4dbd6963cbcba932c4853eeeedced8dd8a39184b9f59c6a312cdb58=" | ||
}, | ||
"patch_strip": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
], | ||
"versions": [ | ||
"8.1.0" | ||
"9.2.0" | ||
], | ||
"yanked_versions": {} | ||
} |