title: How to use -thread compiler flag with ocamlbuild?
body: <p>I am using <code>Jane Street</code>'s <code>async_core</code> by adding <code>package(async_core)</code> in <code>_tags</code>. </p>
  
  <p>When I use <code>ocamlbuild -use-ocamlfind -I src test/test_airport.native</code>, it gives me the following error:</p>
  
  <blockquote>
    <p>camlfind ocamlopt -linkpkg -package async_core -package unix -package
    netclient -package mongo -package xml-light src/airport.cmx
    test/test_airport.cmx -o test/test_airport.native ocamlfind: Error
    from package `threads': Missing -thread or -vmthread switch</p>
  </blockquote>
  
  <hr>
  
  <p>I googled it and here is what I got <a href="http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual039.html">http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual039.html</a></p>
  
  <p>It says:</p>
  
  <blockquote>
    <p>Programs that use system threads must be linked as follows:</p>
  
  <pre><code>    ocamlc -thread other options unix.cma threads.cma other files
  </code></pre>
  </blockquote>
  
  <p>So I changed my ocamlbuild command like this: </p>
  
  <p><code>ocamlbuild -use-ocamlfind -cflag -thread -I src test/test_airport.native</code></p>
  
  <p>But the error remains the same. also the actual command that ocamlbuild generated remains the same without <code>-thread</code>.</p>
  
  <hr>
  
  <p>How can I deal with this?</p>