Skip to content

gui: Enable gui with bazel#7725

Merged
maliberty merged 13 commits into
The-OpenROAD-Project:masterfrom
QuantamHD:enable_gui_bazel
Jul 15, 2025
Merged

gui: Enable gui with bazel#7725
maliberty merged 13 commits into
The-OpenROAD-Project:masterfrom
QuantamHD:enable_gui_bazel

Conversation

@QuantamHD
Copy link
Copy Markdown
Collaborator

@QuantamHD QuantamHD commented Jul 5, 2025

It is current off by default, and I would like to see others test it before we turn it on by default.

In order to build with the gui you need to pass the platform flag to bazel build. The other major restriction is that only linux is enabled, additional qt work will be required to enable it for macos.

bazelisk build --//:platform=gui //:openroad

@gadfort @oharboe @maliberty Please give it a test on your linux machines/WSL.

I also added a few ifdefs around the regex usage so that we can maintain both the bazel build and the cmake build which is stuck on qt5.

It is current off by default, and I would like to see others
test it before we turn it on by default.

In order to build with the gui you need to pass the platform
flag to bazel build.

`bazelisk build --//:platform=gui //:openroad`

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@QuantamHD
Copy link
Copy Markdown
Collaborator Author

@hzeller FYI

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 6, 2025

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Copy Markdown
Contributor

@gadfort gadfort left a comment

Choose a reason for hiding this comment

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

@QuantamHD I was unable to build this on WSL. Here are some of the warnings:

INFO: From Executing genrule @@qt-bazel+//qt_source:UIC__qtbase-6.9.1_src_widgets_dialogs_qfiledialog.ui:
Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
If this causes problems, reconfigure your locale. See the locale(1) manual
for more information.

INFO: From Generating MOC code from external/qt-bazel+/qt_source/qtcharts-6.9.1/src/charts/glwidget_p.h:
external/qt-bazel+/qt_source/qtcharts-6.9.1/src/charts/glwidget_p.h: note: No relevant classes found. No output generated.

Errors from linking:

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
ld.lld: error: undefined reference: __isoc23_strtol
>>> referenced by bazel-out/k8-fastbuild/bin/_solib_k8/_U_A_Aqt-bazel+_S_Sinterface_Ulibs_Sxkbcommon_Cxkbcommon_Uifso___Uinterface_Ulibs_Sxkbcommon/libxkbcommon.ifso (disallowed by --no-allow-shlib-undefined)

ld.lld: error: undefined reference: __isoc23_strtoul
>>> referenced by bazel-out/k8-fastbuild/bin/_solib_k8/_U_A_Aqt-bazel+_S_Sinterface_Ulibs_Sxkbcommon_Cxkbcommon_Uifso___Uinterface_Ulibs_Sxkbcommon/libxkbcommon.ifso (disallowed by --no-allow-shlib-undefined)

ld.lld: error: undefined reference: __isoc23_strtol
>>> referenced by bazel-out/k8-fastbuild/bin/_solib_k8/_U_A_Aqt-bazel+_S_Sinterface_Ulibs_Sxcb_Cxcb_Ucursor_Uifso___Uinterface_Ulibs_Sxcb/libxcb-cursor.ifso (disallowed by --no-allow-shlib-undefined)

ld.lld: error: undefined reference: __isoc23_sscanf
>>> referenced by bazel-out/k8-fastbuild/bin/_solib_k8/_U_A_Aqt-bazel+_S_Sinterface_Ulibs_SX11_Cx11_Uifso___Uinterface_Ulibs_SX11/libX11.ifso (disallowed by --no-allow-shlib-undefined)

ld.lld: error: undefined reference: __isoc23_strtol
>>> referenced by bazel-out/k8-fastbuild/bin/_solib_k8/_U_A_Aqt-bazel+_S_Sinterface_Ulibs_SX11_Cx11_Uifso___Uinterface_Ulibs_SX11/libX11.ifso (disallowed by --no-allow-shlib-undefined)

ld.lld: error: undefined reference: __isoc23_strtoul
>>> referenced by bazel-out/k8-fastbuild/bin/_solib_k8/_U_A_Aqt-bazel+_S_Sinterface_Ulibs_SX11_Cx11_Uifso___Uinterface_Ulibs_SX11/libX11.ifso (disallowed by --no-allow-shlib-undefined)

ld.lld: error: undefined reference: __isoc23_strtol
>>> referenced by bazel-out/k8-fastbuild/bin/_solib_k8/_U_A_Aqt-bazel+_S_Sinterface_Ulibs_SX11_Cx11_Uice_Uifso___Uinterface_Ulibs_SX11/libICE.ifso (disallowed by --no-allow-shlib-undefined)

ld.lld: error: undefined reference: arc4random_buf
>>> referenced by bazel-out/k8-fastbuild/bin/_solib_k8/_U_A_Aqt-bazel+_S_Sinterface_Ulibs_SX11_Cx11_Uice_Uifso___Uinterface_Ulibs_SX11/libICE.ifso (disallowed by --no-allow-shlib-undefined)

Comment thread src/gui/src/mainWindow.cpp Outdated
Comment thread src/gui/src/displayControls.cpp Outdated
Comment thread MODULE.bazel
Comment thread third-party/gif-h/BUILD.bazel Outdated
@maliberty
Copy link
Copy Markdown
Member

Fails on qt5:

[2025-07-06T00:07:23.608Z] #8 183.8 /OpenROAD/src/gui/src/mainWindow.cpp:93:22: error: 'class gui::MainWindow' has no member named 'screen'
[2025-07-06T00:07:23.608Z] #8 183.8    93 |   QSize size = this->screen()->availableGeometry().size();
[2025-07-06T00:07:23.608Z] #8 183.8       |         

@maliberty
Copy link
Copy Markdown
Member

It built for me but how do you actually run it?

./bazel-bin/openroad -gui
./bazel-bin/openroad: error while loading shared libraries: libxcb-cursor.so.0: cannot open shared object file: No such file or directory

@maliberty
Copy link
Copy Markdown
Member

No luck with bazelisk run --//:platform=gui //:openroad either

@oharboe
Copy link
Copy Markdown
Collaborator

oharboe commented Jul 6, 2025

On Ubuntu 25.04 I get the error below:

$ bazelisk build --//:platform=gui //:openroad --keep_going
INFO: Invocation ID: 5a9e4e13-7337-4252-a4e5-51d84887fa10
INFO: Analyzed target //:openroad (0 packages loaded, 0 targets configured).
ERROR: /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/BUILD.bazel:126:10: Linking openroad failed: (Exit 1): cc_wrapper.sh failed: error executing CppLink command (from target //:openroad) external/toolchains_llvm++llvm+llvm_toolchain/bin/cc_wrapper.sh @bazel-out/k8-fastbuild/bin/openroad-0.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
ld.lld: error: undefined symbol: std::__glibcxx_assert_fail(char const*, int, char const*, char const*)
>>> referenced by utilPth.c
>>>               bazel-out/k8-fastbuild/bin/external/edu_berkeley_abc/_objs/abc-lib/utilPth.pic.o:(std::atomic<bool>::load(std::memory_order) const)
>>> referenced by utilPth.c
>>>               bazel-out/k8-fastbuild/bin/external/edu_berkeley_abc/_objs/abc-lib/utilPth.pic.o:(std::atomic<bool>::load(std::memory_order) const)
>>> referenced by utilPth.c
>>>               bazel-out/k8-fastbuild/bin/external/edu_berkeley_abc/_objs/abc-lib/utilPth.pic.o:(std::atomic<bool>::store(bool, std::memory_order))
>>> referenced 2 more times
clang: error: linker command failed with exit code 1 (use -v to see invocation)
INFO: Found 1 target...
Target //:openroad failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.642s, Critical Path: 1.30s
INFO: 2 processes: 2 internal.
ERROR: Build did NOT complete successfully

@oharboe
Copy link
Copy Markdown
Collaborator

oharboe commented Jul 6, 2025

On Ubuntu 25.04, I can get it to build if I use the trick from #7349:

bazelisk build --cxxopt=-stdlib=libstdc++ --linkopt=-lstdc++ --//:platform=gui //:openroad --keep_going

But it doesn't run:

$ bazel-bin/openroad -gui
bazel-bin/openroad: error while loading shared libraries: libxcb-cursor.so.0: cannot open shared object file: No such file or directory

If I run sudo apt install libxcb-cursor0, then OpenROAD starts.

@oharboe
Copy link
Copy Markdown
Collaborator

oharboe commented Jul 6, 2025

Trying something more advanced in Ubuntu 25.04:

$ /tmp/grt/make OPENROAD_EXE=$(pwd)/bazel-bin/openroad gui_grt
++ dirname /tmp/grt/make
+ cd /tmp/grt/_main
+ exec ./make_BoomTile_grt_base_5_1_grt OPENROAD_EXE=/home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad gui_grt
ODB_FILE=.//results/asap7/BoomTile/base/5_1_grt.odb /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad -gui  external/bazel-orfs++orfs_repositories+docker_orfs/OpenROAD-flow-scripts/flow/scripts/open.tcl
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
Signal 11 received
Stack trace:
 0# 0x0000637BD75AB010 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
 1# 0x000077FF95045810 in /lib/x86_64-linux-gnu/libc.so.6
 2# 0x0000637BDE3A7062 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
 3# 0x0000637BDE3A701A in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
 4# 0x0000637BDE3A87A4 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
 5# 0x0000637BD7617C55 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
 6# 0x0000637BD7617DB7 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
 7# 0x0000637BDB84DFE5 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
 8# 0x0000637BDB84DF85 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
 9# 0x0000637BDB84DF35 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
10# 0x0000637BDB84DE5D in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
11# 0x0000637BD87730AE in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
12# 0x0000637BDBB6DFA3 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
13# 0x0000637BDBA74CF9 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
14# 0x0000637BDB84A242 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
15# 0x0000637BD75AB390 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
16# 0x0000637BD75AB25D in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
17# 0x0000637BD75AB226 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
18# 0x0000637BDE4C141E in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
19# 0x0000637BD75AAF55 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
20# 0x000077FF9502A338 in /lib/x86_64-linux-gnu/libc.so.6
21# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
22# 0x0000637BD75AABE5 in /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/bazel-bin/openroad
make: *** [external/bazel-orfs++orfs_repositories+docker_orfs/OpenROAD-flow-scripts/flow/Makefile:793: gui_5_1_grt.odb] Segmentation fault (core dumped)
Thread 1 "openroad" received signal SIGSEGV, Segmentation fault.
0x0000555560129062 in TclEvalEx ()
(gdb) bt
#0  0x0000555560129062 in TclEvalEx ()
#1  0x000055556012901a in Tcl_EvalEx ()
#2  0x000055556012a7a4 in Tcl_Eval ()
#3  0x0000555559399c55 in ord::OpenRoad::getExePath[abi:cxx11]() const ()
#4  0x0000555559399db7 in ord::OpenRoad::getDocsPath[abi:cxx11]() const ()
#5  0x000055555d5cffe5 in gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0::operator()() const ()
#6  0x000055555d5cff85 in void std::__invoke_impl<void, gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0&>(std::__invoke_other, gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0&)
    ()
#7  0x000055555d5cff35 in std::enable_if<is_invocable_r_v<void, gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0&>, void>::type std::__invoke_r<void, gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0&>(gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0&) ()
#8  0x000055555d5cfe5d in std::_Function_handler<void (), gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0>::_M_invoke(std::_Any_data const&) ()
#9  0x000055555a4f50ae in std::function<void ()>::operator()() const ()
#10 0x000055555d8effa3 in gui::TclCmdInputWidget::setTclInterp(Tcl_Interp*, bool, std::function<void ()> const&) ()
#11 0x000055555d7f6cf9 in gui::ScriptWidget::setupTcl(Tcl_Interp*, bool, bool, std::function<void ()> const&) ()
#12 0x000055555d5cc242 in gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool) ()
#13 0x000055555932d390 in tclAppInit(int&, char**, char const*, Tcl_Interp*) ()
#14 0x000055555932d25d in ord::tclInit(Tcl_Interp*) ()
#15 0x000055555932d226 in ord::tclAppInit(Tcl_Interp*) ()
#16 0x000055556024341e in Tcl_MainEx ()
#17 0x000055555932cf55 in main ()

Lets ram that square peg into the round hole and see if we get further...

$ git diff
diff --git a/src/OpenRoad.cc b/src/OpenRoad.cc
index 1537ef627b..2cb15e88b9 100644
--- a/src/OpenRoad.cc
+++ b/src/OpenRoad.cc
@@ -590,13 +590,22 @@ int OpenRoad::getThreadCount()
 
 std::string OpenRoad::getExePath() const
 {
   // use tcl since it already has a cross platform implementation of this
+  if (tcl_interp_ == nullptr) {
+    std::cerr << "Tcl interpreter is not initialized." << std::endl;
+    return "";
+  }

Now it crashes at:

0x000055555939a5cc in sta::dbSta::getDbNetwork() ()
(gdb) bt
#0  0x000055555939a5cc in sta::dbSta::getDbNetwork() ()
#1  0x000055555d5fd32f in gui::DisplayControls::setSTA(sta::dbSta*) ()
#2  0x000055555d76f3c9 in gui::MainWindow::init(sta::dbSta*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#3  0x000055555d5d01b6 in gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0::operator()() const ()
#4  0x000055555d5d0145 in void std::__invoke_impl<void, gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0&>(std::__invoke_other, gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0&)
    ()
#5  0x000055555d5d00f5 in std::enable_if<is_invocable_r_v<void, gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0&>, void>::type std::__invoke_r<void, gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0&>(gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0&) ()
#6  0x000055555d5d001d in std::_Function_handler<void (), gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool)::$_0>::_M_invoke(std::_Any_data const&) ()
#7  0x000055555a4f526e in std::function<void ()>::operator()() const ()
#8  0x000055555d8f0163 in gui::TclCmdInputWidget::setTclInterp(Tcl_Interp*, bool, std::function<void ()> const&) ()
#9  0x000055555d7f6eb9 in gui::ScriptWidget::setupTcl(Tcl_Interp*, bool, bool, std::function<void ()> const&) ()
#10 0x000055555d5cc402 in gui::startGui(int&, char**, Tcl_Interp*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool) ()
#11 0x000055555932d390 in tclAppInit(int&, char**, char const*, Tcl_Interp*) ()
#12 0x000055555932d25d in ord::tclInit(Tcl_Interp*) ()
#13 0x000055555932d226 in ord::tclAppInit(Tcl_Interp*) ()
#14 0x00005555602435de in Tcl_MainEx ()
#15 0x000055555932cf55 in main ()

@hzeller
Copy link
Copy Markdown
Collaborator

hzeller commented Jul 6, 2025

Can't compile: apparently there is a pcre2.h dependency inside Qt that is not captured in the corresponding build file.

bazel build @qt-bazel//qt_source:bootstrap
external/.../qtbase-6.9.1/src/corelib/text/qregularexpression.cpp:25:10: fatal error: 'pcre2.h' file not found
   25 | #include <pcre2.h>
      |          ^~~~~~~~~

@gadfort
Copy link
Copy Markdown
Contributor

gadfort commented Jul 6, 2025

@QuantamHD on my ubuntu24 machine, I got the gui open, but it segfaulted the moment I tried to open a file:

Signal 11 received
Stack trace:
 0# 0x0000588D71750C42 in ./bazel-bin/openroad
 1# 0x0000729AD2C45330 in /lib/x86_64-linux-gnu/libc.so.6
 2# std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) in ./bazel-bin/openroad
 3# 0x0000588D782B1E35 in ./bazel-bin/openroad
 4# 0x0000588D782B1C08 in ./bazel-bin/openroad
 5# 0x0000588D782AF4A4 in ./bazel-bin/openroad
 6# rules_cc::cc::runfiles::Runfiles::Rlocation(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) const in ./bazel-bin/openroad
 7# 0x0000588D76DF0950 in ./bazel-bin/openroad
 8# 0x0000588D76C7EF00 in ./bazel-bin/openroad
 9# 0x0000588D76DF0877 in ./bazel-bin/openroad
10# 0x0000588D76D82E2E in ./bazel-bin/openroad
11# 0x0000588D76D8353B in ./bazel-bin/openroad
12# 0x0000588D76CFF4B4 in ./bazel-bin/openroad
13# 0x0000588D76CFF942 in ./bazel-bin/openroad
14# 0x0000588D76CFF757 in ./bazel-bin/openroad
15# 0x0000588D76D0A782 in ./bazel-bin/openroad
16# 0x0000588D76CFC3FD in ./bazel-bin/openroad
17# 0x0000588D76CFC65D in ./bazel-bin/openroad
18# 0x0000588D76D0C889 in ./bazel-bin/openroad
19# 0x0000588D76AF930B in ./bazel-bin/openroad
20# 0x0000588D769FE151 in ./bazel-bin/openroad
21# 0x0000588D7652FC1F in ./bazel-bin/openroad
22# 0x0000588D76530685 in ./bazel-bin/openroad
23# 0x0000588D769A59E3 in ./bazel-bin/openroad
24# 0x0000588D75D71084 in ./bazel-bin/openroad
25# 0x0000588D75D71EF7 in ./bazel-bin/openroad
26# 0x0000588D759446C5 in ./bazel-bin/openroad
27# 0x0000588D76965301 in ./bazel-bin/openroad
28# 0x0000588D76BA4E28 in ./bazel-bin/openroad
29# 0x0000588D76C0D001 in ./bazel-bin/openroad
30# 0x0000588D76C0ADD3 in ./bazel-bin/openroad
31# 0x0000588D76C0AFCE in ./bazel-bin/openroad
32# 0x0000588D76C0B03F in ./bazel-bin/openroad
33# 0x0000588D76BA48DE in ./bazel-bin/openroad
34# 0x0000588D7696D2E6 in ./bazel-bin/openroad
35# 0x0000588D75F76C7E in ./bazel-bin/openroad
36# 0x0000588D75F867AB in ./bazel-bin/openroad
37# 0x0000588D75F86602 in ./bazel-bin/openroad
38# 0x0000588D75AF5328 in ./bazel-bin/openroad
39# 0x0000588D75954E81 in ./bazel-bin/openroad
40# 0x0000588D75954E19 in ./bazel-bin/openroad
41# 0x0000588D75954DDE in ./bazel-bin/openroad
42# 0x0000588D75954D6D in ./bazel-bin/openroad
43# 0x0000588D75954C96 in ./bazel-bin/openroad
44# 0x0000588D769B1D5D in ./bazel-bin/openroad
45# 0x0000588D764A7978 in ./bazel-bin/openroad
46# 0x0000588D75EF2C8A in ./bazel-bin/openroad
47# 0x0000588D75EF078A in ./bazel-bin/openroad
48# 0x0000588D75EF74D6 in ./bazel-bin/openroad
49# 0x0000588D75DBFF98 in ./bazel-bin/openroad
50# 0x0000588D75EF7BB7 in ./bazel-bin/openroad
51# 0x0000588D75D71084 in ./bazel-bin/openroad
52# 0x0000588D75D7333D in ./bazel-bin/openroad
53# 0x0000588D759446C5 in ./bazel-bin/openroad
54# 0x0000588D76964C23 in ./bazel-bin/openroad
55# 0x0000588D75D71684 in ./bazel-bin/openroad
56# 0x0000588D75DD7040 in ./bazel-bin/openroad
57# 0x0000588D75DD5F84 in ./bazel-bin/openroad
58# 0x0000588D75D71084 in ./bazel-bin/openroad
59# 0x0000588D75D71EF7 in ./bazel-bin/openroad
60# 0x0000588D759446C5 in ./bazel-bin/openroad
61# 0x0000588D76964C23 in ./bazel-bin/openroad
62# 0x0000588D761C122B in ./bazel-bin/openroad
63# 0x0000588D7621260B in ./bazel-bin/openroad
64# 0x0000588D7610E55F in ./bazel-bin/openroad
65# 0x0000588D76C0D001 in ./bazel-bin/openroad
66# 0x0000588D76C0ADD3 in ./bazel-bin/openroad
67# 0x0000588D76C0AFCE in ./bazel-bin/openroad
68# 0x0000588D76C0B03F in ./bazel-bin/openroad
69# 0x0000588D76BA48DE in ./bazel-bin/openroad
70# 0x0000588D7696D2E6 in ./bazel-bin/openroad
71# 0x0000588D76964854 in ./bazel-bin/openroad
72# 0x0000588D759371CA in ./bazel-bin/openroad
73# 0x0000588D71750F7B in ./bazel-bin/openroad
74# 0x0000588D71750E8D in ./bazel-bin/openroad
75# 0x0000588D71750E56 in ./bazel-bin/openroad
76# 0x0000588D783D430E in ./bazel-bin/openroad
77# 0x0000588D71750B95 in ./bazel-bin/openroad
78# 0x0000729AD2C2A1CA in /lib/x86_64-linux-gnu/libc.so.6
79# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
80# 0x0000588D71750825 in ./bazel-bin/openroad
Segmentation fault (core dumped)

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

…screen size on QT5

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@QuantamHD
Copy link
Copy Markdown
Collaborator Author

@maliberty @gadfort @oharboe Please give it another go.

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@QuantamHD
Copy link
Copy Markdown
Collaborator Author

Can't compile: apparently there is a pcre2.h dependency inside Qt that is not captured in the corresponding build file.

bazel build @qt-bazel//qt_source:bootstrap
external/.../qtbase-6.9.1/src/corelib/text/qregularexpression.cpp:25:10: fatal error: 'pcre2.h' file not found
   25 | #include <pcre2.h>
      |          ^~~~~~~~~

@hzeller This should be fixed.

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

2 similar comments
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@QuantamHD
Copy link
Copy Markdown
Collaborator Author

QuantamHD commented Jul 10, 2025

As an FYI to everyone. This QT build is dynamically linking in X11 libs, because it's generally not advisable to statically link them. As a result on Ubuntu distributions you may run into an error complaining about libxcb-cursor. This is a common problem across all QT6 apps, since this PR also moves us to QT6 from QT5.

See https://stackoverflow.com/questions/77725761/from-6-5-0-xcb-cursor0-or-libxcb-cursor0-is-needed-to-load-the-qt-xcb-platform

You will need to install the runtime shared object. sudo apt-get install -y libxcb-cursor0

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@gadfort
Copy link
Copy Markdown
Contributor

gadfort commented Jul 11, 2025

@QuantamHD still getting the segfault I mention previously on Ubuntu24. But it does link on WSL ubuntu22.

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@QuantamHD
Copy link
Copy Markdown
Collaborator Author

Okay @hzeller try now. I tried to remove the GL deps.

@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@hzeller
Copy link
Copy Markdown
Collaborator

hzeller commented Jul 11, 2025

Still runs into that issue: qplatformintegration.h which includes qopenglcontext.h which in turn includes qopengl.h

In file included from external/qt-bazel~/qt_source/qtbase-6.9.1/src/widgets/graphicsview/qgraphicsview.cpp:248:
In file included from external/qt-bazel~/qt_source/qtbase-6.9.1/src/widgets/graphicsview/qgraphicsview_p.h:25:
In file included from external/qt-bazel~/qt_source/qtbase-6.9.1/build/include/QtWidgets/6.9.1/QtWidgets/private/qabstractscrollarea_p.h:19:
In file included from external/qt-bazel~/qt_source/qtbase-6.9.1/build/include/QtWidgets/6.9.1/QtWidgets/private/qframe_p.h:19:
In file included from external/qt-bazel~/qt_source/qtbase-6.9.1/build/include/QtWidgets/6.9.1/QtWidgets/private/qwidget_p.h:44:
In file included from external/qt-bazel~/qt_source/qtbase-6.9.1/build/include/QtWidgets/6.9.1/QtWidgets/private/qapplication_p.h:38:
In file included from external/qt-bazel~/qt_source/qtbase-6.9.1/build/include/QtGui/6.9.1/QtGui/qpa/qplatformintegration.h:20:
In file included from external/qt-bazel~/qt_source/qtbase-6.9.1/build/include/QtGui/qopenglcontext.h:26:
external/qt-bazel~/qt_source/qtbase-6.9.1/build/include/QtGui/qopengl.h:115:13: fatal error: 'GL/gl.h' file not found
  115 | #   include <GL/gl.h>
      |             ^~~~~~~~~
1 error generated.

The qopenglcontext.h does have an #ifndef QT_NO_OPENGL but apparently that is not picked up here. Maybe the define needs to be added in other places ?

@hzeller
Copy link
Copy Markdown
Collaborator

hzeller commented Jul 11, 2025

There also seems to be a reference to xcb/xcb.h that is not found

$ bazel build --//:platform=gui //:openroad -k 2>&1 | grep "fatal error" | sort -u
external/qt-bazel~/qt_source/qtbase-6.9.1/build/include/QtGui/qopengl.h:115:13: fatal error: 'GL/gl.h' file not found
external/qt-bazel~/qt_source/qtbase-6.9.1/src/gui/platform/unix/qtx11extras_p.h:21:10: fatal error: 'xcb/xcb.h' file not found

@oharboe
Copy link
Copy Markdown
Collaborator

oharboe commented Jul 11, 2025

Still fails:

$ bazelisk build --//:platform=gui //:openroad
[deleted]
ERROR: /home/oyvind/OpenROAD-flow-scripts/tools/OpenROAD/BUILD.bazel:126:10: Linking openroad failed: (Exit 1): cc_wrapper.sh failed: error executing CppLink command (from target //:openroad) external/toolchains_llvm++llvm+llvm_toolchain/bin/cc_wrapper.sh @bazel-out/k8-fastbuild/bin/openroad-0.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
ld.lld: error: undefined symbol: std::__glibcxx_assert_fail(char const*, int, char const*, char const*)
>>> referenced by utilPth.c
>>>               bazel-out/k8-fastbuild/bin/external/edu_berkeley_abc/_objs/abc-lib/utilPth.pic.o:(std::atomic<bool>::load(std::memory_order) const)
>>> referenced by utilPth.c
>>>               bazel-out/k8-fastbuild/bin/external/edu_berkeley_abc/_objs/abc-lib/utilPth.pic.o:(std::atomic<bool>::load(std::memory_order) const)
>>> referenced by utilPth.c
>>>               bazel-out/k8-fastbuild/bin/external/edu_berkeley_abc/_objs/abc-lib/utilPth.pic.o:(std::atomic<bool>::store(bool, std::memory_order))
>>> referenced 2 more times
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Target //:openroad failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 548.878s, Critical Path: 415.43s
INFO: 8705 processes: 1381 action cache hit, 5182 disk cache hit, 2 remote cache hit, 1399 internal, 2122 processwrapper-sandbox.
ERROR: Build did NOT complete successfully

@oharboe
Copy link
Copy Markdown
Collaborator

oharboe commented Jul 11, 2025

Worked using workaround:

make OPENROAD_EXE="../tools/OpenROAD/bazel-bin/openroad" gui_final
ODB_FILE=./results/nangate45/gcd/base/6_final.odb ../tools/OpenROAD/bazel-bin/openroad -gui  /home/oyvind/OpenROAD-flow-scripts/flow/scripts/open.tcl
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
OpenROAD HDL-HEAD bazel-build
Features included (+) or not (-): -GPU +GUI -Python : fastbuild
This program is licensed under the BSD-3 license. See the LICENSE file for details.
Components of this program may be licensed under more restrictive licenses which must be honored.
read_db ./results/nangate45/gcd/base/6_final.odb
GUI_TIMING=1 reading timing, takes a little while for large designs...
read_sdc /home/oyvind/OpenROAD-flow-scripts/flow/results/nangate45/gcd/base/6_final.sdc
read_spef ./results/nangate45/gcd/base/6_final.spef
find_timing_paths
gui::select_chart "Endpoint Slack"
gui::update_timing_report
image

@oharboe
Copy link
Copy Markdown
Collaborator

oharboe commented Jul 11, 2025

Tried on a larger design, megaboom. Worked!

Perhaps merge (soon) as a starting point for further refinements & testing. I don't think we'll see a whole lot more testing until it is in master and enabled by default. I prefer working with some snags in the GUI and using a bazel build over cmake / sudo ./setup.sh hell (I don't have any specific snags that are holding me up, but I'd need to switch to day-to-day use).

Comment thread src/gui/src/gui.cpp
Comment on lines +1552 to +1554
std::cout << "Your system has set QT_QPA_PLATFORM='" << qpa_platform
<< "', openroad only supports 'offscreen' and 'xcb', please "
"include one of these plugins in your platform env\n";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure if it matters, but it would be nice to format this like a logger message (in the case that this is called via gui::show the logger is ready.

@gadfort
Copy link
Copy Markdown
Contributor

gadfort commented Jul 11, 2025

@oharboe that is great to hear. I would like to run this through its paces to make sure any obvious issues have I would encounter would appear before merging. Is the linking issue you seeing related to this PR? it seems to stem from abc, but maybe open an issue once this merges so it can be tracked.
@QuantamHD thanks. I'll give it a spin on a couple of my machines today and let you know how it goes.

@gadfort
Copy link
Copy Markdown
Contributor

gadfort commented Jul 11, 2025

@QuantamHD I tried saving an image and got:

227486 external/tcmalloc+/tcmalloc/internal/memory_tag.h:66] CHECK in IsNormalMemory: res == (GetMemoryTag(ptr) == MemoryTag::kNormalP0 || GetMemoryTag(ptr) == MemoryTag::kNormalP1) (false) ptr=0x7ffcd4a80380 res=1 tag=7
Signal 6 received
Stack trace:
 0# 0x00006054483B3D82 in ./bazel-bin/openroad
 1# 0x00007A9430045330 in /lib/x86_64-linux-gnu/libc.so.6
 2# pthread_kill in /lib/x86_64-linux-gnu/libc.so.6
 3# gsignal in /lib/x86_64-linux-gnu/libc.so.6
 4# abort in /lib/x86_64-linux-gnu/libc.so.6
 5# 0x000060544F22A611 in ./bazel-bin/openroad
 6# 0x000060544F22A4DD in ./bazel-bin/openroad
 7# 0x000060544F1A215E in ./bazel-bin/openroad
 8# 0x000060544F1A1D22 in ./bazel-bin/openroad
 9# operator delete(void*, unsigned long) in ./bazel-bin/openroad
10# 0x000060544CE59A4D in ./bazel-bin/openroad
11# 0x000060544CA3A16B in ./bazel-bin/openroad
Aborted (core dumped)

It doesn't happen when running via a script, but if I right click and save image from there it generated that error.

@oharboe
Copy link
Copy Markdown
Collaborator

oharboe commented Jul 11, 2025

@oharboe that is great to hear. I would like to run this through its paces to make sure any obvious issues have I would encounter would appear before merging. Is the linking issue you seeing related to this PR? it seems to stem from abc, but maybe open an issue once this merges so it can be tracked. @QuantamHD thanks. I'll give it a spin on a couple of my machines today and let you know how it goes.

I think we should worry mostly about regressions to CMake built OpenROAD and bazel CI before merging, given that this is gated by a flag.

We can continue to chip away at things one at the time after merging.

I added a feature request to put the bazel built openroad alongside cmake built in the docker image to make it easier to widen testing in CI and with bazel-orfs: #7790

@maliberty
Copy link
Copy Markdown
Member

I'm ok to merge and refine in follow on PRs if that is ok with @QuantamHD

We don't use OpenGL today but I could imagine using it in the future fwiw.

@QuantamHD
Copy link
Copy Markdown
Collaborator Author

I'm fine to merge as is.

Comment thread src/dbSta/include/db_sta/dbSta.hh
@hzeller
Copy link
Copy Markdown
Collaborator

hzeller commented Jul 12, 2025

Looks like one more reason to always IWYU instead of forward declaring.

@maliberty
Copy link
Copy Markdown
Member

Looks like one more reason to always IWYU instead of forward declaring.

No these are abstract types and they are never defined.

…STA types

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@QuantamHD
Copy link
Copy Markdown
Collaborator Author

@maliberty Added the additional documentation.

@gadfort I fixed the screenshot saving.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread src/dbSta/include/db_sta/dbSta.hh
Comment thread src/dbSta/include/db_sta/dbSta.hh
Comment thread src/dbSta/include/db_sta/dbSta.hh
Comment thread src/dbSta/include/db_sta/dbSta.hh
Comment thread src/dbSta/include/db_sta/dbSta.hh
Comment thread src/dbSta/include/db_sta/dbSta.hh
Comment thread src/dbSta/include/db_sta/dbSta.hh
Comment thread src/dbSta/include/db_sta/dbSta.hh
Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@github-actions
Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@maliberty maliberty requested a review from gadfort July 15, 2025 05:35
@maliberty maliberty merged commit 5b9b002 into The-OpenROAD-Project:master Jul 15, 2025
11 checks passed
@gadfort
Copy link
Copy Markdown
Contributor

gadfort commented Jul 15, 2025

@maliberty might be nice to add a build in the CI for this configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants