From: "Jonathan Roewen" <jonathan.roewen@gmail.com>
To: "Trevor Jim" <trevor@research.att.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] effect of -thread with ocamlc/ocamlopt -c
Date: Wed, 13 Sep 2006 09:29:43 +1200 [thread overview]
Message-ID: <ad8cfe7e0609121429x4ff57549o83b69ae37726ef67@mail.gmail.com> (raw)
In-Reply-To: <4506E954.8080207@research.att.com>
> 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
next prev parent reply other threads:[~2006-09-12 21:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-12 17:07 Trevor Jim
2006-09-12 21:29 ` Jonathan Roewen [this message]
2006-09-12 21:34 ` [Caml-list] " Jonathan Roewen
2006-09-13 14:59 ` Trevor Jim
2006-09-13 16:34 ` Jacques Garrigue
2006-09-13 16:57 ` Trevor Jim
2006-09-13 17:40 ` Xavier Leroy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ad8cfe7e0609121429x4ff57549o83b69ae37726ef67@mail.gmail.com \
--to=jonathan.roewen@gmail.com \
--cc=caml-list@yquem.inria.fr \
--cc=trevor@research.att.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox