-
Notifications
You must be signed in to change notification settings - Fork 6
Building LLVM
Vihan edited this page Jun 27, 2020
·
11 revisions
VSL relies pretty heavily on LLVM for most targets. This is a quick guide with the recommended way to install LLVM so it works with VSL. Any errors you encounter during this process would be an issue with LLVM so we recommend you leave an issue with them.
These instructions are for macOS/Linux but shouldn't be too much different for you Windows users.
- CMake (needed to build LLVM and the VSL executable itself)
- dependencies LLVM specifies
Hopefully this isn't out of date by the time you are reading this:
- Download the LLVM source code. VSL should support the latest LLVM version at all times (last tested on v9.0.0). You can also clone the latest from SVN. Navigate inside the directory
git clone --depth 1 https://github.com/llvm/llvm-project.git cd llvm-project
- Create a build directory and inside of it run cmake with the LLVM build flags to generate the build files.
mkdir build cd build cmake ../llvm -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly
-
Recommended (for WASM): compile with the
lld
linker using:-DLLVM_ENABLE_PROJECTS=lld
- macOS users: add
-GXcode
flag for parallel builds with Xcode installed - consider: adding
-DCMAKE_BUILD_TYPE=Release
to do a 'release' build of LLVM which may provide better errors in case of internal compiler errors.
-
Recommended (for WASM): compile with the
- To build run:
cmake --build .
- note: this will take long time and lots of CPU
- To install, then run the following:
cmake --build . --target install
- You may need to add
sudo
depending on OS and user permissions
- You may need to add
- Introduction
- Installation
- VSL By Example
- Usage
- WASM (WebAssembly)
- The Basics
- Your First Program
- Syntax
- Concepts
- Modules
- Advanced Details
- Interop
- VSL Development
- Common Errors