caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamlfind syntax problem
@ 2005-10-31  3:01 Pietro Abate
  2005-10-31  7:55 ` [Caml-list] " Alain Frisch
  2005-10-31  9:26 ` Gerd Stolpmann
  0 siblings, 2 replies; 3+ messages in thread
From: Pietro Abate @ 2005-10-31  3:01 UTC (permalink / raw)
  To: ocaml ml

Hi all,

I'm trying to learn how to use ocamlfind with camlp4 syntax files.

The problem is that my syntax file uses extlib and I get an undefined
reference to ExtLib when I try to compile everything with ocamlfind.

Since now I've compiled it following these steps:

1) I generate the ocaml code from my example using my syntax (with str
and extlib)
# camlp4o $STDLIB/str.cma $DESTDIR/extlib/extLib.cma syntaxfile.cma pr_o.cmo myex.ml > myex-pp.ml
2) I compile the result using other packages and ocamlfind.
# ocamlfind ocamlc -package mypackages myex-pp.ml

now I'm trying to skip the intermediate step. Therefore I've created 
my meta file that looks like this:

version = "0.1"
description = "syn file"
requires = "camlp4 extlib"
archive(syntax,preprocessor) = "syntaxfile.cma"

and I'm trying to link everything together with:
#ocamlfind ocamlc -package mypackages,syntaxfile -syntax syntaxfile myex.ml

but it complains that syntaxfile.cma has a Reference to undefined global `ExtLib'.

adding extlib to mypackages doesn't help... 
how can I pass $STDLIB/str.cma $DESTDIR/extlib/extLib.cma to the preprocessor 
via ocamlfind ?

:)
p

ps: my compilation infrastructure is more complex, but I think the
problem boils down to what I've described above.

-- 
++ Blog: http://blog.rsise.anu.edu.au/?q=pietro
++ 
++ "All great truths begin as blasphemies." -George Bernard Shaw
++ Please avoid sending me Word or PowerPoint attachments.
   See http://www.fsf.org/philosophy/no-word-attachments.html


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

* Re: [Caml-list] ocamlfind syntax problem
  2005-10-31  3:01 ocamlfind syntax problem Pietro Abate
@ 2005-10-31  7:55 ` Alain Frisch
  2005-10-31  9:26 ` Gerd Stolpmann
  1 sibling, 0 replies; 3+ messages in thread
From: Alain Frisch @ 2005-10-31  7:55 UTC (permalink / raw)
  To: Pietro Abate; +Cc: ocaml ml

Pietro Abate wrote:
> how can I pass $STDLIB/str.cma $DESTDIR/extlib/extLib.cma to the preprocessor 
> via ocamlfind ?

In general, you can pass extra options to the preprocessor with
ocamlfind's -ppopt option.

-- Alain


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

* Re: [Caml-list] ocamlfind syntax problem
  2005-10-31  3:01 ocamlfind syntax problem Pietro Abate
  2005-10-31  7:55 ` [Caml-list] " Alain Frisch
@ 2005-10-31  9:26 ` Gerd Stolpmann
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Stolpmann @ 2005-10-31  9:26 UTC (permalink / raw)
  To: Pietro Abate; +Cc: ocaml ml

Am Montag, den 31.10.2005, 14:01 +1100 schrieb Pietro Abate:
> Hi all,
> 
> I'm trying to learn how to use ocamlfind with camlp4 syntax files.
> 
> The problem is that my syntax file uses extlib and I get an undefined
> reference to ExtLib when I try to compile everything with ocamlfind.
> 
> Since now I've compiled it following these steps:
> 
> 1) I generate the ocaml code from my example using my syntax (with str
> and extlib)
> # camlp4o $STDLIB/str.cma $DESTDIR/extlib/extLib.cma syntaxfile.cma pr_o.cmo myex.ml > myex-pp.ml
> 2) I compile the result using other packages and ocamlfind.
> # ocamlfind ocamlc -package mypackages myex-pp.ml
> 
> now I'm trying to skip the intermediate step. Therefore I've created 
> my meta file that looks like this:
> 
> version = "0.1"
> description = "syn file"
> requires = "camlp4 extlib"
> archive(syntax,preprocessor) = "syntaxfile.cma"
> 
> and I'm trying to link everything together with:
> #ocamlfind ocamlc -package mypackages,syntaxfile -syntax syntaxfile myex.ml
> 
> but it complains that syntaxfile.cma has a Reference to undefined global `ExtLib'.

That's a known bug. Use -syntax camlp4o,byte as workaround.

The problem is that without "byte" all the archive(byte)="..." settings
are ignored.

Gerd

> adding extlib to mypackages doesn't help... 
> how can I pass $STDLIB/str.cma $DESTDIR/extlib/extLib.cma to the preprocessor 
> via ocamlfind ?
> 
> :)
> p
> 
> ps: my compilation infrastructure is more complex, but I think the
> problem boils down to what I've described above.
> 
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Telefon: 06151/153855                  Telefax: 06151/997714
------------------------------------------------------------


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

end of thread, other threads:[~2005-10-31  9:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-31  3:01 ocamlfind syntax problem Pietro Abate
2005-10-31  7:55 ` [Caml-list] " Alain Frisch
2005-10-31  9:26 ` Gerd Stolpmann

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