Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linoscope/3d51fdd0bf2c6414bab70bea46c1eb18 to your computer and use it in GitHub Desktop.
Save linoscope/3d51fdd0bf2c6414bab70bea46c1eb18 to your computer and use it in GitHub Desktop.
$ dune build --verbose
cd _build/default/bin/web
# Just calls js_of_ocaml against `bench.bc`. Note that "--opt 3" is NOT passed.
js_of_ocaml -o bench.bc.js /home/lin/.opam/4.13.1/lib/bigstringaf/runtime.js bench.bc
$ dune build --profile release --verbose
cd _build/default/bin/web
# Compile `cma` files of libraries (For example, like this for `camlboy_lib.cma`)
js_of_ocaml --pretty --source-map-inline -o .camlboy_lib.objs/camlboy_lib.cma.js camlboy_lib.cma
# Compile `cmo` file of main benchmark code
js_of_ocaml --pretty --source-map-inline -o .index.eobjs/byte/dune__exe__Bench.cmo.js .index.eobjs/byte/dune__exe__Bench.cmo
# Link them together
js_of_ocaml link --source-map-inline -o bench.bc.js bench.bc.runtime.js ../../.js/stdlib/stdlib.cma.js ../../.js/brr/brr.cma.js ../../.js/bigarray-compat/bigarray_compat.cma.js ../..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment