forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 3
/
BUILD
151 lines (139 loc) · 4.11 KB
/
BUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
package(default_visibility = ["//visibility:public"])
exports_files(["model_exporter_swig_helper.h"])
config_setting(
name = "with_glpk",
values = {"define": "USE_GLPK="},
)
config_setting(
name = "with_cplex",
values = {"define": "USE_CPLEX="},
)
config_setting(
name = "with_xpress",
values = {"define": "USE_XPRESS="},
)
config_setting(
name = "with_cbc",
values = {"define": "USE_CBC="},
)
config_setting(
name = "with_clp",
values = {"define": "USE_CLP="},
)
proto_library(
name = "linear_solver_proto",
srcs = ["linear_solver.proto"],
deps = ["//ortools/util:optional_boolean_proto"],
)
cc_proto_library(
name = "linear_solver_cc_proto",
deps = [":linear_solver_proto"],
)
# You can include the interfaces to different solvers by invoking '--define'
# flags. By default GLOP, BOP, SCIP, GUROBI, and CP-SAT interface are included.
#
# For instance, if you want to use the GLPK solver, build with
# '--define USE_GLPK=' (or add it to your bazel.rc file). This will download,
# build and link to GLPK.
cc_library(
name = "linear_solver",
srcs = [
"bop_interface.cc",
"glop_interface.cc",
"glop_utils.cc",
"gurobi_environment.cc",
"gurobi_interface.cc",
"gurobi_proto_solver.cc",
"linear_expr.cc",
"linear_solver_callback.cc",
"linear_solver.cc",
"lpi_glop.cpp",
"model_exporter.cc",
"model_validator.cc",
"sat_interface.cc",
"sat_proto_solver.cc",
"sat_solver_utils.cc",
"scip_callback.cc",
"scip_interface.cc",
"scip_proto_solver.cc",
] + select({
":with_cbc": ["cbc_interface.cc"],
"//conditions:default": [],
}) + select({
":with_clp": ["clp_interface.cc"],
"//conditions:default": [],
}) + select({
":with_cplex": ["cplex_interface.cc"],
"//conditions:default": [],
}) + select({
":with_xpress": ["xpress_interface.cc"],
"//conditions:default": [],
}) + select({
":with_glpk": ["glpk_interface.cc"],
"//conditions:default": [],
}),
hdrs = [
"glop_interface.cc",
"glop_utils.h",
"gurobi_environment.h",
"gurobi_proto_solver.h",
"linear_expr.h",
"linear_solver.h",
"linear_solver_callback.h",
"model_exporter.h",
"model_validator.h",
"sat_proto_solver.h",
"sat_solver_utils.h",
"scip_callback.h",
"scip_helper_macros.h",
"scip_proto_solver.h",
],
copts = ["-DUSE_SCIP"],
deps = [
":linear_solver_cc_proto",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/types:optional",
"@scip//:libscip",
"//ortools/base:accurate_sum",
"//ortools/base:dynamic_library",
"//ortools/base:hash",
"//ortools/base:map_util",
"//ortools/base:status_macros",
"//ortools/base:stl_util",
"//ortools/base:timer",
"//ortools/base",
"//ortools/bop:bop_parameters_cc_proto",
"//ortools/bop:integral_solver",
"//ortools/glop:lp_solver",
"//ortools/glop:parameters_cc_proto",
"//ortools/gscip:legacy_scip_params",
"//ortools/port:file",
"//ortools/port:proto_utils",
"//ortools/sat:cp_model_cc_proto",
"//ortools/sat:cp_model_solver",
"//ortools/sat:lp_utils",
"//ortools/util:fp_utils",
"//ortools/util:lazy_mutable_copy",
] + select({
":with_glpk": ["@glpk//:glpk"],
"//conditions:default": [],
}),
)
copy_file(
name = "lpi_glop",
src = "@scip//:scip-7.0.1/src/lpi/lpi_glop.cpp",
out = "lpi_glop.cpp",
)
cc_library(
name = "scip_helper_macros",
hdrs = ["scip_helper_macros.h"],
deps = [
"//ortools/base:status_macros",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings:str_format",
],
)