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=1.8 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 253ACBB83 for ; Tue, 12 Sep 2006 23:29:49 +0200 (CEST) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.234]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k8CLTmBh008547 for ; Tue, 12 Sep 2006 23:29:48 +0200 Received: by wx-out-0506.google.com with SMTP id s6so2348808wxc for ; Tue, 12 Sep 2006 14:29:43 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JOjuhObVH1/M1oD4Lhx3vaT+OuUUHOuMJG1KbJRGP+C2EbyQf+FgsTwFI/lA9TOR+SPmgYeJyot68G9TushssS9Foj9aAtzja7fnENTEyHENRYuUllOMkzblsuUEOmStC6PYujH5zMYbtpHoTr3kupbcordunpbJK7MNCMEO6/o= Received: by 10.70.96.3 with SMTP id t3mr9098776wxb; Tue, 12 Sep 2006 14:29:43 -0700 (PDT) Received: by 10.70.84.13 with HTTP; Tue, 12 Sep 2006 14:29:43 -0700 (PDT) Message-ID: Date: Wed, 13 Sep 2006 09:29:43 +1200 From: "Jonathan Roewen" To: "Trevor Jim" Subject: Re: [Caml-list] effect of -thread with ocamlc/ocamlopt -c Cc: caml-list@yquem.inria.fr In-Reply-To: <4506E954.8080207@research.att.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4506E954.8080207@research.att.com> X-j-chkmail-Score: MSGID : 450726CC.000 on discorde : j-chkmail score : X : 0/20 1 X-Miltered: at discorde with ID 450726CC.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; -thread:01 ocamlc:01 ocamlopt:01 -thread:01 compiler:01 threads:01 compiler:01 internals:01 cmo:01 cmx:01 threads:01 cmxa:01 runtime:01 cmo:01 cmx:01 > The manual states: > > All object files on the command line must also have been compiled > with the -thread option In current compiler version, all the -thread option does is add the include directory for threads to the include path automatically, and set -nopervasives I think (so that it uses the version provided by the thread library).. Although, depending on the behaviour of compiler internals isn't always a good thing ;-) > So, in general, can I take a .cmo or .cmx file that was NOT compiled > with -thread and link it with the threads library threads.cma or > threads.cmxa? Maybe (for example, the standard library doesn't have a special compiled version for thread mode) -- just IO I'd be concerned about wrt runtime behaviour. > And, in general, can I take a .cmo or .cmx file that WAS compiled with > -thread but which does not use module Thread, and link it into a > program without the threads library? Most likely yes. But again, you're depending on compiler internals. > Since the program is so large, I would prefer not to have to compile > each module twice, once with threads and once without. > > Also, it relies on a large number of libraries. I don't want to have > to have two versions of each library. > > But the manual seems to imply that I need to do that. Without official comment from the ocaml team, expect upgrading to newer ocaml releases to break things. Otherwise, should work for now. Jonathan