Skip to content

Commit 17fafea

Browse files
committed
docker: add a ./or script to run GUI from within docker image
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 0f102f7 commit 17fafea

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

flow/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Building example design using Docker image
2+
==========================================
3+
4+
The `or` script is used as a prefix to launch a command within the OpenROAD docker image.
5+
6+
This script is set up to run the OpenROAD GUI from
7+
within the Docker image on the host platform.
8+
9+
Also, the current working directory is mapped into the Docker image using the current user's credentials.
10+
11+
Build docker image
12+
------------------
13+
14+
First build the docker image:
15+
16+
```
17+
cd OpenROAD-flow-scripts
18+
sudo ./setup.sh
19+
./build_openroad.sh
20+
```
21+
22+
Build an example design and run the GUI:
23+
24+
```
25+
cd flow
26+
./or make
27+
./or make gui_final
28+
```

flow/or

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
set -ex
3+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
5+
WORKSPACE=$(pwd)
6+
7+
XSOCK=/tmp/.X11-unix
8+
XAUTH=/tmp/.docker.xauth
9+
xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
10+
ARGUMENTS=$@
11+
12+
if test -t 0; then
13+
DOCKER_INTERACTIVE=-ti
14+
fi
15+
16+
docker run -u $(id -u ${USER}):$(id -g ${USER}) \
17+
-e LIBGL_ALWAYS_SOFTWARE=1 \
18+
-e "QT_X11_NO_MITSHM=1" \
19+
-e XDG_RUNTIME_DIR=/tmp/xdg-run \
20+
-e DISPLAY=$DISPLAY \
21+
-e QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb \
22+
-v $XSOCK:$XSOCK \
23+
-v $XAUTH:$XAUTH \
24+
-e XAUTHORITY=$XAUTH \
25+
-e FLOW_HOME=/OpenROAD-flow-scripts/flow/ \
26+
-e MAKEFILES=/OpenROAD-flow-scripts/flow/Makefile \
27+
-v $WORKSPACE:`pwd` \
28+
$DOCKER_INTERACTIVE \
29+
openroad/flow-centos7-builder:latest \
30+
bash -c "set -ex
31+
mkdir /tmp/xdg-run
32+
. ./env.sh
33+
cd $DIR
34+
$ARGUMENTS
35+
"

0 commit comments

Comments
 (0)