Repository navigation
Add setup-orfs Bazel target for ORFS flow dependency setup #9712
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Setup ORFS dependencies for developers using Bazel for OpenROAD. | ||
| # | ||
| # Invoked via: bazelisk run //:setup-orfs | ||
| # (from the tools/OpenROAD directory) | ||
| # | ||
| # This script: | ||
| # 1. Checks if system packages are installed | ||
| # 2. If not, prints the sudo command to run and exits | ||
| # 3. If yes, builds Yosys/eqy/sby and installs pip packages with | ||
| # user permissions into $ORFS_DIR/dependencies | ||
| # | ||
| # Shares code with ORFS etc/DependencyInstaller.sh via the -bazel flag. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| OR_DIR="${BUILD_WORKSPACE_DIRECTORY:?Must be run via bazelisk run}" | ||
|
|
||
| # Navigate from tools/OpenROAD to the ORFS root | ||
| ORFS_DIR="$(cd "${OR_DIR}/../.." && pwd)" | ||
|
|
||
| if [[ ! -f "${ORFS_DIR}/etc/DependencyInstaller.sh" ]]; then | ||
| echo "ERROR: Cannot find ORFS root at ${ORFS_DIR}" | ||
| echo "This script expects OpenROAD to be at tools/OpenROAD within ORFS." | ||
| exit 1 | ||
| fi | ||
|
|
||
| cd "${ORFS_DIR}" | ||
|
|
||
| # Check for key system packages needed to build Yosys and run the flow. | ||
| # These are installed by: sudo ./etc/DependencyInstaller.sh -base -bazel | ||
| missing=() | ||
| for cmd in gcc g++ bison flex pkg-config tclsh python3; do | ||
| if ! command -v "$cmd" &>/dev/null; then | ||
| missing+=("$cmd") | ||
| fi | ||
| done | ||
|
|
||
| # Also check for key dev libraries via pkg-config | ||
| for lib in tcl libffi zlib; do | ||
| if ! pkg-config --exists "$lib" 2>/dev/null; then | ||
| missing+=("$lib (dev)") | ||
| fi | ||
| done | ||
|
|
||
| if [[ ${#missing[@]} -gt 0 ]]; then | ||
| echo "Missing system dependencies: ${missing[*]}" | ||
| echo "" | ||
| echo "Run the following command first to install system packages:" | ||
| echo "" | ||
| echo " sudo ${ORFS_DIR}/etc/DependencyInstaller.sh -base -bazel" | ||
| echo "" | ||
| exit 1 | ||
| fi | ||
|
|
||
| PREFIX="${ORFS_DIR}/dependencies" | ||
|
|
||
| echo "Installing ORFS flow dependencies into ${PREFIX}" | ||
| echo "" | ||
|
|
||
| # Build Yosys/eqy/sby using the shared DependencyInstaller.sh with -bazel. | ||
| # The -common flag triggers the Yosys/eqy/sby build (not the full OpenROAD | ||
| # dependency chain). | ||
| "${ORFS_DIR}/etc/DependencyInstaller.sh" -common -bazel "-prefix=${PREFIX}" | ||
|
|
||
| echo "" | ||
| echo "ORFS flow dependencies installed to ${PREFIX}" | ||
| echo "" | ||
| echo "To use, source the environment or add to PATH:" | ||
| echo "" | ||
| echo " export PATH=${PREFIX}/bin:\$PATH" | ||
| echo "" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The term "project's" could be ambiguous here. Since this documentation is in the OpenROAD repository, a user might think it refers to a
dependencies/directory within the OpenROAD project structure. To improve clarity, I suggest specifying that this directory is at the root of theOpenROAD-flow-scriptsrepository.