11workspace (name = "mlir_tutorial" )
22
3- load ("@bazel_tools//tools/build_defs/repo:git.bzl" , "new_git_repository" )
3+ load ("@bazel_tools//tools/build_defs/repo:git.bzl" , "git_repository" , " new_git_repository" )
44load ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
55load ("@bazel_tools//tools/build_defs/repo:utils.bzl" , "maybe" )
66
@@ -18,7 +18,9 @@ http_archive(
1818load ("@bazel_skylib//:workspace.bzl" , "bazel_skylib_workspace" )
1919
2020bazel_skylib_workspace ()
21+
2122load ("@bazel_skylib//lib:versions.bzl" , "versions" )
23+
2224versions .check (minimum_bazel_version = "6.3.2" )
2325
2426# A two-step process for buliding LLVM/MLIR with bazel. First the raw source
@@ -108,3 +110,122 @@ pip_parse(
108110load ("@mlir_tutorial_pip_deps//:requirements.bzl" , "install_deps" )
109111
110112install_deps ()
113+
114+ ##### Deps for or-tools #####
115+
116+ ## Bazel rules.
117+ git_repository (
118+ name = "platforms" ,
119+ commit = "380c85cc2c7b126c6e354f517dc16d89fe760c9f" ,
120+ remote = "https://github.com/bazelbuild/platforms.git" ,
121+ )
122+
123+ git_repository (
124+ name = "rules_proto" ,
125+ commit = "3f1ab99b718e3e7dd86ebdc49c580aa6a126b1cd" ,
126+ remote = "https://github.com/bazelbuild/rules_proto.git" ,
127+ )
128+
129+ ## ZLIB
130+ new_git_repository (
131+ name = "zlib" ,
132+ build_file = "@com_google_protobuf//:third_party/zlib.BUILD" ,
133+ commit = "04f42ceca40f73e2978b50e93806c2a18c1281fc" ,
134+ remote = "https://github.com/madler/zlib.git" ,
135+ )
136+
137+ ## Re2
138+ git_repository (
139+ name = "com_google_re2" ,
140+ remote = "https://github.com/google/re2.git" ,
141+ tag = "2023-07-01" ,
142+ )
143+
144+ ## Abseil-cpp
145+ git_repository (
146+ name = "com_google_absl" ,
147+ commit = "c2435f8342c2d0ed8101cb43adfd605fdc52dca2" ,
148+ patch_args = ["-p1" ],
149+ patches = ["@com_google_ortools//patches:abseil-cpp-20230125.3.patch" ],
150+ remote = "https://github.com/abseil/abseil-cpp.git" ,
151+ )
152+
153+ ## Protobuf
154+ git_repository (
155+ name = "com_google_protobuf" ,
156+ # there's a patch for the CMake build in protobuf, ignoring
157+ # patches = ["@com_google_ortools//patches:protobuf-v23.3.patch"],
158+ commit = "4dd15db6eb3955745f379d28fb4a2fcfb6753de3" ,
159+ patch_args = ["-p1" ],
160+ remote = "https://github.com/protocolbuffers/protobuf.git" ,
161+ )
162+
163+ # Load common dependencies.
164+ load ("@com_google_protobuf//:protobuf_deps.bzl" , "protobuf_deps" )
165+
166+ protobuf_deps ()
167+
168+ ## Solvers
169+ http_archive (
170+ name = "glpk" ,
171+ build_file = "@com_google_ortools//bazel:glpk.BUILD" ,
172+ sha256 = "4a1013eebb50f728fc601bdd833b0b2870333c3b3e5a816eeba921d95bec6f15" ,
173+ url = "http://ftp.gnu.org/gnu/glpk/glpk-5.0.tar.gz" ,
174+ )
175+
176+ http_archive (
177+ name = "bliss" ,
178+ build_file = "@com_google_ortools//bazel:bliss.BUILD" ,
179+ patches = ["@com_google_ortools//bazel:bliss-0.73.patch" ],
180+ sha256 = "f57bf32804140cad58b1240b804e0dbd68f7e6bf67eba8e0c0fa3a62fd7f0f84" ,
181+ url = "https://github.com/google/or-tools/releases/download/v9.0/bliss-0.73.zip" ,
182+ #url = "http://www.tcs.hut.fi/Software/bliss/bliss-0.73.zip",
183+ )
184+
185+ new_git_repository (
186+ name = "scip" ,
187+ build_file = "@com_google_ortools//bazel:scip.BUILD" ,
188+ commit = "62fab8a2e3708f3452fad473a6f48715c367316b" ,
189+ patch_args = ["-p1" ],
190+ patches = ["@com_google_ortools//bazel:scip.patch" ],
191+ remote = "https://github.com/scipopt/scip.git" ,
192+ )
193+
194+ # Eigen has no Bazel build.
195+ new_git_repository (
196+ name = "eigen" ,
197+ build_file_content =
198+ """
199+ cc_library(
200+ name = 'eigen3',
201+ srcs = [],
202+ includes = ['.'],
203+ hdrs = glob(['Eigen/**']),
204+ visibility = ['//visibility:public'],
205+ )
206+ """ ,
207+ commit = "3147391d946bb4b6c68edd901f2add6ac1f31f8c" ,
208+ remote = "https://gitlab.com/libeigen/eigen.git" ,
209+ )
210+
211+ git_repository (
212+ name = "highs" ,
213+ branch = "bazel" ,
214+ remote = "https://github.com/ERGO-Code/HiGHS.git" ,
215+ )
216+
217+ ## Swig support
218+ # pcre source code repository
219+ new_git_repository (
220+ name = "pcre2" ,
221+ build_file = "@com_google_ortools//bazel:pcre2.BUILD" ,
222+ remote = "https://github.com/PCRE2Project/pcre2.git" ,
223+ tag = "pcre2-10.42" ,
224+ )
225+
226+ git_repository (
227+ name = "com_google_ortools" ,
228+ commit = "1d696f9108a0ebfd99feb73b9211e2f5a6b0812b" ,
229+ remote = "https://github.com/google/or-tools.git" ,
230+ shallow_since = "1647023481 +0100" ,
231+ )
0 commit comments