-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
## Dependencies | ||
|
||
Currently, it is necessary to use `clang` (due to `gcc` bug) to build VAST. On Linux it is also necessary to use `lld` at the moment. | ||
|
||
VAST uses `llvm-17` which can be obtained from the [repository](https://apt.llvm.org/) provided by LLVM. | ||
|
||
Before building (for Ubuntu) get all the necessary dependencies by running | ||
``` | ||
apt-get install build-essential cmake ninja-build libstdc++-12-dev llvm-17 libmlir-17 libmlir-17-dev mlir-17-tools libclang-17-dev | ||
``` | ||
or an equivalent command for your operating system of choice. | ||
|
||
## Instructions | ||
|
||
To configure project run `cmake` with following default options. | ||
In case `clang` isn't your default compiler prefix the command with `CC=clang CXX=clang++`. | ||
If you want to use system installed `llvm` and `mlir` (on Ubuntu) use: | ||
|
||
``` | ||
cmake --preset ninja-multi-default \ | ||
--toolchain ./cmake/lld.toolchain.cmake \ | ||
-DCMAKE_PREFIX_PATH=/usr/lib/llvm-17/ | ||
``` | ||
|
||
To use a specific `llvm` provide `-DCMAKE_PREFIX_PATH=<llvm & mlir instalation paths>` option, where `CMAKE_PREFIX_PATH` points to directory containing `LLVMConfig.cmake` and `MLIRConfig.cmake`. | ||
|
||
Note: vast requires LLVM with RTTI enabled. Use `LLVM_ENABLE_RTTI=ON` if you build your own LLVM. | ||
|
||
|
||
Finally, build the project: | ||
|
||
``` | ||
cmake --build --preset ninja-rel | ||
``` | ||
|
||
Use `ninja-deb` preset for debug build. | ||
|
||
## Run | ||
|
||
To run mlir codegen of highlevel dialect use. | ||
|
||
``` | ||
./builds/ninja-multi-default/tools/vast-front/Release/vast-front -vast-emit-mlir=<dialect> <input.c> -o <output.mlir> | ||
``` | ||
|
||
Supported dialects are: `hl`, `ll`, `llvm` | ||
|
||
## Test | ||
|
||
``` | ||
ctest --preset ninja-deb | ||
``` |