Skip to content

Commit 7325508

Browse files
committed
Migrate to myst-parser for markdown docs
Signed-off-by: Jeff Goeders <[email protected]>
1 parent a936567 commit 7325508

15 files changed

+304
-339
lines changed

BUILDING.md

Lines changed: 25 additions & 208 deletions
Original file line numberDiff line numberDiff line change
@@ -1,232 +1,49 @@
1-
# Optional Build Information #
1+
# Building VTR
22

3-
This page contains additional information about the VTR build system, and how to build VTR on other OS platforms or with non-standard build options. If you only need to the default features of VTR on a Debian/Ubuntu system, the previous [Building VTR](vtr/get_vtr) page should be sufficient and you can :ref:`skip this page <next>`.
43

5-
## Overview ##
4+
## Setting up Your Environment
65

7-
VTR uses [CMake](https://cmake.org) as it's build system.
86

9-
CMake provides a portable cross-platform build systems with many useful features.
7+
VTR requires several system packages. From the top-level directory, run the following script to install the required packages on a modern Debian or Ubuntu system:
108

11-
## Tested Compilers ##
12-
VTR requires a C++-14 compliant compiler.
13-
It is tested against the default compilers of all Debian and Ubuntu releases within their standard support lifetime. Currently, those are the following:
9+
./install_apt_packages.sh
1410

15-
* GCC/G++: 7, 8, 9, 10, 11
16-
* Clang/Clang++: 6, 7, 10
1711

18-
Other compilers may work but are untested (your milage may vary).
12+
You will also need several Python packages. You can optionally install and activate a Python virtual environment so that you do not need to modify your system Python installation:
1913

20-
## Unix-like ##
21-
For unix-like systems we provide a wrapper Makefile which supports the traditional `make` and `make clean` commands, but calls CMake behind the scenes.
14+
make env
15+
source .venv/bin/activate
2216

23-
### Dependencies ###
17+
Then to install the Python packages:
2418

25-
For the basic tools you need:
26-
* Bison & Flex
27-
* cmake, make
28-
* A modern C++ compiler supporting C++14 (such as GCC >= 4.9 or clang >= 3.6)
19+
pip install -r requirements.txt
2920

30-
For the VPR GUI you need:
31-
* Cairo
32-
* FreeType
33-
* Xft (libXft + libX11)
34-
* fontconfig
35-
* libgtk-3-dev
21+
**Note:** If you chose to install the Python virtual environment, you will need to remember to activate it on any new terminal window you use, before you can run the VTR flow or regressions tests.
3622

37-
For the [regression testing and benchmarking](README.developers.md#running-tests) you will need:
38-
* Perl + List::MoreUtils
39-
* Python
40-
* time
23+
## Building
4124

42-
It is also recommended you install the following development tools:
43-
* git
44-
* ctags
45-
* gdb
46-
* valgrind
47-
* clang-format-7
25+
From the top-level, run:
4826

49-
For Docs generation you will need:
50-
* Doxygen
51-
* python-sphinx
52-
* python-sphinx-rtd-theme
53-
* python-recommonmark
27+
make
5428

55-
#### Debian & Ubuntu ####
29+
which will build all the required tools.
5630

31+
The complete VTR flow has been tested on 64-bit Linux systems.
32+
The flow should work in other platforms (32-bit Linux, Windows with cygwin) but this is untested.
5733

58-
For documentation generation these additional Python packages are required:
34+
*See Also:* Full information about building VTR, including setting up required system packages and Python packages, can be found in [Optional Build Information](doc/src/vtr/optional_build_info.md) page.
5935

60-
```shell
61-
pip install -r doc/requirements.txt
62-
```
36+
Please [let us know](doc/src/contact.md) your experience with building VTR so that we can improve the experience for others.
6337

64-
For development the following additional packages are useful:
38+
The tools included official VTR releases have been tested for compatibility.
39+
If you download a different version of those tools, then those versions may not be mutually compatible with the VTR release.
6540

66-
```shell
67-
apt-get install \
68-
git \
69-
valgrind \
70-
gdb \
71-
ctags
72-
```
41+
## Verifying Installation
7342

74-
#### Using Nix ####
43+
To verfiy that VTR has been installed correctly run::
7544

76-
Although the recommended platform is Debian or Ubuntu, Nix can be used to build VTR on other platforms, such as MacOS.
45+
./vtr_flow/scripts/run_vtr_task.py basic_flow
7746

78-
If you don't have [Nix](https://nixos.org/nix/), you can [get it](https://nixos.org/nix/download.html) with:
47+
The expected output is::
7948

80-
```shell
81-
$ curl -L https://nixos.org/nix/install | sh
82-
```
83-
84-
These commands will set up dependencies for Linux and MacOS and build VTR:
85-
86-
```shell
87-
#In the VTR root
88-
$ nix-shell dev/nix/shell.nix
89-
$ make
90-
```
91-
92-
### Building using the Makefile wrapper ###
93-
Run `make` from the root of the VTR source tree
94-
95-
```shell
96-
#In the VTR root
97-
$ make
98-
...
99-
[100%] Built target vpr
100-
```
101-
102-
103-
#### Specifying the build type ####
104-
You can specify the build type by passing the `BUILD_TYPE` parameter.
105-
106-
For instance to create a debug build (no optimization and debug symbols):
107-
108-
```shell
109-
#In the VTR root
110-
$ make BUILD_TYPE=debug
111-
...
112-
[100%] Built target vpr
113-
```
114-
115-
116-
#### Passing parameters to CMake ####
117-
You can also pass parameters to CMake.
118-
119-
For instance to set the CMake configuration variable `VTR_ENABLE_SANITIZE` on:
120-
121-
```shell
122-
#In the VTR root
123-
$ make CMAKE_PARAMS="-DVTR_ENABLE_SANITIZE=ON"
124-
...
125-
[100%] Built target vpr
126-
```
127-
128-
Both the `BUILD_TYPE` and `CMAKE_PARAMS` can be specified concurrently:
129-
```shell
130-
#In the VTR root
131-
$ make BUILD_TYPE=debug CMAKE_PARAMS="-DVTR_ENABLE_SANITIZE=ON"
132-
...
133-
[100%] Built target vpr
134-
```
135-
136-
137-
### Using CMake directly ###
138-
You can also use cmake directly.
139-
140-
First create a build directory under the VTR root:
141-
142-
```shell
143-
#In the VTR root
144-
$ mkdir build
145-
$ cd build
146-
147-
#Call cmake pointing to the directory containing the root CMakeLists.txt
148-
$ cmake ..
149-
150-
#Build
151-
$ make
152-
```
153-
154-
#### Changing configuration on the command line ####
155-
You can change the CMake configuration by passing command line parameters.
156-
157-
For instance to set the configuration to debug:
158-
159-
```shell
160-
#In the build directory
161-
$ cmake . -DCMAKE_BUILD_TYPE=debug
162-
163-
#Re-build
164-
$ make
165-
```
166-
167-
#### Changing configuration interactively with ccmake ####
168-
You can also use `ccmake` to to modify the build configuration.
169-
170-
```shell
171-
#From the build directory
172-
$ ccmake . #Make some configuration change
173-
174-
#Build
175-
$ make
176-
```
177-
178-
## Other platforms ##
179-
180-
CMake supports a variety of operating systems and can generate project files for a variety of build systems and IDEs.
181-
While VTR is developed primarily on Linux, it should be possible to build on different platforms (your milage may vary).
182-
See the [CMake documentation](https://cmake.org) for more details about using cmake and generating project files on other platforms and build systems (e.g. Eclipse, Microsoft Visual Studio).
183-
184-
185-
### Microsoft Windows ###
186-
187-
*NOTE: VTR support on Microsoft Windows is considered experimental*
188-
189-
#### Cygwin ####
190-
[Cygwin](https://www.cygwin.com/) provides a POSIX (i.e. unix-like) environment for Microsoft Windows.
191-
192-
From within the cygwin terminal follow the Unix-like build instructions listed above.
193-
194-
Note that the generated executables will rely upon Cygwin (e.g. `cygwin1.dll`) for POSIX compatibility.
195-
196-
#### Cross-compiling from Linux to Microsoft Windows with MinGW-W64 ####
197-
It is possible to cross-compile from a Linux host system to generate Microsoft Windows executables using the [MinGW-W64](https://mingw-w64.org) compilers.
198-
These can usually be installed with your Linux distribution's package manager (e.g. `sudo apt-get install mingw-w64` on Debian/Ubuntu).
199-
200-
Unlike Cygwin, MinGW executables will depend upon the standard Microsoft Visual C++ run-time.
201-
202-
To build VTR using MinGW:
203-
```shell
204-
#In the VTR root
205-
$ mkdir build_win64
206-
$ cd build_win64
207-
208-
#Run cmake specifying the toolchain file to setup the cross-compilation environment
209-
$ cmake .. -DCMAKE_TOOLCHAIN_FILE ../cmake/toolchains/mingw-linux-cross-compile-to-windows.cmake
210-
211-
#Building will produce Windows executables
212-
$ make
213-
```
214-
215-
Note that by default the MS Windows target system will need to dynamically link to the `libgcc` and `libstdc++` DLLs.
216-
These are usually found under /usr/lib/gcc on the Linux host machine.
217-
218-
See the [toolchain file](cmake/toolchains/mingw-linux-cross-compile-to-windows.cmake) for more details.
219-
220-
#### Microsoft Visual Studio ####
221-
CMake can generate a Microsft Visual Studio project, enabling VTR to be built with the Microsoft Visual C++ (MSVC) compiler.
222-
223-
##### Installing additional tools #####
224-
VTR depends on some external unix-style tools during it's buid process; in particular the `flex` and `bison` parser generators.
225-
226-
One approach is to install these tools using [MSYS2](http://www.msys2.org/), which provides up-to-date versions of many unix tools for MS Windows.
227-
228-
To ensure CMake can find the `flex` and `bison` executables you must ensure that they are available on your system path.
229-
For instance, if MSYS2 was installed to `C:\msys64` you would need to ensure that `C:\msys64\usr\bin` was included in the system PATH environment variable.
230-
231-
##### Generating the Visual Studio Project #####
232-
CMake (e.g. the `cmake-gui`) can then be configured to generate the MSVC project.
49+
k6_N10_memSize16384_memData64_40nm_timing/ch_intrinsics...OK

doc/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
# used by Read The Docs to install python required
33
# modules with pip.
44

5-
Sphinx==3.0
5+
Sphinx==3.1
66
sphinx_rtd_theme
77

88
# Support custom domains
99
sphinxcontrib-domaintools
1010

1111
# Support Markdown
12-
recommonmark
1312
sphinx-markdown-tables
13+
myst_parser
1414

1515
# Handle markdown cross-references
1616
git+https://github.com/SymbiFlow/sphinxcontrib-markdown-symlinks

doc/src/BUILDING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```{include} ../../BUILDING.md
2+
:relative-docs: doc/src
3+
```

doc/src/CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```{include} ../../CONTRIBUTING.md
2+
```

doc/src/README.developers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```{include} ../../README.developers.md
2+
```

doc/src/SUPPORT.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```{include} ../../SUPPORT.md
2+
```

doc/src/conf.py

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
import shutil
1919
import subprocess
2020

21-
# Markdown support
22-
import recommonmark
2321

2422
sys.path.append(".")
2523
sys.path.insert(0, os.path.abspath("../../vtr_flow/scripts/python_libs"))
@@ -67,7 +65,7 @@
6765
"sdcdomain",
6866
"archdomain",
6967
"rrgraphdomain",
70-
"recommonmark",
68+
"myst_parser",
7169
"sphinx.ext.autodoc",
7270
"sphinx.ext.graphviz",
7371
]
@@ -373,41 +371,10 @@
373371
for prjname, prjdir in breathe_projects.items():
374372
assert os.path.exists(prjdir) == True, "Regenerate doxygen XML for {}".format(prjname)
375373

376-
377-
def recommonmark_setup(app):
378-
"""Initialize Sphinx extension."""
379-
import sphinx
380-
381-
if sphinx.version_info >= (1, 8):
382-
app.add_source_suffix(".md", "markdown")
383-
app.add_source_parser(LinkParser)
384-
385-
return {"version": recommonmark.__version__, "parallel_read_safe": True}
386-
387-
388-
# Override recommonmark setup
389-
recommonmark.setup = recommonmark_setup
374+
# Add page anchors for myst parser
375+
myst_heading_anchors = 3
390376

391377

392378
def setup(app):
393-
github_code_repo = "https://github.com/verilog-to-routing/vtr-verilog-to-routing/"
394-
github_code_branch = "blob/master/"
395-
396-
docs_root_dir = os.path.realpath(os.path.dirname(__file__))
397-
code_root_dir = os.path.realpath(os.path.join(docs_root_dir, "..", ".."))
398379

399-
MarkdownSymlinksDomain.init_domain(
400-
github_code_repo, github_code_branch, docs_root_dir, code_root_dir
401-
)
402-
MarkdownSymlinksDomain.find_links()
403-
app.add_domain(MarkdownSymlinksDomain)
404-
app.add_config_value(
405-
"recommonmark_config",
406-
{
407-
"github_code_repo": github_code_repo,
408-
"enable_math": True,
409-
"enable_inline_math": True,
410-
},
411-
True,
412-
)
413380
app.add_stylesheet("css/vtr.css")

doc/src/contact.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
# Contact
3+
4+
## Mailing Lists
5+
VTR maintains several mailing lists.
6+
Most users will be interested in VTR Users and VTR Announce.
7+
8+
* [VTR Announce](https://groups.google.com/forum/#!forum/vtr-announce)
9+
10+
VTR release announcements (low traffic)
11+
12+
* [VTR Users](https://groups.google.com/forum/#!forum/vtr-users): [email protected]
13+
14+
Discussions about using the VTR project.
15+
16+
* [VTR Devel](https://groups.google.com/forum/#!forum/vtr-devel): [email protected]
17+
18+
Discussions about VTR development.
19+
20+
* [VTR Commits](https://groups.google.com/forum/#!forum/vtr-commits):
21+
22+
Revision Control Commits to the VTR project.
23+
24+
## Issue Tracker
25+
Please file bugs on our [issue tracker](https://github.com/verilog-to-routing/vtr-verilog-to-routing/issues).
26+
27+
Pull Requests are welcome!

0 commit comments

Comments
 (0)