Lately, certain OCaml programs stopped working properly with an `unknown C primitive` error.
The concrete message was:
Fatal error: unknown C primitive `caml_ba_dim_1'
after I used OPAM to install a new version of the OCaml compiler.
Sometimes it worked, and sometimes it didn't which finally lead to
a problem with environment variables. I found the following situation:
In ~/.opam/opam-init/variables.sh
, the environment variable
CAML_LD_LIBRARY_PATH
was set to both the OPAM-related path
~/.opam/4.01.0/lib/stublibs
and the system installed compiler's
stublibs as well /usr/local/lib/ocaml/stublibs
. After I removed
the latter, everything worked fine.
See bug reports for Utop as well as for batteries-included.