From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA13357; Sat, 21 Feb 2004 21:03:09 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA13538 for ; Sat, 21 Feb 2004 21:03:08 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from web12209.mail.yahoo.com (web12209.mail.yahoo.com [216.136.175.66]) by concorde.inria.fr (8.12.10/8.12.10) with SMTP id i1LK36ae012214 for ; Sat, 21 Feb 2004 21:03:07 +0100 Message-ID: <20040221200305.33434.qmail@web12209.mail.yahoo.com> Received: from [134.241.124.203] by web12209.mail.yahoo.com via HTTP; Sat, 21 Feb 2004 12:03:05 PST Date: Sat, 21 Feb 2004 12:03:05 -0800 (PST) From: Galchin Vasili Subject: [Caml-list] Linking problem with thread libraries To: caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; posix:01 threads:01 api:01 threads:01 api:01 lwps:01 clone:01 ocamlc:01 -thread:01 ocamlmktop:01 conforming:01 posix:01 ocamlc:01 -thread:01 ocamltop:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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