caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Linking problem with thread libraries
@ 2004-02-21 20:03 Galchin Vasili
  0 siblings, 0 replies; only message in thread
From: Galchin Vasili @ 2004-02-21 20:03 UTC (permalink / raw)
  To: caml-list

Hello,

  I have written a lot of software with POSIX threads
and Win32 API threads so the OCaml thread API looks
very familiar. I am compiling on Linux which doesn't
support LWPs but instead implements pthreads ("native"
threads via the "clone" system call). I got lost in
the following narrative from the in-progress book
(nice book BTW ...!): 

This library is not part of the execution library of
Objective CAML. Its use requires the option -custom
both for compiling programs and for constructing a new
toplevel by using the commands: 
$ ocamlc -thread -custom threads.cma  files.ml -cclib
-lthreads
$ ocamlmktop -tread -custom -o threadtop thread.cma
-cclib -lthreads

The Threads library is not usable with the native
compiler unless the platform implements threads
conforming to the POSIX 10031. Thus we compile
executables by adding the libraries unix.a and
pthread.a:


$ ocamlc -thread -custom threads.cma files.ml -cclib
-lthreads \
  -cclib -lunix -cclib -lpthread
$ ocamltop -thread -custom threads.cma files.ml -cclib
-lthreads \
  -cclib -lunix -cclib -lpthread
$ ocamlcopt -thread threads.cmxa files.ml -cclib
-lthreads \
  -cclib -lunix -cclib -lpthread


Perhaps somebody could tell me the difference between
the two invocations of "ocamlc" above!?

Thanks, Vasili








__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-21 20:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-21 20:03 [Caml-list] Linking problem with thread libraries Galchin Vasili

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).