caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Threads?
@ 2009-04-23  7:37 David McClain
  2009-04-23  7:42 ` [Caml-list] Threads? Mark Shinwell
  2009-04-23  8:24 ` David Allsopp
  0 siblings, 2 replies; 4+ messages in thread
From: David McClain @ 2009-04-23  7:37 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1716 bytes --]

Hi,

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

File "_none_", line 1, characters 0-1:
Error: No implementations provided for the following modules:
          Thread referenced from ../src/sdsp.cmxa(SdlPrims)
make[1]: *** [sdsp.opt] Error 2
make: *** [subdirs] Error 2


Forgive the excessive number of -thread flags in there... this has  
been trial and error.

I understand that it can't seem to find a .ml file to go along with  
the thread.mli, because there isn't one provided by the distribution.  
I also understand that the functionality of the thread module is made  
up largely of the posix threads C-code in the otherlibs directory.  
Somehow the system needs to be coaxed to look into the threads  
subdirectory in the lib/ocaml folder, but I am at wits end at this  
point....

This make is proceeding on Mac OS X 10.4

I'm sure it is possible to do this, because I have an ancient  
(unreadable) make script that does so for another system. Surely  
there is a very simple solution here, short of my inventing an entire  
Makefile script for this project. Eh?

Thanks in advance...

Dr. David McClain
Chief Technical Officer
Refined Audiometrics Laboratory
4391 N. Camino Ferreo
Tucson, AZ  85750

email: dbm@refined-audiometrics.com
phone: 1.520.390.3995
web: http://www.refined-audiometrics.com




[-- Attachment #2: Type: text/html, Size: 6369 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Threads?
  2009-04-23  7:37 Threads? David McClain
@ 2009-04-23  7:42 ` Mark Shinwell
  2009-04-23  8:23   ` David McClain
  2009-04-23  8:24 ` David Allsopp
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Shinwell @ 2009-04-23  7:42 UTC (permalink / raw)
  To: David McClain; +Cc: caml-list

On Thu, Apr 23, 2009 at 12:37:14AM -0700, David McClain wrote:
> 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
>
> File "_none_", line 1, characters 0-1:
> Error: No implementations provided for the following modules:
>          Thread referenced from ../src/sdsp.cmxa(SdlPrims)
> make[1]: *** [sdsp.opt] Error 2
> make: *** [subdirs] Error 2

The order of the files on the command line matters here.  You need to follow
the order given on the page:

  http://caml.inria.fr/pub/docs/manual-ocaml/manual038.html

(in particular it looks like your sdsp.cmxa needs to come after threads.cmxa).
Does that make it work?

Mark


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Threads?
  2009-04-23  7:42 ` [Caml-list] Threads? Mark Shinwell
@ 2009-04-23  8:23   ` David McClain
  0 siblings, 0 replies; 4+ messages in thread
From: David McClain @ 2009-04-23  8:23 UTC (permalink / raw)
  To: Mark Shinwell; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1398 bytes --]

OMG!! You are a Prince! Thank you so much!

Cheers,

Dr. David McClain
Chief Technical Officer
Refined Audiometrics Laboratory
4391 N. Camino Ferreo
Tucson, AZ  85750

email: dbm@refined-audiometrics.com
phone: 1.520.390.3995
web: http://www.refined-audiometrics.com



On Apr 23, 2009, at 00:42, Mark Shinwell wrote:

> On Thu, Apr 23, 2009 at 12:37:14AM -0700, David McClain wrote:
>> 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
>>
>> File "_none_", line 1, characters 0-1:
>> Error: No implementations provided for the following modules:
>>          Thread referenced from ../src/sdsp.cmxa(SdlPrims)
>> make[1]: *** [sdsp.opt] Error 2
>> make: *** [subdirs] Error 2
>
> The order of the files on the command line matters here.  You need  
> to follow
> the order given on the page:
>
>   http://caml.inria.fr/pub/docs/manual-ocaml/manual038.html
>
> (in particular it looks like your sdsp.cmxa needs to come after  
> threads.cmxa).
> Does that make it work?
>
> Mark
>


[-- Attachment #2: Type: text/html, Size: 8973 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [Caml-list] Threads?
  2009-04-23  7:37 Threads? David McClain
  2009-04-23  7:42 ` [Caml-list] Threads? Mark Shinwell
@ 2009-04-23  8:24 ` David Allsopp
  1 sibling, 0 replies; 4+ messages in thread
From: David Allsopp @ 2009-04-23  8:24 UTC (permalink / raw)
  To: 'David McClain', caml-list

> 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 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-23  8:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).