From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 82AA8BBAF for ; Thu, 23 Apr 2009 10:24:48 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al8CALvC70lRZ90vlGdsb2JhbACOL4gZAQEBAQkLCAkRA7g+g3UG X-IronPort-AV: E=Sophos;i="4.38,431,1233529200"; d="scan'208";a="28142687" Received: from mtaout01-winn.ispmail.ntl.com ([81.103.221.47]) by mail1-smtp-roc.national.inria.fr with ESMTP; 23 Apr 2009 10:24:48 +0200 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090423082447.GURN2989.mtaout01-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com>; Thu, 23 Apr 2009 09:24:47 +0100 Received: from romulus.metastack.com ([81.102.132.77]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090423082447.UFRU13254.aamtaout01-winn.ispmail.ntl.com@romulus.metastack.com>; Thu, 23 Apr 2009 09:24:47 +0100 Received: from Tenor ([172.16.0.9]) (authenticated bits=0) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id n3N8Oh1M024345 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 23 Apr 2009 09:24:45 +0100 From: "David Allsopp" To: "'David McClain'" , References: In-Reply-To: Subject: RE: [Caml-list] Threads? Date: Thu, 23 Apr 2009 09:24:02 +0100 Organization: MetaStack Solutions Ltd. Message-ID: <000601c9c3ec$dc57ce90$95076bb0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcnD5mO9aokg0D8vSu+By+x/fGUjkAABYP1w Content-Language: en-gb X-Scanned-By: MIMEDefang 2.65 on 81.102.132.77 X-Cloudmark-Analysis: v=1.0 c=1 a=QSbwKVI28mKS_vbwHvMA:9 a=Hr6xz8LCBJwrt10KpQ0A:7 a=DVu8QZQUd-N_aZ-ZNn7D5RVJJsIA:4 a=jj-Jh7zM_CKGIc3k:21 a=ySL8-Wz4z1t2Wlp3:21 X-Spam: no; 0.00; ocamlopt:01 compilation:01 ocamlfind:01 ocamlopt:01 -thread:01 -package:01 camlp:01 -package:01 usr:01 lib:01 ocaml:01 -thread:01 -cclib:01 cmxa:01 cmxa:01 > It's been about 5 years since I faced this situation. I'm trying to = link my program against the Thread module. Things go well until I do the = ocamlopt compilation, then it aborts the make with the message: > > ocamlfind ocamlopt -thread -o sdsp.opt =A0 -package camlp4 -package = threads -package unix -I ../src -I /usr/local/lib/ocaml/threads =A0\ > -thread -cclib threads.a =A0nums.cmxa sdsp.cmxa threads/threads.cmxa = =A0 \ > readline.cmx scmMain.cmx=A0 You're missing -linkpkg. It looks like your command should be ocamlfind ocamlopt -thread -o sdsp.opt -package camlp4,threads,unix,num -linkpkg -I ../src sdsp.cmxa readline.cmx scmMain.cmx Notes: -I /usr/local/lib/ocaml/threads =3D=3D> will be added by ocamlfind -cclib threads.a =3D=3D> I think will be added automatically by threads.cmxa nums.cmxa =3D=3D> is better included by having num in your list of findlib packages threads/threads.cmxa =3D=3D> will be included by ocamlfind (when -linkpkg is given and -package threads) AFAIK, ocamlfind always puts libraries first when linking (and they will = be in the correct order because findlib understands inter-library dependencies). Incidentally, when hitting problems like this with ocamlfind, passing -verbose is really useful - because it causes ocamlfind (as well as ocamlopt) to display precise information on what's being called so you = can diagnose the problem. When using ocamlfind, you should never have to use = -I or specify the name of a .cmxa/.cma file (if it's part of a findlib = package) HTH, David=20