Re: Ocamlfind does not allow -thread

"Sébastien Dailly [email protected] [ocaml_beginners]" <[email protected]> Fri, 18 Dec 2015 16:26:12 +0100
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <[email protected]>
Le 2015-12-18 15:55, Gabriel Scherer [email protected] 
[ocaml_beginners] a écrit :

Hello Gabriel, thanks for your help

> Are you sure that ocamlfind is correctly installed in your new 4.02.3
> switch (opam install ocamlfind), that you are not using some other
> ocamlfind version? You can check with
> 
>   ocamlfind -printconf
> 


dailly@dailly-PC ~
$ ocamlfind printconf
Effective configuration:
Configuration file:
     /home/dailly/.opam/4.02.3/lib/findlib.conf
Search path:
     /home/dailly/.opam/4.02.3/lib
Packages will be installed in/removed from:
     /home/dailly/.opam/4.02.3/lib
META files will be installed in/removed from:
     the corresponding package directories
The standard library is assumed to reside in:
     /home/dailly/.opam/4.02.3/lib/ocaml
The ld.conf file can be found here:
     /home/dailly/.opam/4.02.3/lib/ocaml/ld.conf


> OCamlfind thread heuristics depends on the value of the
> type_of_threads variable in the file
> 
>   $(opam config var lib)/threads/META
> 
> Try with your two different opam switches. When it says
> 
>   type_of_threads = "posix"
> 
> then ocamlopt -thread option should be available. If it says "vm", or
> is not set, then it should not be available.
> 
> If this line has "posix" on your 4.02.3 switch, then the failure of
> ocamlfind may be an ocamlfind issue, and you should send an email to
> its maintainer (Gerd Stolpmann).
> If this line does not have "posix", then this may be a configuration
> issue happening when installing ocamlfind in the new switch. I don't
> know how to solve this, and would also contact Gerd Stolpmann in that
> case.

The value is set to "vm" in 4.02.1.3 only :

$ grep type_of_threads /home/dailly/.opam/4.02.{1,3}/lib/threads/META
/home/dailly/.opam/4.02.1/lib/threads/META:type_of_threads = "posix"
/home/dailly/.opam/4.02.3/lib/threads/META:type_of_threads = "vm"

Regards,