Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Linking problem with thread libraries
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Galchin Vasili <vngalchin@y...>
Subject: [Caml-list] Linking problem with thread libraries
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