STAR-future's picture
add chips/openroad_flow_scripts
d664931 verified
|
Raw History Blame Contribute Delete
4.8 kB
# Build from sources using Docker
:::{Note}
This document describes how to build your own Docker image.
If your goal is to use the latest version of OpenROAD-Flow-Scripts,
please refer to the [Docker Shell](./DockerShell.md) documentation.
:::
## Prerequisites
- For this method you only need to install
[Docker](https://docs.docker.com/engine/install) on your machine.
- Ensure that you have sufficient memory allocated to the Virtual Machine (VM)
as per our system [requirements](../index2.md#system-requirements). Refer to
this [Docker guide](https://docs.docker.com/config/containers/resource_constraints/) for setting CPU cores and memory limits.
:::{Warning}
The `build_openroad.sh` will use the host number of CPUs to compile `openroad`.
Please check your Docker daemon setup to make sure all host CPUs are
available. If you are not sure, you can check with the command below. If
the output number is different from the number of CPUs from your machine,
then is recommended that you restrict the number of CPUs used by the scripts
(see instructions below).
:::
``` shell
docker run --rm ubuntu:26.04 nproc
```
### Build Using Docker from pre-built binaries
Courtesy of [Precision Innovations](https://precisioninno.com/),
pre-built `.deb` installers of OpenROAD for Ubuntu
are available from [OpenROAD VaultLink](https://vaultlink.precisioninno.com/).
This greatly helps to reduce the compilation time needed.
We recommend to use a Docker image of a supported OS
and install OpenROAD using the pre-built binaries from
Precision Innovations.
You can start the container in an interactive mode using
the command below.
```shell
docker run -it ubuntu:26.04
```
Now you are ready to install the prebuilt binaries.
Please refer to the instructions for installing prebuilt binaries
[here](./BuildWithPrebuilt.md).
The root `Dockerfile` assembles a runtime image from the published Ubuntu 26.04 development image, flow tools, and OpenROAD installation.
Build it without compiling the tools:
```shell
docker build -t openroad/orfs-local .
```
### Build Using Docker from sources
Alternatively, if you would like the latest commits from the OpenROAD repositories,
do follow the instructions below.
#### Clone and Build
The following instructions build the docker image with Ubuntu 26.04 as the base OS:
``` shell
git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts
cd OpenROAD-flow-scripts
./build_openroad.sh
```
You can restrict the number of CPUs with the `-t|--threads N` argument:
``` shell
./build_openroad.sh --threads N
```
## Verify Installation
The binaries are only available from inside a Docker container. Here is an example of starting a container from the created Docker image.
``` shell
docker run --rm -it -u $(id -u ${USER}):$(id -g ${USER}) -v $(pwd)/flow:/OpenROAD-flow-scripts/flow openroad/orfs
```
Then, inside docker:
``` shell
source ./env.sh
yosys -help
yosys -p "slang_version"
openroad -help
cd flow
make
exit
```
Alternatively you may also use the `docker_shell` utility as follows.
It is important that you are in the `flow` directory.
```shell
cd flow
util/docker_shell make
```
## Enable GUI support
To use the GUI feature you will need to start the docker with the
following command,
For Ubuntu users:
```
docker run --rm -it \
-u $(id -u ${USER}):$(id -g ${USER}) \
-v $(pwd)/flow:/OpenROAD-flow-scripts/flow \
-e DISPLAY=${DISPLAY} \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v ${HOME}/.Xauthority:/.Xauthority \
--network host \
--security-opt seccomp=unconfined \
openroad/orfs
```
Alternatively, you may also use the `docker_shell` utility for GUI as follows.
It is important that you are in the `flow` directory.
```shell
cd flow
util/docker_shell gui_final
```
```{note}
`docker_shell` is a helpful utility to automate the
aforementioned Docker commands using the user's parameters.
Do refer to the documentation [here](./DockerShell.md).
```
## Build Docker Image for Different OS
The following instructions build the docker image with a parameterized OS
in two stages. These are for CI and developers that wish to use an OS other
than Ubuntu 26.04; regular users should use the steps from previous sections.
The dev stage installs all dependencies and packages required to run OpenROAD
and OpenROAD Flow Scripts. The build stage generates all binaries needed to run
the flow (i.e., `openroad` and `yosys`).
``` shell
git clone --recursive https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts
cd OpenROAD-flow-scripts
./etc/DockerHelper.sh create -target=dev -os=$OS_NAME
./etc/DockerHelper.sh create -target=builder -os=$OS_NAME
```
Valid values for `$OS_NAME` are `ubuntu26.04` and `ubuntu24.04`.