So I was trying to use pyml in my project GitHub - thierry-martinez/pyml: OCaml bindings for Python
and it turns out that just adding pyml to dune libraries makes my project crash on linking with :
/usr/bin/ld: cannot find -lposixat_stubs /usr/bin/ld: cannot find -lshexp_bigstring_io_stubs /usr/bin/ld: cannot find -lshexp_bigstring_stubs /usr/bin/ld: cannot find -lbase_stubs /usr/bin/ld: cannot find -lbase_internalhash_types_stubs /usr/bin/ld: cannot find -lspawn_stubs /usr/bin/ld: cannot find -lnumpy_stubs /usr/bin/ld: cannot find -lpyml_stubs /usr/bin/ld: cannot find -lstdcompat__stubs
Curiously, it only happens on my real life project - here is the dune file
(executable (name main) (public_name mm_bench) (modes byte native) (libraries batteries pyml streaming shexp.process tensor_loops re ppx_deriving) (preprocess (pps ppx_deriving.show ppx_deriving.ord ppx_deriving.eq ppx_deriving.ord )) (package mm_bench) )
Because when I try to use pyml in a toy project it runs perfectly (the toy project being the one described in pyml README). So I am not sure it is even a bug specific to pyml.
I may fill an issue on pyml github but I first wanted to know if anyone has ever encountered a linking bug in dune and what are the probable causes. There is a chance that the issue arises from trying to link with C stubs. I’m trying to reproduce a minimal error configuration but it’s difficult. The problem arises with both ocaml 4.12 and ocaml 4.10. Any help would be appreciated.
EDIT : Ok, found it, pyml fails to compile in byte mode. I will fill an issue on github.