Skip to content

Installation

Vihan edited this page Jul 4, 2019 · 18 revisions

VSL is can range from easy to install to more difficult depending on your OS.

1. Dependencies

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.

1.1 WASM Dependencies

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

2. Installation

VSL has a few ways to install once you have the dependencies.

2A. Easy Install from NPM

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.

2B. Build from source

If you have problems from NPM or just want to build from source follow these steps.

  1. Locate your VSL source
  2. npm install
  3. If there is no lib directory, run npm 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

3. Resolving installation issues

You may encounter a number of issues during installation. See if any of the below help fix your issue. Otherwise, leave an issue.

I get Error: Could not locate the bindings file.

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).

"There is no Visual C++ compiler installed. Install Visual C++ Build Toolset or Visual Studio."

Update your CMake to the latest version. Specifically 3.x

llvm-node-related errors

Assuming you have a lib directory, run:

$ rm -rf node_modules
$ npm install

Could not find a package configuration file provided by LLVM

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.

No rule to make target: ... node-gyp/addon.gypi

macOS Catalina issue: see the node-gyp issue

(Source Build) I get nan.h: no such file or directory

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

(NPM Installation) I get nan.h: no such file or directory

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 .

"There is no Visual C++ compiler installed. Install Visual C++ Build Toolset or Visual Studio."

Update your CMake to the latest version. Specifically 3.x


If you need help installing VSL, don't hesitate to leave an issue.

Clone this wiki locally