forked from google/or-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD
136 lines (124 loc) · 3.69 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
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
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="},
)
config_setting(
name = "with_gurobi",
values = {"define": "USE_GUROBI="},
)
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 only GLOP interface is 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.
#
# Currently compiling with '--define USE_BOP=' flag is broken due to the
# circular dependency:
# .-> //ortools/linear_solver:linear_solver
# | //ortools/bop:integral_solver
# | //ortools/bop:bop_solver
# | //ortools/bop:complete_optimizer
# | //ortools/sat:optimization
# `-- //ortools/linear_solver:linear_solver
cc_library(
name = "linear_solver",
srcs = [
"linear_expr.cc",
"linear_solver.cc",
"linear_solver_callback.cc",
"model_exporter.cc",
"model_validator.cc",
"glop_interface.cc",
"glop_utils.cc",
"bop_interface.cc",
"sat_interface.cc",
"sat_proto_solver.cc",
"sat_solver_utils.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": [],
}) + select({
":with_gurobi": ["gurobi_interface.cc"],
"//conditions:default": [],
}),
hdrs = [
"glop_interface.cc",
"glop_utils.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",
],
deps = [
":linear_solver_cc_proto",
"//ortools/base",
"//ortools/base:accurate_sum",
"//ortools/base:hash",
"//ortools/base:map_util",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/types:optional",
"@com_google_absl//absl/status",
"//ortools/base:status_macros",
"//ortools/base:stl_util",
"@com_google_absl//absl/strings",
"//ortools/base:timer",
"//ortools/bop:integral_solver",
"//ortools/glop:lp_solver",
"//ortools/glop:parameters_cc_proto",
"//ortools/port:file",
"//ortools/port:proto_utils",
"//ortools/util:fp_utils",
"//ortools/util:lazy_mutable_copy",
"//ortools/bop:bop_parameters_cc_proto",
"//ortools/sat:cp_model_cc_proto",
"//ortools/sat:cp_model_solver",
"//ortools/sat:lp_utils",
] + select({
":with_glpk": ["@glpk//:glpk"],
"//conditions:default": [],
}),
)