-
Notifications
You must be signed in to change notification settings - Fork 6
Installation
VSL is can range from easy to install to more difficult depending on your OS.
Ensure you have the following dependencies:
Name | Version | Notes |
---|---|---|
Node.js | >= 6.11 | |
Git | >= 1.6.6 | |
CMake | >= 3.0 | CMake is also needed to build LLVM. |
LLVM | >= 7.0 | see recommended LLVM build instructions. LLVM binaries should be exposed in PATH. |
Linker | any linker (like ld ) or C toolchain (preferred, like clang or gcc ) |
Note for macOS: the LLVM that macOS has by default is not compatible. The reason is that the default version does not have the required files to interact with the LLVM C++ API.
For WebAssembly support, you must have:
Name | Version | Notes |
---|---|---|
lld | ([lld]). It is recommended to install this by manually building LLVM; see recommended LLVM build instructions |
VSL has a few ways to install once you have the dependencies.
The easiest way to install VSL is using:
$ npm i -g vsl
however if this does not work, do not fear. The NPM installation lacks the ability to pass system-specific installation options so if this doesn't easily work try building from source or referencing the NPM installation help below.
If you have problems from NPM or just want to build from source follow these steps.
- Locate your VSL source
npm install
- If there is no
lib
directory, runnpm build
or for you who wish to copy+paste into your terminal:
git clone --recursive https://github.com/vsl-lang/VSL
cd VSL
npm install
npm install -g
You may encounter a number of issues during installation. See if any of the below help fix your issue. Otherwise, leave an issue.
Make sure you have llvm
installed and related libraries including. Check your LLVM installation by checking if the following commands work: llc
, lli
, llvm-config
, llvm-as
. Run llc -version
and see if you see x86-64
/x86
under "Registered Targets". If not all of these work, check your LLVM installation.
If the above works, try building from source (below).
Update your CMake to the latest version. Specifically 3.x
Assuming you have a lib
directory, run:
$ rm -rf node_modules
$ npm install
If when building you get a message similar to:
CMake Error at CMakeLists.txt:6 (find_package):
Could not find a package configuration file provided by "LLVM"
that means CMake cannot find the LLVM cmake files. If you have LLVM properly installed this can be fixed using:
export LLVM_DIR=$(llvm-config --cmakedir)
if this does not fix it, check if the LLVM CMake directory exists:
file $(llvm-config --cmakedir)
if it does not exist then you probably should rebuild LLVM. This is because your current LLVM installation does not have CMake files, this often happens on systems which have their own version of LLVM (eg macOS) or with certain package managers. To fix this, the best way is to rebuild LLVM. Recommended to reference the LLVM build guide for VSL.
macOS Catalina issue: see the node-gyp
issue
If you cannot locate nan.h
, run:
$ npm i -g nan
and then install using:
$ NODE_PATH=$(npm config get prefix)/lib/node_modules CMAKE_LIBRARY_PATH=$(node -e "require('nan')") npm i -g vsl
If you cannot locate nan.h
, run:
$ rm -rf node_modules
$ npm i --ignore-scripts
$ npm i nan
and then install using:
$ CMAKE_LIBRARY_PATH=$(node -e "require('nan')") npm i -g .
Update your CMake to the latest version. Specifically 3.x
If you need help installing VSL, don't hesitate to leave an issue.
- Introduction
- Installation
- VSL By Example
- Usage
- WASM (WebAssembly)
- The Basics
- Your First Program
- Syntax
- Concepts
- Modules
- Advanced Details
- Interop
- VSL Development
- Common Errors