diff --git a/bazel/scip.BUILD b/bazel/scip.BUILD index afe2f723c8..240391d2a7 100644 --- a/bazel/scip.BUILD +++ b/bazel/scip.BUILD @@ -2,6 +2,48 @@ 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"], + "//conditions:default": [], +}) + +PLATFORM_DEPS = select({ + "on_linux": [ "@bliss//:libbliss",], + "on_macos": [ "@bliss//:libbliss",], + "on_windows": ["@zlib//:zlib"], + "//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 = "libscip", srcs = glob( @@ -18,9 +60,7 @@ cc_library( "src/symmetry/compute_symmetry_*.cpp", "src/tpi/tpi_*.c", ], - ) + [ - #"src/symmetry/compute_symmetry_none.cpp", - "src/symmetry/compute_symmetry_bliss.cpp", + ) + BLISS_FILE + [ "src/nlpi/exprinterpret_none.c", "src/tpi/tpi_tnycthrd.c", ], @@ -37,22 +77,18 @@ cc_library( #"src/scip/prop_symmetry.h", ]), copts = [ - "-Wunknown-pragmas", - "-fexceptions", "$(STACK_FRAME_UNLIMITED)", # src/scip/reader_cnf.c "-DSCIP_WITH_ZLIB", "-DWITH_SCIPDEF", "-DSCIP_ROUNDING_FE", "-DTPI_TNYC", # src/tpi/type_tpi_tnycthrd.h - #"-DSYM=none", - "-DSYM=bliss", # 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 7.0.1 optionally depends on scip/config.h and # scip/scip_export.h that are generated by build system. @@ -69,6 +105,5 @@ cc_library( visibility = ["//visibility:public"], deps = [ #"@cppad:cppad_includes", - "@bliss//:libbliss", - ], + ] + PLATFORM_DEPS, ) diff --git a/bazel/scip.patch b/bazel/scip.patch index f34a466d5f..e1e59a7ba3 100644 --- a/bazel/scip.patch +++ b/bazel/scip.patch @@ -27,3 +27,221 @@ index db734cb18..2fda08fd4 100644 #include #include + +diff --git a/src/nlpi/nlpi_xyz.c b/src/nlpi/nlpi_xyz.c +index c66511862a..3058216088 100644 +--- src/nlpi/nlpi_xyz.c ++++ src/nlpi/nlpi_xyz.c +@@ -43,12 +43,14 @@ + + struct SCIP_NlpiData + { ++ void* ptr; + }; + + /* TODO: fill in the necessary NLP problem instance data */ + + struct SCIP_NlpiProblem + { ++ void* ptr; + }; + + +diff --git a/src/scip/benders_xyz.c b/src/scip/benders_xyz.c +index b3a2b710f0..e3e8397ff5 100644 +--- src/scip/benders_xyz.c ++++ src/scip/benders_xyz.c +@@ -47,6 +47,7 @@ + /** Benders' decomposition data */ + struct SCIP_BendersData + { ++ void* ptr; + }; + + +diff --git a/src/scip/benderscut_xyz.c b/src/scip/benderscut_xyz.c +index 394685e225..0c08fe8b84 100644 +--- src/scip/benderscut_xyz.c ++++ src/scip/benderscut_xyz.c +@@ -41,6 +41,7 @@ + /** Benders' decomposition cut data */ + struct SCIP_BenderscutData + { ++ void* ptr; + }; + + +diff --git a/src/scip/branch_xyz.c b/src/scip/branch_xyz.c +index a5e7f0f9a2..4970df6cce 100644 +--- src/scip/branch_xyz.c ++++ src/scip/branch_xyz.c +@@ -42,6 +42,7 @@ + /** branching rule data */ + struct SCIP_BranchruleData + { ++ void* ptr; + }; + + +diff --git a/src/scip/cons_xyz.c b/src/scip/cons_xyz.c +index af256c5485..7fe813a22d 100644 +--- src/scip/cons_xyz.c ++++ src/scip/cons_xyz.c +@@ -69,11 +69,13 @@ + /** constraint data for xyz constraints */ + struct SCIP_ConsData + { ++ void* ptr; + }; + + /** constraint handler data */ + struct SCIP_ConshdlrData + { ++ void* ptr; + }; + + +diff --git a/src/scip/dialog_xyz.c b/src/scip/dialog_xyz.c +index f00d44d9ea..3aee42b2dd 100644 +--- src/scip/dialog_xyz.c ++++ src/scip/dialog_xyz.c +@@ -42,6 +42,7 @@ + /** dialog data */ + struct SCIP_DialogData + { ++ void* ptr; + }; + + +diff --git a/src/scip/disp_xyz.c b/src/scip/disp_xyz.c +index 073f192aa6..fa0e7e970c 100644 +--- src/scip/disp_xyz.c ++++ src/scip/disp_xyz.c +@@ -47,6 +47,7 @@ + /** display column data */ + struct SCIP_DispData + { ++ void* ptr; + }; + + +diff --git a/src/scip/event_xyz.c b/src/scip/event_xyz.c +index 04cade95d8..58ad82f06b 100644 +--- src/scip/event_xyz.c ++++ src/scip/event_xyz.c +@@ -36,6 +36,7 @@ + /** event handler data */ + struct SCIP_EventhdlrData + { ++ void* ptr; + }; + + /* + diff --git a/src/scip/heur_xyz.c b/src/scip/heur_xyz.c +index 8bc7c4f953..c45035611f 100644 +--- src/scip/heur_xyz.c ++++ src/scip/heur_xyz.c +@@ -46,6 +46,7 @@ + /** primal heuristic data */ + struct SCIP_HeurData + { ++ void* ptr; + }; + + +diff --git a/src/scip/nodesel_xyz.c b/src/scip/nodesel_xyz.c +index a5139e5f9a..4009fe7793 100644 +--- src/scip/nodesel_xyz.c ++++ src/scip/nodesel_xyz.c +@@ -41,6 +41,7 @@ + /** node selector data */ + struct SCIP_NodeselData + { ++ void* ptr; + }; + + +diff --git a/src/scip/pricer_xyz.c b/src/scip/pricer_xyz.c +index c3bbbff655..5bc6ca4795 100644 +--- src/scip/pricer_xyz.c ++++ src/scip/pricer_xyz.c +@@ -43,6 +43,7 @@ + /** variable pricer data */ + struct SCIP_PricerData + { ++ void* ptr; + }; + + +diff --git a/src/scip/presol_xyz.c b/src/scip/presol_xyz.c +index 84ce50bb08..49d6e8f368 100644 +--- src/scip/presol_xyz.c ++++ src/scip/presol_xyz.c +@@ -42,6 +42,7 @@ + /** presolver data */ + struct SCIP_PresolData + { ++ void* ptr; + }; + + +diff --git a/src/scip/prop_xyz.c b/src/scip/prop_xyz.c +index d07b374fc3..5313a5643f 100644 +--- src/scip/prop_xyz.c ++++ src/scip/prop_xyz.c +@@ -50,6 +50,7 @@ + /** propagator data */ + struct SCIP_PropData + { ++ void* ptr; + }; + + +diff --git a/src/scip/reader_xyz.c b/src/scip/reader_xyz.c +index 45720677ed..8cf3799639 100644 +--- src/scip/reader_xyz.c ++++ src/scip/reader_xyz.c +@@ -40,6 +40,7 @@ + /** data for xyz reader */ + struct SCIP_ReaderData + { ++ void* ptr; + }; + + +diff --git a/src/scip/relax_xyz.c b/src/scip/relax_xyz.c +index 30b0999de4..afdbe5b076 100644 +--- src/scip/relax_xyz.c ++++ src/scip/relax_xyz.c +@@ -43,6 +43,7 @@ + /** relaxator data */ + struct SCIP_RelaxData + { ++ void* ptr; + }; + + +diff --git a/src/scip/sepa_xyz.c b/src/scip/sepa_xyz.c +index 930ee78b3d..b25fed4dd7 100644 +--- src/scip/sepa_xyz.c ++++ src/scip/sepa_xyz.c +@@ -44,6 +44,7 @@ + /** separator data */ + struct SCIP_SepaData + { ++ void* ptr; + }; + + +diff --git a/src/scip/table_xyz.c b/src/scip/table_xyz.c +index 5d479de8a4..61e1307d0d 100644 +--- src/scip/table_xyz.c ++++ src/scip/table_xyz.c +@@ -43,6 +43,7 @@ + /** statistics table data */ + struct SCIP_TableData + { ++ void* ptr; + }; + + diff --git a/ortools/constraint_solver/BUILD b/ortools/constraint_solver/BUILD index 2e4498dcaf..ad160c3923 100644 --- a/ortools/constraint_solver/BUILD +++ b/ortools/constraint_solver/BUILD @@ -26,10 +26,10 @@ cc_proto_library( deps = [":search_stats_proto"], ) -java_proto_library( - name = "search_stats_java_proto", - deps = [":search_stats_proto"], -) +# java_proto_library( +# name = "search_stats_java_proto", +# deps = [":search_stats_proto"], +# ) proto_library( name = "search_limit_proto", @@ -41,10 +41,10 @@ cc_proto_library( deps = [":search_limit_proto"], ) -java_proto_library( - name = "search_limit_java_proto", - deps = [":search_limit_proto"], -) +# java_proto_library( +# name = "search_limit_java_proto", +# deps = [":search_limit_proto"], +# ) proto_library( name = "demon_profiler_proto", @@ -66,10 +66,10 @@ cc_proto_library( deps = ["solver_parameters_proto"], ) -java_proto_library( - name = "solver_parameters_java_proto", - deps = [":solver_parameters_proto"], -) +# java_proto_library( +# name = "solver_parameters_java_proto", +# deps = [":solver_parameters_proto"], +# ) #py_proto_library( # name = "assignment_py_pb2", @@ -194,10 +194,10 @@ cc_proto_library( deps = [":routing_enums_proto"], ) -java_proto_library( - name = "routing_enums_java_proto", - deps = [":routing_enums_proto"], -) +# java_proto_library( +# name = "routing_enums_java_proto", +# deps = [":routing_enums_proto"], +# ) proto_library( name = "routing_parameters_proto", @@ -216,10 +216,10 @@ cc_proto_library( deps = [":routing_parameters_proto"], ) -java_proto_library( - name = "routing_parameters_java_proto", - deps = [":routing_parameters_proto"], -) +# java_proto_library( +# name = "routing_parameters_java_proto", +# deps = [":routing_parameters_proto"], +# ) #py_proto_library( # name = "routing_parameters_py_pb2",