Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Lwt and OCamlMakefile
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-12-21 (03:02)
From: Michael Ekstrand <michael@e...>
Subject: Re: [Caml-list] Lwt and OCamlMakefile
On 12/20/2010 08:36 PM, wrote:
> Thanks, I forgot to mention that I am setting that:
> (*pp camlp4o pa_lwt.cmo *)
> (that is where it is coming from in my paste)
> But it is still failing at the Dynlink.

The thing is that camlp4o doesn't know where to find pa_lwt.cmo.  This
is what ocamlfind helps with.  Unfortunately, OCamlMakefile's ocamlfind
integration is incomplete when it comes to preprocessors.

On some systems, you may be able do 'camlp4o -I +lwt pa_lwt.cmo', but
that isn't portable (it depends on lwt being installed in the std-lib

So, the real solution is to use a shell script which wraps 'camlp4o' and
looks up the appropriate package lines with ocamlfind.  It will do
something like

camlp4 $(ocamlfind -predicates preprocesor,syntax -syntax camlp4o
-package lwt.syntax)

but I do not remember the exact details.  I do remember that I defined a
PP environment variable in my Makefile with the path to the script, so I
could do

(*pp $PP lwt.syntax *)

and it would expand to wherever the shell script was (I had multiple
directories in my source tree when I used OCamlMakefile).

- Michael