|
1 |
| -# Building VTR # |
| 1 | +# Building VTR |
2 | 2 |
|
3 | 3 |
|
4 |
| -## Overview ## |
| 4 | +## Setting up Your Environment |
5 | 5 |
|
6 |
| -VTR uses [CMake](https://cmake.org) as it's build system. |
7 | 6 |
|
8 |
| -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: |
9 | 8 |
|
10 |
| -## Tested Compilers ## |
11 |
| -VTR requires a C++-14 compliant compiler. |
12 |
| -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 |
13 | 10 |
|
14 |
| -* GCC/G++: 7, 8, 9, 10, 11 |
15 |
| -* Clang/Clang++: 6, 7, 10 |
16 | 11 |
|
17 |
| -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: |
18 | 13 |
|
19 |
| -## Unix-like ## |
20 |
| -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 |
21 | 16 |
|
22 |
| -### Dependencies ### |
| 17 | +Then to install the Python packages: |
23 | 18 |
|
24 |
| -For the basic tools you need: |
25 |
| - * Bison & Flex |
26 |
| - * cmake, make |
27 |
| - * A modern C++ compiler supporting C++14 (such as GCC >= 4.9 or clang >= 3.6) |
| 19 | + pip install -r requirements.txt |
28 | 20 |
|
29 |
| -For the VPR GUI you need: |
30 |
| - * Cairo |
31 |
| - * FreeType |
32 |
| - * Xft (libXft + libX11) |
33 |
| - * fontconfig |
34 |
| - * 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 (`source .venv/bin/activate`). |
35 | 22 |
|
36 |
| -For the [regression testing and benchmarking](README.developers.md#running-tests) you will need: |
37 |
| - * Perl + List::MoreUtils |
38 |
| - * Python |
39 |
| - * time |
| 23 | +## Building |
40 | 24 |
|
41 |
| -It is also recommended you install the following development tools: |
42 |
| - * git |
43 |
| - * ctags |
44 |
| - * gdb |
45 |
| - * valgrind |
46 |
| - * clang-format-7 |
| 25 | +From the top-level, run: |
47 | 26 |
|
48 |
| -For Docs generation you will need: |
49 |
| - * Doxygen |
50 |
| - * python-sphinx |
51 |
| - * python-sphinx-rtd-theme |
52 |
| - * python-recommonmark |
| 27 | + make |
53 | 28 |
|
54 |
| -#### Debian & Ubuntu #### |
| 29 | + which will build all the required tools. |
55 | 30 |
|
56 |
| -The following should be enough to get the tools, VPR GUI and tests going on a modern Debian or Ubuntu system: |
| 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. |
57 | 33 |
|
58 |
| -```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 |
74 |
| -``` |
| 34 | +*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.* |
75 | 35 |
|
76 |
| -For documentation generation these additional packages are required: |
| 36 | +Please [let us know](doc/src/contact.md) your experience with building VTR so that we can improve the experience for others. |
77 | 37 |
|
78 |
| -```shell |
79 |
| -apt-get install \ |
80 |
| - doxygen \ |
81 |
| - python-sphinx \ |
82 |
| - python-sphinx-rtd-theme \ |
83 |
| - python-recommonmark |
84 |
| -``` |
| 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. |
85 | 40 |
|
| 41 | +## Verifying Installation |
86 | 42 |
|
87 |
| -For development the following additional packages are useful: |
| 43 | +To verfiy that VTR has been installed correctly run:: |
88 | 44 |
|
89 |
| -```shell |
90 |
| -apt-get install \ |
91 |
| - git \ |
92 |
| - valgrind \ |
93 |
| - gdb \ |
94 |
| - ctags |
95 |
| -``` |
| 45 | + ./vtr_flow/scripts/run_vtr_task.py basic_flow |
96 | 46 |
|
97 |
| -#### Using Nix #### |
| 47 | +The expected output is:: |
98 | 48 |
|
99 |
| -Although the recommended platform is Debian or Ubuntu, Nix can be used to build VTR on other platforms, such as MacOS. |
100 |
| - |
101 |
| -If you don't have [Nix](https://nixos.org/nix/), you can [get it](https://nixos.org/nix/download.html) with: |
102 |
| - |
103 |
| -```shell |
104 |
| -$ curl -L https://nixos.org/nix/install | sh |
105 |
| -``` |
106 |
| - |
107 |
| -These commands will set up dependencies for Linux and MacOS and build VTR: |
108 |
| - |
109 |
| -```shell |
110 |
| -#In the VTR root |
111 |
| -$ nix-shell dev/nix/shell.nix |
112 |
| -$ make |
113 |
| -``` |
114 |
| - |
115 |
| -### Building using the Makefile wrapper ### |
116 |
| -Run `make` from the root of the VTR source tree |
117 |
| - |
118 |
| -```shell |
119 |
| -#In the VTR root |
120 |
| -$ make |
121 |
| -... |
122 |
| -[100%] Built target vpr |
123 |
| -``` |
124 |
| - |
125 |
| - |
126 |
| -#### Specifying the build type #### |
127 |
| -You can specify the build type by passing the `BUILD_TYPE` parameter. |
128 |
| - |
129 |
| -For instance to create a debug build (no optimization and debug symbols): |
130 |
| - |
131 |
| -```shell |
132 |
| -#In the VTR root |
133 |
| -$ make BUILD_TYPE=debug |
134 |
| -... |
135 |
| -[100%] Built target vpr |
136 |
| -``` |
137 |
| - |
138 |
| - |
139 |
| -#### Passing parameters to CMake #### |
140 |
| -You can also pass parameters to CMake. |
141 |
| - |
142 |
| -For instance to set the CMake configuration variable `VTR_ENABLE_SANITIZE` on: |
143 |
| - |
144 |
| -```shell |
145 |
| -#In the VTR root |
146 |
| -$ make CMAKE_PARAMS="-DVTR_ENABLE_SANITIZE=ON" |
147 |
| -... |
148 |
| -[100%] Built target vpr |
149 |
| -``` |
150 |
| - |
151 |
| -Both the `BUILD_TYPE` and `CMAKE_PARAMS` can be specified concurrently: |
152 |
| -```shell |
153 |
| -#In the VTR root |
154 |
| -$ make BUILD_TYPE=debug CMAKE_PARAMS="-DVTR_ENABLE_SANITIZE=ON" |
155 |
| -... |
156 |
| -[100%] Built target vpr |
157 |
| -``` |
158 |
| - |
159 |
| - |
160 |
| -### Using CMake directly ### |
161 |
| -You can also use cmake directly. |
162 |
| - |
163 |
| -First create a build directory under the VTR root: |
164 |
| - |
165 |
| -```shell |
166 |
| -#In the VTR root |
167 |
| -$ mkdir build |
168 |
| -$ cd build |
169 |
| - |
170 |
| -#Call cmake pointing to the directory containing the root CMakeLists.txt |
171 |
| -$ cmake .. |
172 |
| - |
173 |
| -#Build |
174 |
| -$ make |
175 |
| -``` |
176 |
| - |
177 |
| -#### Changing configuration on the command line #### |
178 |
| -You can change the CMake configuration by passing command line parameters. |
179 |
| - |
180 |
| -For instance to set the configuration to debug: |
181 |
| - |
182 |
| -```shell |
183 |
| -#In the build directory |
184 |
| -$ cmake . -DCMAKE_BUILD_TYPE=debug |
185 |
| - |
186 |
| -#Re-build |
187 |
| -$ make |
188 |
| -``` |
189 |
| - |
190 |
| -#### Changing configuration interactively with ccmake #### |
191 |
| -You can also use `ccmake` to to modify the build configuration. |
192 |
| - |
193 |
| -```shell |
194 |
| -#From the build directory |
195 |
| -$ ccmake . #Make some configuration change |
196 |
| - |
197 |
| -#Build |
198 |
| -$ make |
199 |
| -``` |
200 |
| - |
201 |
| -## Other platforms ## |
202 |
| - |
203 |
| -CMake supports a variety of operating systems and can generate project files for a variety of build systems and IDEs. |
204 |
| -While VTR is developed primarily on Linux, it should be possible to build on different platforms (your milage may vary). |
205 |
| -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). |
206 |
| - |
207 |
| - |
208 |
| -### Microsoft Windows ### |
209 |
| - |
210 |
| -*NOTE: VTR support on Microsoft Windows is considered experimental* |
211 |
| - |
212 |
| -#### Cygwin #### |
213 |
| -[Cygwin](https://www.cygwin.com/) provides a POSIX (i.e. unix-like) environment for Microsoft Windows. |
214 |
| - |
215 |
| -From within the cygwin terminal follow the Unix-like build instructions listed above. |
216 |
| - |
217 |
| -Note that the generated executables will rely upon Cygwin (e.g. `cygwin1.dll`) for POSIX compatibility. |
218 |
| - |
219 |
| -#### Cross-compiling from Linux to Microsoft Windows with MinGW-W64 #### |
220 |
| -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. |
221 |
| -These can usually be installed with your Linux distribution's package manager (e.g. `sudo apt-get install mingw-w64` on Debian/Ubuntu). |
222 |
| - |
223 |
| -Unlike Cygwin, MinGW executables will depend upon the standard Microsoft Visual C++ run-time. |
224 |
| - |
225 |
| -To build VTR using MinGW: |
226 |
| -```shell |
227 |
| -#In the VTR root |
228 |
| -$ mkdir build_win64 |
229 |
| -$ cd build_win64 |
230 |
| - |
231 |
| -#Run cmake specifying the toolchain file to setup the cross-compilation environment |
232 |
| -$ cmake .. -DCMAKE_TOOLCHAIN_FILE ../cmake/toolchains/mingw-linux-cross-compile-to-windows.cmake |
233 |
| - |
234 |
| -#Building will produce Windows executables |
235 |
| -$ make |
236 |
| -``` |
237 |
| - |
238 |
| -Note that by default the MS Windows target system will need to dynamically link to the `libgcc` and `libstdc++` DLLs. |
239 |
| -These are usually found under /usr/lib/gcc on the Linux host machine. |
240 |
| - |
241 |
| -See the [toolchain file](cmake/toolchains/mingw-linux-cross-compile-to-windows.cmake) for more details. |
242 |
| - |
243 |
| -#### Microsoft Visual Studio #### |
244 |
| -CMake can generate a Microsft Visual Studio project, enabling VTR to be built with the Microsoft Visual C++ (MSVC) compiler. |
245 |
| - |
246 |
| -##### Installing additional tools ##### |
247 |
| -VTR depends on some external unix-style tools during it's buid process; in particular the `flex` and `bison` parser generators. |
248 |
| - |
249 |
| -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. |
250 |
| - |
251 |
| -To ensure CMake can find the `flex` and `bison` executables you must ensure that they are available on your system path. |
252 |
| -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. |
253 |
| - |
254 |
| -##### Generating the Visual Studio Project ##### |
255 |
| -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 |
0 commit comments