From npm (recommended for normal users)
npm install -g bs-platform
It supports all platform including Windows
Note for dev mode, you are encouraged to work from there
-
Standard C toolchain(gcc,Makefile)
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
).
node scripts/buildocaml.js
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
.
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.