caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "David Allsopp" <dra-news@metastack.com>
To: "'David McClain'" <dbm@refined-audiometrics.com>,
	<caml-list@yquem.inria.fr>
Subject: RE: [Caml-list] Threads?
Date: Thu, 23 Apr 2009 09:24:02 +0100	[thread overview]
Message-ID: <000601c9c3ec$dc57ce90$95076bb0$@com> (raw)
In-Reply-To: <CA490C1C-1279-4EDD-B2A7-51E9D678FBBD@refined-audiometrics.com>

> 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   -package camlp4 -package threads
-package unix -I ../src -I /usr/local/lib/ocaml/threads  \
>	-thread -cclib threads.a  nums.cmxa sdsp.cmxa threads/threads.cmxa  
\
>	readline.cmx scmMain.cmx 

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 ==> will be added by ocamlfind
	-cclib threads.a ==> I think will be added automatically by
threads.cmxa
	nums.cmxa ==> is better included by having num in your list of
findlib packages
	threads/threads.cmxa ==> 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 


      parent reply	other threads:[~2009-04-23  8:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23  7:37 Threads? David McClain
2009-04-23  7:42 ` [Caml-list] Threads? Mark Shinwell
2009-04-23  8:23   ` David McClain
2009-04-23  8:24 ` David Allsopp [this message]

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='000601c9c3ec$dc57ce90$95076bb0$@com' \
    --to=dra-news@metastack.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=dbm@refined-audiometrics.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;
as well as URLs for NNTP newsgroup(s).