Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] shared libraries [pcre-ocaml]
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Nyberg <rnyberg@i...>
Subject: Re: [Caml-list] shared libraries [pcre-ocaml]
> > Argg... crappy unix hackery. The dynamic loader typically searches for
> > relative filenames in the ldconfig'd search path, augmented by LD_PATH
> > environment variable. Absolute filenames just get opened directly.
> > 
> > You can see below that ocaml is manually stat'ing dllpcre.so in places
> > it knows about before doing a dlopen on an absolute filename.
> > Unfortunately, it depends on another shared lib, and ld is
> > searching for that by itself.
> > 
> > It doesn't find it, since /usr/local/ocaml/site-lib/pcre isn't on the 
> > ldconfig path.
> > This suggests the binding to dllpcre.so.0 installed in dllpcre.so is a 
> > relative
> > filename. So does the ld.conf file above .. and if you run ldconfig on that,
> > of course now the load works.
> > 
> > Running ldconfig on the ld.conf file will work.
> > Another solution is simply to install dllpcre.so.0 in /usr/local/lib.
> > Another is to put a symbolic link there. None of these solutions is
> > very good ..
> 
> Almost correct answer: the problem is of course with libpcre.so.0, not
> dllpcre.so. So if you put libpcre.so.0 in any place where the system
> loader can find it (like /usr/local/lib, but also any directory in
> LD_LIBRARY_PATH), things will work smooth.
> 
> More basically, I would say that pcre-ocaml is not packaged correctly:
> for this kind of use, either the code of libpcre.so should be included
> in dllcpre.so (not too hard), or libcpre.so.0 should be installed to a
> public directory. Unfortunately the system loader does not provide any
> interface to change the load path cleanly.

Well, you are both right of course, but the real problem here was me.
There is no problem with pcre-ocaml if you tell it where to look for
its libraries. I had just missed setting OCAML_LIB_INSTALL correctly
when I installed pcre-ocaml.

So, it's my bad and I promise to _read_ the documentation instead of
just _looking_ at it next time ;)

	-Richard
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners