How to Statically Link OCaml Programs

Static linking is preferred for some cases although it has its own various problems. Static building/linking is not always possible for some languages on some platform. For OCaml, the answer to this question is yes. In this post, we will introduce 2 methods to statically linking OCaml: static linking with runtime glibc required and static […]

How to find out which function causes Exception “Stack_overflow” in OCaml

My OCaml program prints: Fetal error: Exception “Stack_overflow” without any further information. How to find out which function causes this “Stack_overflow” exception? First, recompile your OCaml program with -g. Second, rerun your OCaml program with OCAMLRUNPARAM=b and the backtrace will be printed out after the “Stack_overflow” exception. Answered by anonymous.

Good tools to manage OCaml packages

Which tools to mange OCaml packages in my system (Linux)? I use OPAM to manage OCaml packages: To install it: $ wget $ sh ./ /usr/local/bin More options are available here. To make opam settings take effect, append this to ~/.bashrc: eval `opam config env` Some frequent usages: opam list # List all […]