-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
115 lines (106 loc) · 3.11 KB
/
BUILD.bazel
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
load("@com_grail_bazel_compdb//:defs.bzl", "compilation_database")
load("@com_grail_bazel_output_base_util//:defs.bzl", "OUTPUT_BASE")
load("@rshc//third_party/gurobi:build_defs.bzl", "gurobi_deps", "if_gurobi")
exports_files(["LICENSE"])
# Configuration variables
config_setting(
name = "darwin",
values = {"cpu": "darwin"},
visibility = ["//visibility:public"],
)
config_setting(
name = "windows",
values = {"cpu": "x64_windows"},
visibility = ["//visibility:public"],
)
config_setting(
name = "linux_x86_64",
values = {"cpu": "k8"},
visibility = ["//visibility:public"],
)
config_setting(
name = "no_fs",
define_values = {
"no_fs": "true",
},
)
DATA_FILES = [
"data/case3_der.csv",
"data/case3_dist.m",
"data/case56_der.csv",
"data/case56_sce.m",
"data/load_data.csv",
"data/pv_data.csv",
"data/load_data_random.csv",
"data/pv_data_random.csv",
"data/psis.csv",
"data/psis_case56.csv"
]
cc_binary(
name = "optimality",
srcs = [
"src/optimality/optimality.cpp",
"src/optimality/mosek_model.cpp",
"src/model.cpp",
] + if_gurobi([
"src/optimality/gurobi_model.cpp"
]),
includes = ["include"],
data = DATA_FILES,
defines = if_gurobi(["ENABLE_GUROBI"])+ select({
"no_fs": [],
"//conditions:default": ["ENABLE_FS"],
}),
linkstatic = True,
visibility = ["//visibility:public"],
deps = [
"@bazel_tools//tools/cpp/runfiles",
"@cxxopts//:cxxopts",
"@eigen//:eigen",
"@rshc//third_party/mosek:fusion_cxx",
] + gurobi_deps() + select({
"no_fs": ["@phasor-nofs//:phasor"],
"//conditions:default": ["@phasor//:phasor"],
}),
)
cc_binary(
name = "acceptability",
srcs = [
"src/acceptability/acceptability.cpp",
"src/acceptability/acceptability_check.cpp",
"src/acceptability/unacceptability_check.cpp",
"src/acceptability/assessor.cpp",
"src/model.cpp",
] + if_gurobi([]),
data = DATA_FILES,
defines = ["HIGHFIVE_USE_EIGEN", "HIGHFIVE_USE_BOOST=OFF"] + if_gurobi(["ENABLE_GUROBI"]) + select({
"no_fs": [],
"//conditions:default": ["ENABLE_FS"],
}),
includes = ["include"],
linkstatic = True,
visibility = ["//visibility:public"],
deps = [
"@bazel_tools//tools/cpp/runfiles",
"@cxxopts//:cxxopts",
"@eigen//:eigen",
"@rshc//third_party/mosek:fusion_cxx",
"@highfive//:h5",
] + gurobi_deps() + select({
"no_fs": ["@phasor-nofs//:phasor"],
"//conditions:default": ["@phasor//:phasor"],
}),
)
compilation_database(
name = "compdb",
# OUTPUT_BASE is a dynamic value that will vary for each user workspace.
# If you would like your build outputs to be the same across users, then
# skip supplying this value, and substitute the default constant value
# "__OUTPUT_BASE__" through an external tool like `sed` or `jq` (see
# below shell commands for usage).
output_base = OUTPUT_BASE,
targets = [
"//:optimality",
"//:acceptability"
],
)