Skip to content

Commit bd2eea0

Browse files
committed
Merge branch 'master' of github.com:The-OpenROAD-Project-private/OpenROAD into grt-infinite-resources
2 parents ac08e0d + 446934a commit bd2eea0

File tree

384 files changed

+16645
-10965
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+16645
-10965
lines changed

BUILD.bazel

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ cc_binary(
180180
"//src/utl",
181181
"@boost.stacktrace",
182182
"@rules_cc//cc/runfiles",
183-
"@tk_tcl//:tcl",
183+
"@tcl_lang//:tcl",
184184
],
185185
)
186186

@@ -210,8 +210,10 @@ cc_library(
210210
visibility = ["//visibility:public"],
211211
deps = [
212212
"//src/sta:opensta_lib",
213+
"@abseil-cpp//absl/base:core_headers",
214+
"@abseil-cpp//absl/synchronization",
213215
"@boost.stacktrace",
214-
"@tk_tcl//:tcl",
216+
"@tcl_lang//:tcl",
215217
] + OPENROAD_LIBRARY_DEPS,
216218
)
217219

@@ -230,6 +232,7 @@ cc_library(
230232
"include/ord",
231233
],
232234
visibility = ["//:__subpackages__"],
235+
deps = ["@abseil-cpp//absl/synchronization"],
233236
)
234237

235238
cc_library(

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ cmake_policy(SET CMP0086 NEW)
1212
# Allows <PackageName>_ROOT to be used
1313
cmake_policy(SET CMP0074 NEW)
1414

15-
# Disallows <PACKAGENAME>_ROOT in find_package.
16-
# TODO: resolve absl/or-tools issue and switch to NEW
17-
cmake_policy(SET CMP0144 OLD)
15+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.27")
16+
# Disallows <PACKAGENAME>_ROOT in find_package.
17+
# TODO: resolve absl/or-tools issue and switch to NEW
18+
cmake_policy(SET CMP0144 OLD)
19+
endif()
1820

1921
# Allow AUTOUIC on generated source
2022
cmake_policy(SET CMP0071 NEW)

MODULE.bazel

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ bazel_dep(name = "spdlog", version = "1.15.1")
7171
bazel_dep(name = "tcmalloc", version = "0.0.0-20250927-12f2552")
7272
bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
7373
bazel_dep(name = "yaml-cpp", version = "0.8.0")
74+
bazel_dep(name = "tcl_lang", version = "8.6.16.bcr.1")
7475

7576
# Make compilation DB (and possibly build cleaner)
7677
bazel_dep(name = "bant", version = "0.2.4", dev_dependency = True)
@@ -146,7 +147,7 @@ bazel_dep(name = "bazel-orfs")
146147
# To bump version, run: bazelisk run @bazel-orfs//:bump
147148
git_override(
148149
module_name = "bazel-orfs",
149-
commit = "72db79cc90376851e27ee484c1ae1e23c2e30f44",
150+
commit = "63ecaa366a7418d7afaa3777b96daa8401a64983",
150151
remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
151152
)
152153

@@ -155,10 +156,10 @@ orfs = use_extension("@bazel-orfs//:extension.bzl", "orfs_repositories")
155156
# To bump version, run: bazelisk run @bazel-orfs//:bump
156157
orfs.default(
157158
# Official image https://hub.docker.com/r/openroad/orfs/tags
158-
image = "docker.io/openroad/orfs:v3.0-4512-g528ad3d8a",
159+
image = "docker.io/openroad/orfs:26Q1-333-g9ad095627",
159160
# Use OpenROAD of this repo instead of from the docker image
160161
openroad = "//:openroad",
161-
sha256 = "087122e12c90edcb3ebfc452a3238417fbc78e1135f5b43feaf7162d885cada1",
162+
sha256 = "c89d51c311c16d2f0e6aae43648d6ffb0b1befd4cc4a122c683684361776f838",
162163
)
163164
use_repo(orfs, "com_github_nixos_patchelf_download")
164165
use_repo(orfs, "docker_orfs")

MODULE.bazel.lock

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WORKSPACE

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@ http_archive(
2424
# Direct dependencies needed in openroad, and others that these in turn need.
2525
# This essentially reads as a TODO list of what needs to be upstreamed to BCR
2626
load("@rules_hdl//dependency_support/com_github_westes_flex:com_github_westes_flex.bzl", "com_github_westes_flex")
27-
load("@rules_hdl//dependency_support/net_zlib:net_zlib.bzl", "net_zlib")
2827
load("@rules_hdl//dependency_support/org_gnu_bison:org_gnu_bison.bzl", "org_gnu_bison")
2928
load("@rules_hdl//dependency_support/org_pcre_ftp:org_pcre_ftp.bzl", "org_pcre_ftp")
3029
load("@rules_hdl//dependency_support/org_swig:org_swig.bzl", "org_swig")
31-
load("@rules_hdl//dependency_support/tk_tcl:tk_tcl.bzl", "tk_tcl")
32-
33-
tk_tcl()
3430

3531
# Swig exists in BCR, but in a newer version where we need to test how to make
3632
# it to work with TCL.
@@ -42,7 +38,4 @@ com_github_westes_flex()
4238

4339
org_gnu_bison()
4440

45-
# remaining user is tcl. Once we can get that from BCR, this can go.
46-
net_zlib() # BCR has @zlib we use, but some above dep uses it w/ differet name
47-
4841
org_pcre_ftp() # there is a newer pcre2 in BCR

bazel/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ cc_library(
2020
srcs = [
2121
"InitRunFiles.cpp",
2222
],
23+
data = [
24+
"@tcl_lang//:tcl_core",
25+
],
2326
visibility = ["//visibility:public"],
2427
deps = [
2528
"@rules_cc//cc/runfiles",

bazel/InitRunFiles.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <unistd.h>
22

33
#include <climits>
4+
#include <cstdlib>
45
#include <iostream>
56
#include <memory>
67
#include <optional>
@@ -55,11 +56,11 @@ class BazelInitializer
5556
}
5657

5758
// Set the TCL_LIBRARY environment variable
58-
const std::string tcl_path = runfiles->Rlocation("tk_tcl/library/");
59+
const std::string tcl_path = runfiles->Rlocation("tcl_lang/library/");
5960
if (!tcl_path.empty()) {
60-
setenv("TCL_LIBRARY", tcl_path.c_str(), 0);
61+
setenv("TCL_LIBRARY", tcl_path.c_str(), true);
6162
} else {
62-
std::cerr << "Error: Could not locate 'tk_tcl/library/' in runfiles."
63+
std::cerr << "Error: Could not locate 'tcl_lang/library/' in runfiles."
6364
<< std::endl;
6465
std::exit(1);
6566
}

bazel/tcl_encode_sta.bzl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ def _tcl_encode_sta_impl(ctx):
2424
arguments = [args],
2525
tools = [ctx.executable._tclsh, ctx.file._encode_script],
2626
executable = ctx.executable._tclsh,
27-
env = {
28-
# FIXME why is this needed?
29-
"TCL_LIBRARY": ctx.executable._tclsh.path + ".runfiles/tk_tcl/library",
30-
},
3127
)
3228
return [DefaultInfo(files = depset([output_file]))]
3329

@@ -51,7 +47,7 @@ tcl_encode_sta = rule(
5147
allow_single_file = True,
5248
),
5349
"_tclsh": attr.label(
54-
default = "@tk_tcl//:tclsh",
50+
default = "@tcl_lang//:tclsh",
5551
executable = True,
5652
cfg = "exec",
5753
),

default.nix

Lines changed: 53 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
fetchFromGitHub,
99
fetchzip,
1010
libsForQt5,
11-
boost183,
11+
abseil-cpp,
12+
boost189,
1213
eigen,
1314
cudd,
1415
ninja,
@@ -26,51 +27,50 @@
2627
clp,
2728
cbc,
2829
re2,
29-
swig4,
30+
swig,
3031
pkg-config,
3132
cmake,
3233
gnumake,
3334
flex,
3435
bison,
35-
clang-tools_14,
36+
clang-tools,
3637
gtest,
3738
# or-tools
3839
stdenv,
3940
overrideSDK,
4041
git,
4142
yaml-cpp,
42-
}: let
43+
}:
44+
let
4345
or-tools' =
4446
(or-tools.override {
4547
## Alligned alloc not available on the default SDK for x86_64-darwin (10.12!!)
46-
stdenv =
47-
if stdenv.isDarwin
48-
then (overrideSDK stdenv "11.0")
49-
else stdenv;
50-
})
51-
.overrideAttrs (finalAttrs: previousAttrs: {
52-
# Based on https://github.com/google/or-tools/commit/af44f98dbeb905656b5a9fc664b5fdcffcbe1f60
53-
# Stops CMake going haywire on reconfigures
54-
postPatch =
55-
previousAttrs.postPatch
56-
+ ''
57-
sed -Ei.bak 's/(NOT\s+\w+_FOUND\s+AND\s+)+//' cmake/ortoolsConfig.cmake.in
58-
sed -Ei.bak 's/NOT absl_FOUND/NOT TARGET absl::base/' cmake/ortoolsConfig.cmake.in
59-
'';
60-
});
48+
stdenv = if stdenv.isDarwin then (overrideSDK stdenv "11.0") else stdenv;
49+
}).overrideAttrs
50+
(
51+
finalAttrs: previousAttrs: {
52+
# Based on https://github.com/google/or-tools/commit/af44f98dbeb905656b5a9fc664b5fdcffcbe1f60
53+
# Stops CMake going haywire on reconfigures
54+
postPatch = previousAttrs.postPatch + ''
55+
sed -Ei.bak 's/(NOT\s+\w+_FOUND\s+AND\s+)+//' cmake/ortoolsConfig.cmake.in
56+
sed -Ei.bak 's/NOT absl_FOUND/NOT TARGET absl::base/' cmake/ortoolsConfig.cmake.in
57+
'';
58+
}
59+
);
6160
fetchedGtest = fetchzip {
6261
url = "https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip";
6362
sha256 = "sha256-t0RchAHTJbuI5YW4uyBPykTvcjy90JW9AOPNjIhwh6U=";
6463
};
65-
lemon-graph' =
66-
lemon-graph.overrideAttrs (finalAttrs: previousAttrs: {
64+
lemon-graph' = lemon-graph.overrideAttrs (
65+
finalAttrs: previousAttrs: {
6766
src = fetchFromGitHub {
6867
owner = "The-OpenROAD-Project";
6968
repo = "lemon-graph";
7069
rev = "f871b10396270cfd09ffddc4b6ead07722e9c232";
7170
sha256 = "snqjc82vtgKC5uGu7V6Hhcf7YzRk0xHJDEOCN91iywI=";
7271
};
73-
});
72+
}
73+
);
7474
self = clangStdenv.mkDerivation (finalAttrs: {
7575
name = "openroad";
7676

@@ -83,58 +83,62 @@
8383
"-DVERBOSE=1"
8484
"-DFETCHCONTENT_SOURCE_DIR_GOOGLETEST=${fetchedGtest}"
8585
];
86-
86+
8787
postPatch = ''
8888
patchShebangs .
8989
'';
90-
90+
9191
shellHook = ''
92-
alias ord-format-changed="${git}/bin/git diff --name-only | grep -E '\.(cpp|cc|c|h|hh)$' | xargs clang-format -i -style=file:.clang-format";
92+
alias ord-format-changed="${git}/bin/git diff --name-only | grep -E '\.(cpp|cc|c|h|hh)$' | xargs clang-format -i -style=file:.clang-format";
9393
'';
94-
94+
9595
qt5Libs = [
9696
libsForQt5.qt5.qtbase
9797
libsForQt5.qt5.qtcharts
9898
libsForQt5.qt5.qtsvg
9999
libsForQt5.qt5.qtdeclarative
100100
];
101-
102-
QT_PLUGIN_PATH = lib.makeSearchPathOutput "bin" "lib/qt-${libsForQt5.qt5.qtbase.version}/plugins" self.qt5Libs;
101+
102+
QT_PLUGIN_PATH =
103+
lib.makeSearchPathOutput "bin" "lib/qt-${libsForQt5.qt5.qtbase.version}/plugins"
104+
self.qt5Libs;
103105

104106
buildInputs = self.qt5Libs ++ [
105-
boost183
106-
eigen
107+
abseil-cpp
108+
boost189
109+
cbc
110+
clp
107111
cudd
108-
tcl
112+
eigen
113+
glpk
114+
gtest
115+
libffi
116+
llvmPackages.openmp
109117
python3
118+
re2
110119
readline
111-
tclreadline
112120
spdlog
113-
libffi
114-
llvmPackages.openmp
121+
tcl
122+
tclreadline
123+
yaml-cpp
124+
zlib
115125

116-
lemon-graph'
126+
# Local derivations
117127
or-tools'
118-
glpk
119-
zlib
120-
clp
121-
cbc
122-
re2
123-
gtest
124-
yaml-cpp
128+
lemon-graph'
125129
];
126130

127131
nativeBuildInputs = [
128-
swig4
129-
pkg-config
132+
bison
133+
clang-tools
130134
cmake
131-
ninja
132-
gnumake
133135
flex
134-
bison
136+
gnumake
135137
libsForQt5.wrapQtAppsHook
136-
clang-tools_14
138+
ninja
139+
pkg-config
140+
swig
137141
];
138142
});
139143
in
140-
self
144+
self

etc/bazel-make-compilation-db.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ done >> compile_flags.txt
4949
# Qt include files check for this
5050
echo '-fPIC' >> compile_flags.txt
5151

52+
# Python include bindings.
53+
for f in bazel-out/../../../external/*/include/python3.*/Python.h; do
54+
if [ -f "${f}" ]; then
55+
PY_INC="$(dirname "${f}")"
56+
echo "-I${PY_INC}"
57+
echo "-I$(realpath "${PY_INC}")" # work around clangd bug
58+
break
59+
fi
60+
done >> compile_flags.txt
61+
5262
# Since we don't do per-file define extraction in compile_flag.txt,
5363
# add them here globally
5464
cat >> compile_flags.txt <<EOF

0 commit comments

Comments
 (0)