Browse thread
camlp4 -I and shared libs
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Nicolas Pouillard <nicolas.pouillard@g...> |
| Subject: | Re: [Caml-list] camlp4 -I and shared libs |
On 6/25/07, Martin Jambon <martin.jambon@ens-lyon.org> wrote: > On Sun, 24 Jun 2007, Jake Donham wrote: > > > Hi, > > > > Should the -I flag to camlp4 add the directory to the shared library > > search path, as it does with ocamlc? > > > > I was trying to use Micmatch (very nice by the way) with ocamlfind, as > > follows: > > (thanks) > > > ocamlfind ocamlc -syntax camlp4o -ppopt pa_micmatch_pcre.cmo > > -package micmatch_pcre [...] > > It seems you forgot either -c or -linkpkg. > The following should work. > > ocamlfind ocamlc -c -syntax camlp4o -package micmatch_pcre toto.ml > ocamlfind ocamlc -o toto -syntax camlp4o -package micmatch_pcre -linkpkg toto.ml > > > > but I get an error that it cannot find dllpcre.so. What is happening > > is that ocamlfind has pcre-ocaml as a dependency of micmatch_pcre > > (even though this is needed only at runtime, not at preprocessing > > time), so it adds pcre.cma and -I $SITE_LIB/pcre to the camlp4 command > > line. Now pcre.cma needs dllpcre.so, which is in $SITE_LIB/pcre, but > > this path is not added to the shared library search path. (It's easy > > to work around this by constructing a camlp4 call directly, since > > pcre.cma is not needed.) > > > > This is with 3.09.3 but a glance at the 3.10.0 source suggests it has > > the same behavior. It's a one-line change (call Dll.add_path after > > Dynlink.init in camlp4/odyl/odyl_main.ml or > > camlp4/CamlP4/Struct/DynLoader.ml) to fix it. > > Note that the current version of micmatch does not work under ocaml/camlp4 > 3.10.0. I recommend using 3.09.3 until the new camlp4 is more mature. No major change is planned for Camlp4. I think that's reasonable to start translating extensions. -- Nicolas Pouillard