The stable branch of ocaml lack of function caml_hash_variant, which makes software using pcre-ocaml fails to produce native codes. Reproducible: Always Steps to Reproduce: 1. Install newest stable ocaml(-3.12.1) and pcre-ocaml(-6.2.5) 2. Write a code as following and save as test.ml : let () = let regex = Pcre.regexp Sys.argv.(1) in let str = Sys.argv.(2) in let m = try Pcre.extract ~rex:regex str with Not_found -> [||] in Array.iter (fun x -> print_endline x) m;; 3. try to compile it to native binary with: ocamlbuild -use-ocamlfind -package pcre test.native or ocamlfind ocamlopt -o test -package pcre -linkpkg test.ml Actual Results: It fails to generate executable and produces following message (slightly differ if using the second command): + /usr/bin/ocamlfind ocamlopt -linkpkg -package pcre test.cmx -o test.native /usr/lib64/ocaml/pcre/libpcre_stubs.a(pcre_stubs.o): In function `pcre_ocaml_init': (.text+0x1b2): undefined reference to `caml_hash_variant' /usr/lib64/ocaml/pcre/libpcre_stubs.a(pcre_stubs.o): In function `pcre_ocaml_init': (.text+0x1c5): undefined reference to `caml_hash_variant' /usr/lib64/ocaml/pcre/libpcre_stubs.a(pcre_stubs.o): In function `pcre_ocaml_init': (.text+0x1d8): undefined reference to `caml_hash_variant' /usr/lib64/ocaml/pcre/libpcre_stubs.a(pcre_stubs.o): In function `pcre_ocaml_init': (.text+0x1eb): undefined reference to `caml_hash_variant' /usr/lib64/ocaml/pcre/libpcre_stubs.a(pcre_stubs.o): In function `pcre_ocaml_init': (.text+0x1fe): undefined reference to `caml_hash_variant' /usr/lib64/ocaml/pcre/libpcre_stubs.a(pcre_stubs.o):(.text+0x211): more undefined references to `caml_hash_variant' follow collect2: error: ld returned 1 exit status File "caml_startup", line 1, characters 0-1: Error: Error during linking Command exited with code 2. Compilation unsuccessful after building 4 targets (2 cached) in 00:00:00. Expected Results: It compiles well and produce test.native (or test using the second command) This bug maybe also have relationship with https://github.com/ocaml/opam-repository/issues/1197. I moved to ocaml of testing branch (-4.01.0) and rebuilt all ocaml packages, and this bug is fixed. During doing the update, Also found stable branch of ocamlnet(-3.6.3) cannot build with ocaml-4.01.0 (and possibly 4.00.1_rc as the Changelog). As ocaml-4 is not stable, I don't submit a separate bug for this issue.
Stable branch of ocaml is update to 4.01.0 resolved this bug.