ocamlocamlbuildocamlfindoasis

oasis picks up wrong ocamlbuild


I try to compile an Ocaml project with an Ocaml version provided by Opam. My ocamlbuild, ocamlfind, and oasis seem OK :

/Users/fred/.opam/4.02.1/bin/ocamlbuild
dhcp-182-73:compil fred$ which ocamlfind
/Users/fred/.opam/4.02.1/bin/ocamlfind
dhcp-182-73:compil fred$ which oasis
/Users/fred/.opam/4.02.1/bin/oasis

But when I try to compile, it seems that a wrong version of ocamlbuild is called, and even the version of ocamlfind is right, I think that it explains why ocamlfind can't find the sexplib library.

$ make
ocaml setup.ml -build 
Finished, 0 targets (0 cached) in 00:00:00.
+ /Users/fred/.opam/system/bin/ocamlfind ocamldep -package threads -package sexplib.syntax -package core -package comparelib.syntax -modules  src/tricot/tricot.mli > src/tricot/tricot.mli.depends
ocamlfind: Package `sexplib.syntax' not found
Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
E: Failure("Command ''/usr/local/bin/ocamlbuild' src/tricot/tricot.cma src/tricot/tricot.cmxa src/tricot/tricot.a src/tricot/tricot.cmxs src/compil/compil.cma src/compil/compil.cmxa src/compil/compil.a src/compil/compil.cmxs src/main.native -use-ocamlfind -tag debug' terminated with error code 10")
make: *** [build] Error 1

I've tried to tell oasis which version of ocambuild to use without success, does someone knows how it could be done ? Thanks


Solution

  • Try deleting setup.data and running make again. Oasis caches the paths the first time you try to build, and doesn't update them automatically afterwards. Perhaps you tried to build it, then used opam switch, then tried to build it again?