Skip to content

Commit bff58bc

Browse files
committed
Merge remote-tracking branch 'origin/master' into 3dblox-parser
Signed-off-by: osamahammad21 <[email protected]>
2 parents 6f5385a + 143ce01 commit bff58bc

File tree

161 files changed

+81805
-1369
lines changed

Some content is hidden

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

161 files changed

+81805
-1369
lines changed

BUILD.bazel

Lines changed: 24 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# Copyright (c) 2025-2025, The OpenROAD Authors
33

44
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
5+
load("//bazel:python_wrap_cc.bzl", "PYTHON_STABLE_API_DEFINE", "python_wrap_cc")
56
load("//bazel:tcl_encode_or.bzl", "tcl_encode")
67
load("//bazel:tcl_wrap_cc.bzl", "tcl_wrap_cc")
7-
load("//bazel:python_wrap_cc.bzl", "python_wrap_cc", "PYTHON_STABLE_API_DEFINE")
88

99
package(
1010
features = [
@@ -44,8 +44,6 @@ config_setting(
4444
},
4545
)
4646

47-
# TODO: once project is properly decomposed, we don't
48-
# need these blanked dependencies in multiple places anymore.
4947
OPENROAD_LIBRARY_DEPS = [
5048
":openroad_version",
5149
":ord",
@@ -138,16 +136,19 @@ cc_binary(
138136
name = "openroad",
139137
srcs = [
140138
"src/Main.cc",
141-
"//bazel:runfiles",
142139
],
143140
copts = OPENROAD_COPTS,
144141
features = ["-use_header_modules"],
145-
malloc = "@tcmalloc//tcmalloc",
142+
malloc = select({
143+
"@platforms//os:linux": "@tcmalloc//tcmalloc",
144+
"@platforms//os:macos": "@bazel_tools//tools/cpp:malloc",
145+
}),
146146
visibility = ["//visibility:public"],
147147
deps = [
148148
":openroad_lib",
149149
":openroad_version",
150150
":ord",
151+
"//bazel:runfiles",
151152
"//src/cut",
152153
"//src/gui",
153154
"//src/sta:opensta_lib",
@@ -165,25 +166,6 @@ GUI_BUILD_FLAGS = select(
165166
},
166167
)
167168

168-
cc_library(
169-
name = "openroad_lib_private",
170-
srcs = [
171-
"src/Design.cc",
172-
"src/Tech.cc",
173-
"src/Timing.cc",
174-
],
175-
copts = OPENROAD_COPTS,
176-
defines = OPENROAD_DEFINES + GUI_BUILD_FLAGS,
177-
features = ["-use_header_modules"],
178-
includes = [
179-
"include",
180-
],
181-
deps = OPENROAD_LIBRARY_DEPS + [
182-
"//src/sta:opensta_lib",
183-
"@tk_tcl//:tcl",
184-
],
185-
)
186-
187169
cc_library(
188170
name = "openroad_lib",
189171
srcs = [
@@ -267,39 +249,38 @@ tcl_wrap_cc(
267249
],
268250
)
269251

270-
271252
# This target compiles the SWIG C++ wrapper into a shared library (.so)
272253
# that Python can load dynamically.
273254
cc_binary(
274255
name = "_openroadpy.so",
275256
srcs = [":openroad_swig-py"],
257+
defines = [PYTHON_STABLE_API_DEFINE],
276258
linkshared = True,
277259
deps = [
278260
":openroad_lib", # Depends on the core odb C++ library
279261
":ord",
280-
"//src/odb",
281-
"//src/ifp",
282-
"//src/utl",
283-
"//src/gpl",
284262
"//src/ant",
285263
"//src/cts",
286264
"//src/dpl",
287265
"//src/drt",
288266
"//src/exa",
289267
"//src/fin",
268+
"//src/gpl",
290269
"//src/grt",
270+
"//src/gui",
271+
"//src/ifp",
272+
"//src/odb",
291273
"//src/par",
292274
"//src/pdn",
293275
"//src/ppl",
294276
"//src/psm",
295277
"//src/rcx",
296278
"//src/stt",
297-
"//src/gui",
298279
"//src/tap",
280+
"//src/utl",
299281
"@boost.stacktrace",
300282
"@openroad_rules_python//python/cc:current_py_cc_headers",
301283
],
302-
defines = [PYTHON_STABLE_API_DEFINE],
303284
)
304285

305286
# This packages the SWIG-generated Python wrapper (odb.py) and the
@@ -309,23 +290,23 @@ py_library(
309290
srcs = [":openroad_swig-py"], # Use the .py output from the swig-py rule
310291
# The data attribute makes the .so file available at runtime.
311292
data = [":_openroadpy.so"],
293+
# This allows imports relative to the workspace root.
294+
imports = ["."],
295+
visibility = ["//visibility:public"],
312296
deps = [
313-
"//src/utl:utl_py",
314297
"//src/odb:odb_py",
298+
"//src/utl:utl_py",
315299
],
316-
# This allows imports relative to the workspace root.
317-
imports = ["."],
318-
visibility = ["//visibility:public",]
319300
)
320301

321302
python_wrap_cc(
322303
name = "openroad_swig-py",
323304
srcs = [
324-
"src/OpenRoad-py.i",
325-
":error_swig-py",
326-
"include/ord/Tech.h",
327305
"include/ord/Design.h",
306+
"include/ord/Tech.h",
328307
"include/ord/Timing.h",
308+
"src/OpenRoad-py.i",
309+
":error_swig-py",
329310
],
330311
module = "openroadpy",
331312
root_swig_src = "src/OpenRoad-py.i",
@@ -334,25 +315,25 @@ python_wrap_cc(
334315
"src",
335316
],
336317
deps = [
337-
"//src/gpl:swig-py",
338-
"//src/ifp:swig-py",
339318
"//src/ant:swig-py",
340319
"//src/cts:swig-py",
341320
"//src/dpl:swig-py",
342321
"//src/drt:swig-py",
343322
"//src/exa:swig-py",
344323
"//src/fin:swig-py",
324+
"//src/gpl:swig-py",
345325
"//src/grt:swig-py",
326+
"//src/ifp:swig-py",
327+
"//src/odb:swig-py",
346328
"//src/par:swig-py",
347329
"//src/pdn:swig-py",
348330
"//src/ppl:swig-py",
349331
"//src/psm:swig-py",
350332
"//src/rcx:swig-py",
351333
"//src/stt:swig-py",
352334
"//src/tap:swig-py",
353-
"//src/odb:swig-py",
354335
"//src/utl:swig-py",
355-
]
336+
],
356337
)
357338

358339
filegroup(
@@ -376,4 +357,4 @@ filegroup(
376357
srcs = [
377358
"src/Design.i",
378359
],
379-
)
360+
)

MODULE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ bazel_dep(name = "bazel-orfs")
154154
# To bump version, run: bazelisk run @bazel-orfs//:bump
155155
git_override(
156156
module_name = "bazel-orfs",
157-
commit = "f9c37f21de8e1095276e878d1628ac7a2f7908ab",
157+
commit = "2cf0198a49a220cfcabae35bba64b0034bbdbffc",
158158
remote = "https://github.com/The-OpenROAD-Project/bazel-orfs.git",
159159
)
160160

@@ -163,10 +163,10 @@ orfs = use_extension("@bazel-orfs//:extension.bzl", "orfs_repositories")
163163
# To bump version, run: bazelisk run @bazel-orfs//:bump
164164
orfs.default(
165165
# Official image https://hub.docker.com/r/openroad/orfs/tags
166-
image = "docker.io/openroad/orfs:v3.0-3780-g2f349ade",
166+
image = "docker.io/openroad/orfs:v3.0-3845-gbefd38218",
167167
# Use OpenROAD of this repo instead of from the docker image
168168
openroad = "//:openroad",
169-
sha256 = "637ffa1af0f224e17e3d5cddbe6b45d9b00102016acc9e866226e8c4e830aeab",
169+
sha256 = "4982a5b87588e4699f11deaed3286cba8b65d144e439c6f5845656abebfc0971",
170170
)
171171
use_repo(orfs, "com_github_nixos_patchelf_download")
172172
use_repo(orfs, "docker_orfs")

MODULE.bazel.lock

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

bazel/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ cc_library(
1616
deps = [
1717
"@rules_cc//cc/runfiles",
1818
],
19+
alwayslink = True,
1920
)

bazel/InitRunFiles.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
#include <optional>
77
#include <string>
88

9+
#if defined(__APPLE__)
10+
#include <mach-o/dyld.h>
11+
#include <sys/param.h>
12+
#endif
13+
914
#include "rules_cc/cc/runfiles/runfiles.h"
1015

1116
// Avoid adding any dependencies like boost.filesystem
@@ -19,7 +24,7 @@ static std::optional<std::string> getProgramLocation()
1924
char result[MAXPATHLEN + 1] = {'\0'};
2025
uint32_t path_len = MAXPATHLEN;
2126
if (_NSGetExecutablePath(result, &path_len) != 0) {
22-
path_len = readlink("/proc/self/exe", result, MAXPATHLEN);
27+
path_len = readlink(result, result, MAXPATHLEN);
2328
}
2429
#else
2530
char result[PATH_MAX + 1] = {'\0'};

etc/DependencyInstaller.sh

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ _installCommonDev() {
7575
spdlogVersion=1.15.0
7676
gtestVersion=1.13.0
7777
gtestChecksum="a1279c6fb5bf7d4a5e0d0b2a4adb39ac"
78-
abslVersion=20250814.0
79-
abslChecksum="016feacd6a6b3b9a47ab844e61f4f7bd"
78+
abslVersion=20240722.0
79+
abslChecksum="740fb8f35ebdf82740c294bde408b9c0"
8080
bisonVersion=3.8.2
8181
bisonChecksum="1e541a097cda9eca675d29dd2832921f"
8282
flexVersion=2.6.4
@@ -322,6 +322,8 @@ _installOrTools() {
322322
os=$1
323323
osVersion=$2
324324
arch=$3
325+
local skipSystemOrTools=$4
326+
325327
orToolsVersionBig=9.11
326328
orToolsVersionSmall=${orToolsVersionBig}.4210
327329

@@ -331,18 +333,20 @@ _installOrTools() {
331333
cd "${baseDir}"
332334

333335
# Disable exit on error for 'find' command, as it might return non zero
334-
set +euo pipefail
335-
LIST=($(find /local* /opt* /lib* /usr* /bin* -type f -name "libortools.so*" 2>/dev/null))
336-
# Bring back exit on error
337-
set -euo pipefail
338-
# Return if right version of or-tools is installed
339-
for lib in ${LIST[@]}; do
340-
if [[ "$lib" =~ .*"/libortools.so.${orToolsVersionSmall}" ]]; then
341-
echo "OR-Tools is already installed"
342-
CMAKE_PACKAGE_ROOT_ARGS+=" -D ortools_ROOT=$(realpath $(dirname $lib)/..) "
343-
return
344-
fi
345-
done
336+
if [[ "${skipSystemOrTools}" == "false" ]]; then
337+
set +euo pipefail
338+
LIST=($(find /local* /opt* /lib* /usr* /bin* -type f -name "libortools.so*" 2>/dev/null))
339+
# Bring back exit on error
340+
set -euo pipefail
341+
# Return if right version of or-tools is installed
342+
for lib in ${LIST[@]}; do
343+
if [[ "$lib" =~ .*"/libortools.so.${orToolsVersionSmall}" ]]; then
344+
echo "OR-Tools is already installed"
345+
CMAKE_PACKAGE_ROOT_ARGS+=" -D ortools_ROOT=$(realpath $(dirname $lib)/..) "
346+
return
347+
fi
348+
done
349+
fi
346350

347351
orToolsPath=${PREFIX:-"/opt/or-tools"}
348352
if [ "$(uname -m)" == "aarch64" ]; then
@@ -791,6 +795,11 @@ Usage: $0 -all
791795
# like working around a firewall. This opens
792796
# vulnerability to man-in-the-middle (MITM)
793797
# attacks.
798+
$0 -skip-system-or-tools
799+
# If true, does not perform a search of system
800+
# paths for a pre-installed or-tools library.
801+
# Instead, will install a separate version
802+
# of or-tools
794803
$0 -save-deps-prefixes=FILE
795804
# Dumps OpenROAD build arguments and variables
796805
# to FILE
@@ -813,6 +822,7 @@ equivalenceDeps="no"
813822
CI="no"
814823
saveDepsPrefixes=""
815824
numThreads=$(nproc)
825+
skipSystemOrTools="false"
816826
# temp dir to download and compile
817827
baseDir=$(mktemp -d /tmp/DependencyInstaller-XXXXXX)
818828

@@ -886,6 +896,9 @@ while [ "$#" -gt 0 ]; do
886896
alias wget="wget --no-check-certificate"
887897
export GIT_SSL_NO_VERIFY=true
888898
;;
899+
-skip-system-or-tools)
900+
skipSystemOrTools="true"
901+
;;
889902
-save-deps-prefixes=*)
890903
saveDepsPrefixes=$(realpath ${1#*=})
891904
;;
@@ -956,7 +969,7 @@ case "${os}" in
956969
else
957970
ubuntuVersion=20.04
958971
fi
959-
_installOrTools "ubuntu" "${ubuntuVersion}" "amd64"
972+
_installOrTools "ubuntu" "${ubuntuVersion}" "amd64" ${skipSystemOrTools}
960973
fi
961974
;;
962975
"Red Hat Enterprise Linux" | "Rocky Linux" | "AlmaLinux")
@@ -982,10 +995,10 @@ case "${os}" in
982995
if [[ "${option}" == "common" || "${option}" == "all" ]]; then
983996
_installCommonDev
984997
if [[ "${rhelVersion}" == "8" ]]; then
985-
_installOrTools "AlmaLinux" "8.10" "x86_64"
998+
_installOrTools "AlmaLinux" "8.10" "x86_64" ${skipSystemOrTools}
986999
fi
9871000
if [[ "${rhelVersion}" == "9" ]]; then
988-
_installOrTools "rockylinux" "9" "amd64"
1001+
_installOrTools "rockylinux" "9" "amd64" ${skipSystemOrTools}
9891002
fi
9901003
fi
9911004
;;
@@ -1012,7 +1025,7 @@ EOF
10121025
fi
10131026
if [[ "${option}" == "common" || "${option}" == "all" ]]; then
10141027
_installCommonDev
1015-
_installOrTools "opensuse" "leap" "amd64"
1028+
_installOrTools "opensuse" "leap" "amd64" ${skipSystemOrTools}
10161029
fi
10171030
cat <<EOF
10181031
To enable GCC-11 you need to run:
@@ -1035,7 +1048,7 @@ EOF
10351048
fi
10361049
if [[ "${option}" == "common" || "${option}" == "all" ]]; then
10371050
_installCommonDev
1038-
_installOrTools "debian" "${debianVersion}" "amd64"
1051+
_installOrTools "debian" "${debianVersion}" "amd64" ${skipSystemOrTools}
10391052
fi
10401053
;;
10411054
*)

0 commit comments

Comments
 (0)