Skip to content

Commit 9c34bfd

Browse files
committed
New environment instructions
Signed-off-by: Jeff Goeders <[email protected]>
1 parent 0994698 commit 9c34bfd

File tree

6 files changed

+66
-19
lines changed

6 files changed

+66
-19
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ ODIN_II/usefull_tools/**/track_completed
104104
#Python
105105
#
106106
*.pyc
107+
/.venv
107108

108109
#
109110
#Vim

BUILDING.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,31 +56,28 @@ For Docs generation you will need:
5656
The following should be enough to get the tools, VPR GUI and tests going on a modern Debian or Ubuntu system:
5757

5858
```shell
59-
apt-get install \
60-
build-essential \
61-
flex \
62-
bison \
63-
cmake \
64-
fontconfig \
65-
libcairo2-dev \
66-
libfontconfig1-dev \
67-
libx11-dev \
68-
libxft-dev \
69-
libgtk-3-dev \
70-
perl \
71-
liblist-moreutils-perl \
72-
python \
73-
time
59+
./install_apt_packages.sh
60+
```
61+
62+
You will also need several Python packages. It is best to do this within a Python virtual environment:
63+
64+
```
65+
make env
66+
```
67+
68+
Anytime you run the VTR flow or regressions tests (which use Python) you should activate the virtual environment in your terminal:
69+
70+
```
71+
source .venv/bin/activate
7472
```
7573

7674
For documentation generation these additional packages are required:
7775

7876
```shell
7977
apt-get install \
8078
doxygen \
81-
python-sphinx \
82-
python-sphinx-rtd-theme \
83-
python-recommonmark
79+
sphinx-common
80+
pip install -r doc/requirements.txt
8481
```
8582

8683

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,3 +446,9 @@ list(APPEND DIRS_TO_FORMAT_PY "${CMAKE_CURRENT_SOURCE_DIR}/vpr")
446446
list(APPEND DIRS_TO_FORMAT_PY "${CMAKE_CURRENT_SOURCE_DIR}/vtr_flow")
447447

448448
include(AutoPyFormat)
449+
450+
451+
#
452+
# Python Environment setup
453+
#
454+
include(PyEnv)

cmake/modules/PyEnv.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Create a python virtual environment using venv and install all necessary packages
2+
# wheel should be installed before the requirements.txt list to prevent errors.
3+
add_custom_target(env
4+
COMMAND python3 -m venv ../.venv
5+
COMMAND . ../.venv/bin/activate && pip3 install wheel
6+
COMMAND . ../.venv/bin/activate && pip3 install -r ../requirements.txt
7+
)

doc/src/quickstart/index.rst

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ The first step is to `download VTR <https://verilogtorouting.org/download/>`_ an
1414

1515
.. note:: Developers planning to modify VTR should clone the `VTR git repository <https://github.com/verilog-to-routing/vtr-verilog-to-routing/>`_.
1616

17+
18+
Environment Setup
19+
-----------------
20+
VTR requires several system packages and Python packages to build and run the flow. You can install the required system packages using the following command (this works on Ubuntu 18.04 and 20.04, but you may require different packages on other Linux distributions):
21+
22+
.. code-block:: bash
23+
24+
> ./install_apt_packages.sh
25+
26+
Then, to install the required Python packages within a new virtual environment:
27+
28+
.. code-block:: bash
29+
30+
> make env
31+
32+
This will create a Python virtual environment in ``.venv``; however, you won't need this environment until later in the tutorial when you reach the section on "Automatically Running the VTR Flow".
33+
1734
Build VTR
1835
---------
1936

@@ -368,7 +385,13 @@ Automatically Running the VTR Flow
368385
Running each stage of the flow manually is time consuming (and potentially error prone).
369386
For convenience, VTR provides a script (:ref:`run_vtr_flow`) which automates this process.
370387

371-
Lets make a new directory to work in named ``blink_run_flow``:
388+
First, make sure you sure you have activated the Python virtual environment created at the beginning of this tutorial:
389+
390+
.. code-block:: bash
391+
392+
> source $VTR_ROOT/.venv/bin/activate
393+
394+
Next, make a new directory to work in named ``blink_run_flow``:
372395

373396
.. code-block:: bash
374397

install_apt_packages.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
sudo apt-get update
2+
3+
sudo apt-get install -y \
4+
make \
5+
cmake \
6+
build-essential \
7+
pkg-config \
8+
bison \
9+
flex \
10+
libgtk-3-dev \
11+
libx11-dev \
12+
python3-dev \
13+
python3-venv

0 commit comments

Comments
 (0)