Files
ortools-clone/WORKSPACE

293 lines
8.0 KiB
Python
Raw Normal View History

2022-10-05 18:33:10 +02:00
# Copyright 2010-2022 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
2021-06-18 09:01:00 +02:00
workspace(name = "com_google_ortools")
2019-02-10 18:51:36 +01:00
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2021-07-27 01:43:59 +02:00
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
2019-02-10 18:51:36 +01:00
2023-03-17 12:50:31 +01:00
# Bazel Extensions
## Bazel Skylib rules.
git_repository(
name = "bazel_skylib",
2023-08-23 17:57:01 +02:00
tag = "1.4.2",
remote = "https://github.com/bazelbuild/bazel-skylib.git",
)
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
bazel_skylib_workspace()
## Bazel rules.
2022-02-02 11:45:47 +01:00
git_repository(
name = "platforms",
2023-08-23 17:57:01 +02:00
tag = "0.0.7",
2022-02-02 11:45:47 +01:00
remote = "https://github.com/bazelbuild/platforms.git",
)
2023-03-31 15:46:00 +02:00
git_repository(
2023-06-02 00:00:21 +02:00
name = "rules_cc",
2023-10-11 15:27:47 +02:00
tag = "0.0.9",
2023-06-02 00:00:21 +02:00
remote = "https://github.com/bazelbuild/rules_cc.git",
2023-03-31 15:46:00 +02:00
)
2023-03-24 08:34:15 +01:00
git_repository(
name = "rules_proto",
tag = "5.3.0-21.7",
remote = "https://github.com/bazelbuild/rules_proto.git",
)
2023-08-23 17:57:01 +02:00
git_repository(
name = "rules_java",
tag = "6.4.0",
#tag = "6.5.1",
remote = "https://github.com/bazelbuild/rules_java.git",
)
git_repository(
name = "rules_jvm_external",
tag = "5.2",
#tag = "5.3",
remote = "https://github.com/bazelbuild/rules_jvm_external.git",
)
git_repository(
name = "contrib_rules_jvm",
tag = "v0.9.0",
2023-10-11 15:27:47 +02:00
#tag = "v0.19.0",
remote = "https://github.com/bazel-contrib/rules_jvm.git",
)
git_repository(
name = "rules_python",
tag = "0.26.0",
remote = "https://github.com/bazelbuild/rules_python.git",
)
2023-06-02 00:00:21 +02:00
# Dependencies
2023-03-31 15:46:00 +02:00
## ZLIB
2022-03-11 17:48:16 +01:00
new_git_repository(
name = "zlib",
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
2023-06-13 13:59:10 +02:00
tag = "v1.2.13",
2022-03-11 17:48:16 +01:00
remote = "https://github.com/madler/zlib.git",
2017-03-21 10:24:39 -04:00
)
2017-03-30 14:50:36 +02:00
2023-03-31 15:46:00 +02:00
## Re2
2021-11-19 09:24:08 +01:00
git_repository(
name = "com_google_re2",
2023-08-11 09:47:30 +02:00
tag = "2023-08-01",
2021-11-19 09:24:08 +01:00
remote = "https://github.com/google/re2.git",
)
2023-03-31 15:46:00 +02:00
## Abseil-cpp
git_repository(
name = "com_google_absl",
2023-08-10 14:08:19 +02:00
tag = "20230802.0",
patches = ["//patches:abseil-cpp-20230802.0.patch"],
2023-04-12 17:45:17 +02:00
patch_args = ["-p1"],
2023-03-31 15:46:00 +02:00
remote = "https://github.com/abseil/abseil-cpp.git",
)
## Protobuf
git_repository(
name = "com_google_protobuf",
2023-10-05 23:21:11 +02:00
tag = "v24.4",
patches = ["//patches:protobuf-v24.4.patch"],
patch_args = ["-p1"],
2023-03-31 15:46:00 +02:00
remote = "https://github.com/protocolbuffers/protobuf.git",
)
# Load common dependencies.
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()
## Solvers
2019-02-10 18:51:36 +01:00
http_archive(
name = "glpk",
2017-04-20 14:21:27 +02:00
build_file = "//bazel:glpk.BUILD",
2021-11-19 13:39:48 +01:00
sha256 = "4a1013eebb50f728fc601bdd833b0b2870333c3b3e5a816eeba921d95bec6f15",
url = "http://ftp.gnu.org/gnu/glpk/glpk-5.0.tar.gz",
)
2020-06-30 12:21:14 +02:00
http_archive(
name = "bliss",
build_file = "//bazel:bliss.BUILD",
2020-07-03 10:34:45 +02:00
patches = ["//bazel:bliss-0.73.patch"],
sha256 = "f57bf32804140cad58b1240b804e0dbd68f7e6bf67eba8e0c0fa3a62fd7f0f84",
url = "https://github.com/google/or-tools/releases/download/v9.0/bliss-0.73.zip",
#url = "http://www.tcs.hut.fi/Software/bliss/bliss-0.73.zip",
)
2021-07-27 01:43:59 +02:00
new_git_repository(
2020-06-30 12:21:14 +02:00
name = "scip",
build_file = "//bazel:scip.BUILD",
2020-11-27 09:56:23 +01:00
patches = ["//bazel:scip.patch"],
2022-02-04 15:32:19 +01:00
patch_args = ["-p1"],
2023-10-25 14:47:24 +02:00
tag = "v804",
2021-07-27 01:43:59 +02:00
remote = "https://github.com/scipopt/scip.git",
2020-06-30 12:21:14 +02:00
)
# Eigen has no Bazel build.
2022-03-11 17:48:16 +01:00
new_git_repository(
name = "eigen",
2022-03-11 17:48:16 +01:00
tag = "3.4.0",
remote = "https://gitlab.com/libeigen/eigen.git",
build_file_content =
"""
cc_library(
name = 'eigen3',
srcs = [],
includes = ['.'],
hdrs = glob(['Eigen/**']),
visibility = ['//visibility:public'],
)
"""
)
2022-10-04 09:19:18 +02:00
git_repository(
name = "highs",
branch = "bazel",
remote = "https://github.com/ERGO-Code/HiGHS.git",
)
## Swig support
2023-03-03 17:50:11 +01:00
# pcre source code repository
new_git_repository(
name = "pcre2",
build_file = "//bazel:pcre2.BUILD",
tag = "pcre2-10.42",
remote = "https://github.com/PCRE2Project/pcre2.git",
)
# generate Patch:
# Checkout swig
# cd Source/CParse && bison -d -o parser.c parser.y
# ./autogen.sh
# ./configure
# make Lib/swigwarn.swg
# edit .gitignore and remove parser.h, parser.c, and swigwarn.swg
# git add Source/CParse/parser.h Source/CParse/parser.c Lib/swigwarn.swg
# git diff --staged Lib Source/CParse > <path to>swig.patch
# Edit swig.BUILD:
# edit version
new_git_repository(
name = "swig",
build_file = "//bazel:swig.BUILD",
patches = ["//bazel:swig.patch"],
patch_args = ["-p1"],
tag = "v4.1.1",
remote = "https://github.com/swig/swig.git",
)
## Python
2023-03-24 08:34:15 +01:00
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
2023-04-01 02:42:04 +02:00
# Create a central external repo, @pip_deps, that contains Bazel targets for all the
# third-party packages specified in the bazel/requirements.txt file.
load("@rules_python//python:pip.bzl", "pip_parse")
pip_parse(
2023-04-01 02:42:04 +02:00
name = "pip_deps",
2023-02-11 09:56:03 -08:00
requirements = "//bazel:ortools_requirements.txt",
)
load("@pip_deps//:requirements.bzl",
install_pip_deps="install_deps")
install_pip_deps()
# Add a second repo @ortools_notebook_deps for jupyter notebooks.
pip_parse(
name = "ortools_notebook_deps",
requirements = "//bazel:notebook_requirements.txt",
)
2023-02-06 16:27:20 +01:00
2023-03-06 17:44:42 +01:00
load("@ortools_notebook_deps//:requirements.bzl",
2023-02-06 16:27:20 +01:00
install_notebook_deps="install_deps")
install_notebook_deps()
git_repository(
name = "pybind11_bazel",
2023-03-02 10:31:53 +01:00
commit = "fc56ce8a8b51e3dd941139d329b63ccfea1d304b",
2022-11-16 15:28:13 +01:00
patches = ["//patches:pybind11_bazel.patch"],
2022-04-12 15:48:21 +02:00
patch_args = ["-p1"],
remote = "https://github.com/pybind/pybind11_bazel.git",
)
new_git_repository(
name = "pybind11",
build_file = "@pybind11_bazel//:pybind11.BUILD",
2023-10-11 15:27:47 +02:00
tag = "v2.11.1",
remote = "https://github.com/pybind/pybind11.git",
)
new_git_repository(
name = "pybind11_protobuf",
#build_file = "@pybind11_bazel//:pybind11.BUILD",
#tag = "v2.10.3",
commit = "5baa2dc9d93e3b608cde86dfa4b8c63aeab4ac78",
remote = "https://github.com/pybind/pybind11_protobuf.git",
)
load("@pybind11_bazel//:python_configure.bzl", "python_configure")
python_configure(name = "local_config_python", python_version = "3")
bind(
name = "python_headers",
actual = "@local_config_python//:python_headers",
)
## Java support (with junit 5)
2023-08-23 17:57:01 +02:00
load("@rules_java//java:repositories.bzl", "rules_java_dependencies", "rules_java_toolchains")
rules_java_dependencies()
rules_java_toolchains()
load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
rules_jvm_external_deps()
load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")
rules_jvm_external_setup()
2023-01-25 16:08:38 +01:00
JUNIT_PLATFORM_VERSION = "1.9.2"
JUNIT_JUPITER_VERSION = "5.9.2"
load("@rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
artifacts = [
2023-04-05 11:24:26 +02:00
"net.java.dev.jna:jna:aar:5.13.0",
"com.google.truth:truth:0.32",
"org.junit.platform:junit-platform-launcher:%s" % JUNIT_PLATFORM_VERSION,
"org.junit.platform:junit-platform-reporting:%s" % JUNIT_PLATFORM_VERSION,
"org.junit.jupiter:junit-jupiter-api:%s" % JUNIT_JUPITER_VERSION,
"org.junit.jupiter:junit-jupiter-params:%s" % JUNIT_JUPITER_VERSION,
"org.junit.jupiter:junit-jupiter-engine:%s" % JUNIT_JUPITER_VERSION,
],
repositories = [
"https://repo1.maven.org/maven2",
],
)
load("@contrib_rules_jvm//:repositories.bzl", "contrib_rules_jvm_deps")
contrib_rules_jvm_deps()
load("@contrib_rules_jvm//:setup.bzl", "contrib_rules_jvm_setup")
contrib_rules_jvm_setup()
2023-05-24 15:30:46 +02:00
## Testing
git_repository(
name = "com_google_googletest",
tag = "v1.13.0",
remote = "https://github.com/google/googletest.git",
)
2023-07-05 13:10:00 +02:00
git_repository(
name = "com_google_benchmark",
tag = "v1.8.1",
remote = "https://github.com/google/benchmark.git",
)