Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade OpenROAD #196

Merged
merged 7 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,22 @@ llvm_toolchain(
# },
)

maybe(
http_archive,
name = "rules_proto",
sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
strip_prefix = "rules_proto-5.3.0-21.7",
urls = [
"https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz",
],
)

maybe(
http_archive,
name = "rules_python",
sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.1.0/rules_python-0.1.0.tar.gz",
sha256 = "5868e73107a8e85d8f323806e60cad7283f34b32163ea6ff1020cf27abef6036",
strip_prefix = "rules_python-0.25.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.25.0/rules_python-0.25.0.tar.gz",
)

maybe(
Expand Down
47 changes: 46 additions & 1 deletion dependency_support/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -11,3 +11,48 @@
# 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.

load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")

compile_pip_requirements(name = "pip_requirements")

genrule(
name = "clean_requirements",
srcs = ["@rules_hdl_pip_deps//:requirements.bzl"],
outs = ["requirements.clean.bzl"],
cmd = " | ".join([
"cat $<",
# Replace the bazel 6.0.0 specific comment with something that bazel 5.4.0 would produce.
# This enables this example to be run as a test under bazel 5.4.0.
"""sed -e 's#@rules_hdl//#@//#'""",
]) + " >$@",
)

write_file(
name = "gen_update",
out = "update.sh",
content = [
# This depends on bash, would need tweaks for Windows
"#!/usr/bin/env bash",
# Bazel gives us a way to access the source folder!
"cd $BUILD_WORKSPACE_DIRECTORY",
"cp -fv bazel-bin/dependency_support/requirements.clean.bzl dependency_support/requirements.bzl",
],
)

sh_binary(
name = "vendor_requirements",
srcs = ["update.sh"],
data = [":clean_requirements"],
)

# Similarly ensures that the requirements.bzl file is updated
# based on the requirements.txt lockfile.
diff_test(
name = "test_vendored",
failure_message = "Please run: bazel run //dependency_support:vendor_requirements",
file1 = "requirements.bzl",
file2 = ":clean_requirements",
)
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ cc_library(
"-fexceptions",
],
features = ["-use_header_modules"], # Incompatible with -fexception.
includes = ["."],
deps = ["@org_gnu_glpk//:glpk"],
visibility = [
"//visibility:public",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ DEPS = [
"@boost//:system",
"@boost//:thread",
"@local_config_python//:python_headers",
"@org_tuxfamily_eigen//:eigen3",
"@eigen//:eigen3",
]

DEFINES = [
Expand Down
11 changes: 6 additions & 5 deletions dependency_support/com_google_absl/com_google_absl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@

"""Registers Bazel workspaces for the GNU readline library."""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def com_google_absl():
maybe(
http_archive,
git_repository,
name = "com_google_absl",
strip_prefix = "abseil-cpp-20211102.0",
urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.zip"],
sha256 = "a4567ff02faca671b95e31d315bab18b42b6c6f1a60e91c6ea84e5a2142112c2",
tag = "20230125.3",
patches = ["@com_google_ortools//patches:abseil-cpp-20230125.3.patch"],
patch_args = ["-p1"],
remote = "https://github.com/abseil/abseil-cpp.git",
)
15 changes: 15 additions & 0 deletions dependency_support/com_google_ortools/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2023 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.

# Required to make this a package.
61 changes: 61 additions & 0 deletions dependency_support/com_google_ortools/com_google_ortools.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright 2023 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.

"""Registers Bazel workspaces for the GNU readline library."""

load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def com_google_ortools():
maybe(
http_archive,
name = "com_google_ortools",
strip_prefix = "or-tools-9.7",
urls = ["https://github.com/google/or-tools/archive/refs/tags/v9.7.tar.gz"],
sha256 = "054d9517fc6c83f15150c93ef1c2c674ffd7d4a0d1fdc78f6ef8bc3e25c2e339",
)
maybe(
new_git_repository,
name = "scip",
build_file = "@com_google_ortools//bazel:scip.BUILD",
patches = ["@com_google_ortools//bazel:scip.patch"],
patch_args = ["-p1"],
tag = "v803",
remote = "https://github.com/scipopt/scip.git",
)
maybe(
http_archive,
name = "bliss",
build_file = "@com_google_ortools//bazel:bliss.BUILD",
patches = ["@com_google_ortools//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",
)
maybe(
new_git_repository,
name = "eigen",
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'],
)
""",
Comment on lines +48 to +60
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have an eigen already is that one not compatible with ortools?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to figure out how to map the ortools dependency to the one we already had.

)
15 changes: 15 additions & 0 deletions dependency_support/com_google_protobuf/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2020 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.

# Required to make this a package.
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Loads the Eigen C++ template library for linear algebra."""
"""Registers Bazel workspaces for the GNU readline library."""

load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def org_tuxfamily_eigen():
def com_google_protobuf():
maybe(
new_git_repository,
name = "org_tuxfamily_eigen",
build_file = Label("@rules_hdl//dependency_support/org_tuxfamily_eigen:bundled.BUILD.bazel"),
commit = "eb71e5db988d4a23e619ed054efd3eb751cdd026", # 2021-03-17
remote = "https://gitlab.com/libeigen/eigen.git",
shallow_since = "1615946824 +0100",
git_repository,
name = "com_google_protobuf",
tag = "v23.3",
patches = ["@com_google_ortools//patches:protobuf-v23.3.patch"],
patch_args = ["-p1"],
remote = "https://github.com/protocolbuffers/protobuf.git",
)
6 changes: 4 additions & 2 deletions dependency_support/dependency_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ load("@rules_hdl//dependency_support/com_github_yosyshq_prjtrellis:com_github_yo
load("@rules_hdl//dependency_support/com_github_yosyshq_prjtrellis_db:com_github_yosyshq_prjtrellis_db.bzl", "com_github_yosyshq_prjtrellis_db")
load("@rules_hdl//dependency_support/com_google_absl:com_google_absl.bzl", "com_google_absl")
load("@rules_hdl//dependency_support/com_google_googletest:com_google_googletest.bzl", "com_google_googletest")
load("@rules_hdl//dependency_support/com_google_ortools:com_google_ortools.bzl", "com_google_ortools")
load("@rules_hdl//dependency_support/com_google_protobuf:com_google_protobuf.bzl", "com_google_protobuf")
load("@rules_hdl//dependency_support/com_google_skywater_pdk:com_google_skywater_pdk.bzl", "com_google_skywater_pdk")
load("@rules_hdl//dependency_support/com_icarus_iverilog:com_icarus_iverilog.bzl", "com_icarus_iverilog")
load("@rules_hdl//dependency_support/com_opencircuitdesign_magic:com_opencircuitdesign_magic.bzl", "com_opencircuitdesign_magic")
Expand All @@ -56,7 +58,6 @@ load("@rules_hdl//dependency_support/org_sourceware_libffi:org_sourceware_libffi
load("@rules_hdl//dependency_support/org_swig:org_swig.bzl", "org_swig")
load("@rules_hdl//dependency_support/org_theopenroadproject:org_theopenroadproject.bzl", "org_theopenroadproject")
load("@rules_hdl//dependency_support/org_theopenroadproject_asap7:org_theopenroadproject_asap7.bzl", "org_theopenroadproject_asap7")
load("@rules_hdl//dependency_support/org_tuxfamily_eigen:org_tuxfamily_eigen.bzl", "org_tuxfamily_eigen")
load("@rules_hdl//dependency_support/pybind11:pybind11.bzl", "pybind11")
load("@rules_hdl//dependency_support/tk_tcl:tk_tcl.bzl", "tk_tcl")
load("@rules_hdl//dependency_support/verilator:verilator.bzl", "verilator")
Expand All @@ -78,6 +79,8 @@ def dependency_support():
com_github_yosyshq_prjtrellis_db()
com_google_absl()
com_google_googletest()
com_google_protobuf()
com_google_ortools()
com_google_skywater_pdk()
com_icarus_iverilog()
com_opencircuitdesign_magic()
Expand All @@ -101,7 +104,6 @@ def dependency_support():
org_swig()
org_theopenroadproject()
org_theopenroadproject_asap7()
org_tuxfamily_eigen()
pybind11()
tk_tcl()
verilator()
Loading
Loading