Skip to content

Commit d523296

Browse files
oharboeclaude
andcommitted
Strip //:install to developer-only MVP
Add cross-platform dep checking (Ubuntu, RHEL, macOS, openSUSE). Remove verbose help text. Docs: replace outdated Bazel section with //:install, mark as unsupported developer-only path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 91d6187 commit d523296

2 files changed

Lines changed: 69 additions & 35 deletions

File tree

bazel/install.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,40 @@ WORKSPACE="${BUILD_WORKSPACE_DIRECTORY:-.}"
1111
INSTALL_DIR="${WORKSPACE}/tools/install"
1212
NUM_THREADS=$(nproc)
1313

14+
# --- Check system dependencies for yosys/slang builds ---
15+
check_deps() {
16+
local missing_cmds=()
17+
18+
for cmd in bison flex gawk g++ pkg-config tclsh git cmake; do
19+
if ! command -v "$cmd" &>/dev/null; then
20+
missing_cmds+=("$cmd")
21+
fi
22+
done
23+
24+
if [[ ${#missing_cmds[@]} -eq 0 ]]; then
25+
return
26+
fi
27+
28+
echo "ERROR: Missing commands: ${missing_cmds[*]}"
29+
echo ""
30+
31+
# Platform-specific install hint
32+
if [[ "$(uname -s)" == "Darwin" ]]; then
33+
echo " brew install bison flex gawk cmake pkg-config tcl-tk"
34+
elif command -v apt-get &>/dev/null; then
35+
echo " sudo apt-get install bison flex gawk g++ pkg-config tcl cmake git"
36+
elif command -v dnf &>/dev/null; then
37+
echo " sudo dnf install bison flex gawk gcc-c++ pkgconf tcl cmake git"
38+
elif command -v yum &>/dev/null; then
39+
echo " sudo yum install bison flex gawk gcc-c++ pkgconf tcl cmake git"
40+
elif command -v zypper &>/dev/null; then
41+
echo " sudo zypper install bison flex gawk gcc-c++ pkg-config tcl cmake git"
42+
fi
43+
exit 1
44+
}
45+
46+
check_deps
47+
1448
BUILD_OPENROAD=1
1549

1650
usage() {

docs/user/BuildLocally.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
# Build from sources locally
22

3-
## Choose Your Build Path
4-
5-
| Path | Prerequisites | sudo? | Best for |
6-
|------|--------------|-------|----------|
7-
| **CMake** | `sudo ./setup.sh` | Yes | Most users |
8-
| **Nix** | [Nix](https://github.com/DeterminateSystems/nix-installer) | No | Nix users |
9-
| **Bazel** | [Bazelisk](https://bazel.build/install/bazelisk) | No | ORFS/OpenROAD developers only, unsupported |
10-
11-
### CMake
3+
## Clone and Install Dependencies
124

135
The `setup.sh` script installs all of the dependencies, including OpenROAD dependencies, if they are not already installed.
146

@@ -18,26 +10,9 @@ Supported configurations are: Ubuntu 20.04, Ubuntu 22.04, Ubuntu 22.04(aarch64),
1810
git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts
1911
cd OpenROAD-flow-scripts
2012
sudo ./setup.sh
21-
./build_openroad.sh --local
22-
```
23-
24-
:::{Note}
25-
There is a `build_openroad.log` file that is generated with every
26-
build in the main directory. In case of filing issues, it can be uploaded
27-
in the "Relevant log output" section of OpenROAD-flow-scripts repo
28-
[issue form](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/issues/new?assignees=&labels=&template=bug_report_with_orfs.yml).
29-
:::
30-
31-
### Nix
32-
33-
``` shell
34-
git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts
35-
cd OpenROAD-flow-scripts
36-
nix develop
37-
cd flow && make
3813
```
3914

40-
### Bazel
15+
## Using Bazel to build OpenROAD and run the ORFS flow (unsupported)
4116

4217
For ORFS/OpenROAD developers. Most of `./setup.sh` isn't needed when
4318
building OpenROAD with Bazel — this provides the bare minimum to build
@@ -51,10 +26,22 @@ bazelisk run //:install
5126
cd flow && make
5227
```
5328

29+
## Build
30+
31+
``` shell
32+
./build_openroad.sh --local
33+
```
34+
:::{Note}
35+
There is a `build_openroad.log` file that is generated with every
36+
build in the main directory. In case of filing issues, it can be uploaded
37+
in the "Relevant log output" section of OpenROAD-flow-scripts repo
38+
[issue form](https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/issues/new?assignees=&labels=&template=bug_report_with_orfs.yml).
39+
:::
40+
5441
## Verify Installation
5542

5643
The binaries should be available on your `$PATH` after setting
57-
up the environment. The `make` command runs from RTL-GDSII generation for default design `gcd` with `nangate45` PDK.
44+
up the environment. The `make` command runs from RTL-GDSII generation for default design `gcd` with `nangate45` PDK.
5845

5946
``` shell
6047
source ./env.sh
@@ -82,22 +69,35 @@ Set up environment variables using `dev_env.sh`, then start Visual Studio Code.
8269
code tools/OpenROAD/
8370
```
8471

85-
## Build and run ORFS flows with Bazel
72+
## Build OpenROAD and run a few ORFS flows with Bazel
73+
74+
Local use case:
75+
76+
- Install Bazelisk and no other dependencies, no need to run `sudo ./setup.sh`
77+
- Modify & build OpenROAD
78+
- Test built OpenROAD with a few ORFS flows
79+
80+
The Bazel support in OpenROAD and ORFS is work in progress and some Bazel experience is recommended before going spelunking in the Bazel builds.
8681

87-
ORFS uses [bazel-orfs](https://github.com/The-OpenROAD-Project/bazel-orfs) to run
88-
the flow entirely within Bazel. This is separate from `bazelisk run //:install` above
89-
which installs tools for the Makefile-based flow.
82+
Contributions welcome!
9083

91-
To build a design with Bazel:
84+
To build `designs/asap7/gcd:gcd_floorplan`:
9285

9386
cd flow
94-
bazelisk build designs/asap7/gcd:gcd_floorplan
87+
(cd ../tools/OpenROAD && bazel build :openroad -c opt) && bazelisk build designs/asap7/gcd:gcd_floorplan
9588

96-
Or to run all flows currently available in Bazel:
89+
Or to run all flows currently available in Bazel
90+
91+
cd flow
92+
(cd ../tools/OpenROAD && bazel build :openroad -c opt) && bazelisk build ...
93+
94+
Note! ORFS uses the OpenROAD Bazel built binary in stop-gap way until OpenROAD has been switched to bzlmod, after which to build all flows becomes simpler as ORFS will build the requisite OpenROAD directly:
9795

9896
cd flow
9997
bazelisk build ...
10098

99+
ORFS uses [bazel-orfs](https://github.com/The-OpenROAD-Project/bazel-orfs) to implement the flow and gets some depedencies, like yosys, from the Docker image. Over time, all dependencies should be built with Bazel and the dependency on the ORFS Docker image will be phased out.
100+
101101
### Upgrading MODULE.bazel with the latest bazel-orfs and ORFS Docker image
102102

103103
Run:

0 commit comments

Comments
 (0)