Skip to content

Latest commit

 

History

History
71 lines (51 loc) · 1.89 KB

Installation.adoc

File metadata and controls

71 lines (51 loc) · 1.89 KB

Installation

npm install -g bs-platform

It supports all platform including Windows

Build from source in Release Mode

Note for dev mode, you are encouraged to work from there

Prerequisites
  • Standard C toolchain(gcc,Makefile)

Get source
git clone https://github.com/bucklescript/bucklescript

The patched compiler is installed locally into your $(pwd)/bin directory. To start using it temporarily, check if ocamlc.opt and ocamlopt.opt exist in $(pwd)/bin, and temporarily add the location to your $(PATH) (e.g. PATH=$(pwd)/bin:$PATH).

Build Vendored OCaml compiler
node scripts/buildocaml.js
Build BuckleScript compiler and its toolchain

The following directions assume you already have the correct version of ocamlopt.opt in your $PATH, having followed the process described in the previous section.

Change cwd to project root directory

export BS_RELEASE_BUILD=1
make world && install

At the end, you should have a binary called bsc.exe under lib/ directory, which you can add to your $PATH.

Making use of OPAM

When working with OCaml we also recommend using opam package manager to install OCaml native toolchains, available here. You will benefit from the existing OCaml ecosystem.

Once you have opam installed, ask opam to switch to using our version of the compiler:

opam update
opam switch 4.02.3+buckle-master
eval `opam config env`

Note that using this approach, the user can also install other OCaml tools easily.