Hi again,

I have created a myocamlbuild.ml which fixes the issue but I'm still interested to get your advice.

open Ocamlbuild_plugin
open Command

let _ = dispatch begin function
   | After_rules ->
       flag ["ocaml"; "thread"; "compile"]  (S[A "-thread"]);
       flag ["ocaml"; "thread"; "link"]     (S[A "-thread"]);
   | _ -> ()
end

Rémi

2011/8/5 Rémi Dewitte <remi@gide.net>
Hello,

I have an issue with ocamlbuild.

I type : ocamlbuild -use-ocamlfind sdit.native
I get the following error :
ocamlfind: Error from package `postgresql': This library requires multi-threading support
Command exited with code 2.

I have checked this :
$ ocamlbuild -documentation | grep thread
flag {. byte, link, ocaml, program, thread .} "threads.cma -thread"
flag {. link, native, ocaml, program, thread .} "threads.cmxa -thread"
flag {. doc, ocaml, thread .} "-I +threads"
flag {. compile, ocaml, thread .} "-thread"

I have checked _build/_log also : tag thread is active
# Target: sdit.native, tags: { dont_link_with, extension:native, file:sdit.native, link, native, ocaml, package(extlib), package(gsl), package(postgresql), package(pxp), package(str), program, quiet, thread, traverse, use_menhir }
/usr/bin/ocamlfind ocamlopt -linkpkg -package extlib -package gsl -package postgresql -package pxp -package str dependent.cmx sdit.cmx -o sdit.native

I think there is a bug with -use-ocamlfind where -thread is not appended to the command.

I use ocaml 3.12.0

What do you think ?

Thanks,
Rémi