Stdune fails to compile

This line seems fishy. If you are using OPAM you should not normally see any files installed outside of the OPAM prefix ~/.opam, like you see here.

Most probably you have a mixture of OPAM-installed and system-installed libraries and/or tools. The most typical suspect is ocamlfind. Can you print the result of ocamlfind printconf?

Cheers,
Nicolas