caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Lwt and OCamlMakefile
@ 2010-12-21  1:05 orbitz
  2010-12-21  2:25 ` [Caml-list] " Markus Mottl
  0 siblings, 1 reply; 9+ messages in thread
From: orbitz @ 2010-12-21  1:05 UTC (permalink / raw)
  To: caml-list

Hey,
I'm using OCamlMakefile for a project that uses lwt, and I'm having  
trouble getting the right combination of settings to use the syntax  
extensiosn, specifically it is failing trying to calculate dependencies:

ocamlfind ocamldep -pp "camlp4o pa_lwt.cmo " pm_sge_utils.ml > ._d/ 
pm_sge_utils.d
Camlp4: Uncaught exception: DynLoader.Error ("pa_lwt.cmo", "file not  
found in path")


What do I need to do?

Thanks!


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

* Re: [Caml-list] Lwt and OCamlMakefile
  2010-12-21  1:05 Lwt and OCamlMakefile orbitz
@ 2010-12-21  2:25 ` Markus Mottl
  2010-12-21  2:36   ` orbitz
  0 siblings, 1 reply; 9+ messages in thread
From: Markus Mottl @ 2010-12-21  2:25 UTC (permalink / raw)
  To: orbitz; +Cc: caml-list

OCamlMakefile handles the preprocessing problem by requiring that the
first line of a file specifies the preprocessing command. It has the
form "(*pp ... *)", where "..." is the command you want to use for
preprocessing.  Both dependency calculation as well as compilation
will then be handled correctly.

Regards,
Markus

On Mon, Dec 20, 2010 at 20:05,  <orbitz@ezabel.com> wrote:
> Hey,
> I'm using OCamlMakefile for a project that uses lwt, and I'm having trouble
> getting the right combination of settings to use the syntax extensiosn,
> specifically it is failing trying to calculate dependencies:
>
> ocamlfind ocamldep -pp "camlp4o pa_lwt.cmo " pm_sge_utils.ml >
> ._d/pm_sge_utils.d
> Camlp4: Uncaught exception: DynLoader.Error ("pa_lwt.cmo", "file not found
> in path")
>
>
> What do I need to do?
>
> Thanks!
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>



-- 
Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com


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

* Re: [Caml-list] Lwt and OCamlMakefile
  2010-12-21  2:25 ` [Caml-list] " Markus Mottl
@ 2010-12-21  2:36   ` orbitz
  2010-12-21  3:02     ` Michael Ekstrand
  2010-12-21  8:57     ` Jérémie Dimino
  0 siblings, 2 replies; 9+ messages in thread
From: orbitz @ 2010-12-21  2:36 UTC (permalink / raw)
  To: Markus Mottl; +Cc: caml-list

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.


On Dec 20, 2010, at 9:25 PM, Markus Mottl wrote:

> OCamlMakefile handles the preprocessing problem by requiring that the
> first line of a file specifies the preprocessing command. It has the
> form "(*pp ... *)", where "..." is the command you want to use for
> preprocessing.  Both dependency calculation as well as compilation
> will then be handled correctly.
>
> Regards,
> Markus
>
> On Mon, Dec 20, 2010 at 20:05,  <orbitz@ezabel.com> wrote:
>> Hey,
>> I'm using OCamlMakefile for a project that uses lwt, and I'm having  
>> trouble
>> getting the right combination of settings to use the syntax  
>> extensiosn,
>> specifically it is failing trying to calculate dependencies:
>>
>> ocamlfind ocamldep -pp "camlp4o pa_lwt.cmo " pm_sge_utils.ml >
>> ._d/pm_sge_utils.d
>> Camlp4: Uncaught exception: DynLoader.Error ("pa_lwt.cmo", "file  
>> not found
>> in path")
>>
>>
>> What do I need to do?
>>
>> Thanks!
>>
>> _______________________________________________
>> Caml-list mailing list. Subscription management:
>> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
>> Archives: http://caml.inria.fr
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>>
>
>
>
> -- 
> Markus Mottl        http://www.ocaml.info         
> markus.mottl@gmail.com


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

* Re: [Caml-list] Lwt and OCamlMakefile
  2010-12-21  2:36   ` orbitz
@ 2010-12-21  3:02     ` Michael Ekstrand
  2010-12-21 18:42       ` orbitz
  2010-12-22  1:55       ` Romain Beauxis
  2010-12-21  8:57     ` Jérémie Dimino
  1 sibling, 2 replies; 9+ messages in thread
From: Michael Ekstrand @ 2010-12-21  3:02 UTC (permalink / raw)
  To: caml-list

On 12/20/2010 08:36 PM, orbitz@ezabel.com 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
directory).

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


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

* Re: [Caml-list] Lwt and OCamlMakefile
  2010-12-21  2:36   ` orbitz
  2010-12-21  3:02     ` Michael Ekstrand
@ 2010-12-21  8:57     ` Jérémie Dimino
  2010-12-21 10:21       ` Sylvain Le Gall
  1 sibling, 1 reply; 9+ messages in thread
From: Jérémie Dimino @ 2010-12-21  8:57 UTC (permalink / raw)
  To: orbitz; +Cc: caml-list

On Mon, Dec 20, 2010 at 09:36:39PM -0500, orbitz@ezabel.com wrote:
> Thanks, I forgot to mention that I am setting that:
> 
> (*pp camlp4o pa_lwt.cmo *)

This one should work:

  (*pp camlp4o `ocamlfind query -i-format lwt` `ocamlfind query -predicates syntax,preprocessor -a-format -r lwt.syntax` *)

-- 
Jérémie


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

* Re: Lwt and OCamlMakefile
  2010-12-21  8:57     ` Jérémie Dimino
@ 2010-12-21 10:21       ` Sylvain Le Gall
  2010-12-21 13:18         ` [Caml-list] " Adrien
  0 siblings, 1 reply; 9+ messages in thread
From: Sylvain Le Gall @ 2010-12-21 10:21 UTC (permalink / raw)
  To: caml-list

On 21-12-2010, Jérémie Dimino <jeremie@dimino.org> wrote:
> On Mon, Dec 20, 2010 at 09:36:39PM -0500, orbitz@ezabel.com wrote:
>> Thanks, I forgot to mention that I am setting that:
>> 
>> (*pp camlp4o pa_lwt.cmo *)
>
> This one should work:
>
>   (*pp camlp4o `ocamlfind query -i-format lwt` `ocamlfind query -predicates syntax,preprocessor -a-format -r lwt.syntax` *)
>

It will work on Linux. On Windows, you will get a problem because
ocamlfind EOL (win32) doesn't match "`...`" EOL wrapping (cygwin).

There was a similar problem with sexplib...

Regards,
Sylvain Le Gall


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

* Re: [Caml-list] Lwt and OCamlMakefile
  2010-12-21 10:21       ` Sylvain Le Gall
@ 2010-12-21 13:18         ` Adrien
  0 siblings, 0 replies; 9+ messages in thread
From: Adrien @ 2010-12-21 13:18 UTC (permalink / raw)
  To: caml-list

On 21/12/2010, Sylvain Le Gall <sylvain@le-gall.net> wrote:
> On 21-12-2010, Jérémie Dimino <jeremie@dimino.org> wrote:
>> On Mon, Dec 20, 2010 at 09:36:39PM -0500, orbitz@ezabel.com wrote:
>>> Thanks, I forgot to mention that I am setting that:
>>>
>>> (*pp camlp4o pa_lwt.cmo *)
>>
>> This one should work:
>>
>>   (*pp camlp4o `ocamlfind query -i-format lwt` `ocamlfind query
>> -predicates syntax,preprocessor -a-format -r lwt.syntax` *)
>>
>
> It will work on Linux. On Windows, you will get a problem because
> ocamlfind EOL (win32) doesn't match "`...`" EOL wrapping (cygwin).
>
> There was a similar problem with sexplib...
>

For windows, for sexplib and mikmatch_*str*, I do the preprocessing on
linux[1] and put everything in a git branch which I then access on
windows (I also love gitweb's ability to generate a tarball of the
source :-) ).

It also avoids the need to have a working camlp* on windows (msys).

It doesn't work for mikmatch_pcre because it requires an additional
library (for the "macro" feature) but it's been quite handy so far.
Most credits for the script go to Julien Moutinho.

[1] http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=yypkg/yypkg.git;a=blob;f=preprocess.sh

--

Adrien Nader


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

* Re: [Caml-list] Lwt and OCamlMakefile
  2010-12-21  3:02     ` Michael Ekstrand
@ 2010-12-21 18:42       ` orbitz
  2010-12-22  1:55       ` Romain Beauxis
  1 sibling, 0 replies; 9+ messages in thread
From: orbitz @ 2010-12-21 18:42 UTC (permalink / raw)
  To: Michael Ekstrand; +Cc: caml-list

Great, that looks like it's working.  Many thanks.


On Dec 20, 2010, at 10:02 PM, Michael Ekstrand wrote:

> On 12/20/2010 08:36 PM, orbitz@ezabel.com 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
> directory).
>
> 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
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


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

* Re: [Caml-list] Lwt and OCamlMakefile
  2010-12-21  3:02     ` Michael Ekstrand
  2010-12-21 18:42       ` orbitz
@ 2010-12-22  1:55       ` Romain Beauxis
  1 sibling, 0 replies; 9+ messages in thread
From: Romain Beauxis @ 2010-12-22  1:55 UTC (permalink / raw)
  To: caml-list; +Cc: Michael Ekstrand

Le mardi 21 décembre 2010 04:02:13, Michael Ekstrand a écrit :
> 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)

Would 
  camlp4o `ocamlfind query lwt.syntax}`/pa_lwt.cmo
do ?

Romain


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

end of thread, other threads:[~2010-12-22  1:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-21  1:05 Lwt and OCamlMakefile orbitz
2010-12-21  2:25 ` [Caml-list] " Markus Mottl
2010-12-21  2:36   ` orbitz
2010-12-21  3:02     ` Michael Ekstrand
2010-12-21 18:42       ` orbitz
2010-12-22  1:55       ` Romain Beauxis
2010-12-21  8:57     ` Jérémie Dimino
2010-12-21 10:21       ` Sylvain Le Gall
2010-12-21 13:18         ` [Caml-list] " Adrien

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).