[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: next ocaml and location of .so lib



On Mon, Sep 10, 2001 at 07:08:05PM +0200, Stefano Zacchiroli wrote:
> On Mon, Sep 10, 2001 at 02:33:36PM +0200, Sven wrote:
> > That said i don't really understand the rest of what you say here.
> 
> I'll try to explain better.
> 
> WRT ocaml toplevel loops, from ocaml 3.03 will be possible to load
> external modules using a #-directive (I don't remembre what) like #load
> or similar, this without have to build a custom ocaml toplevel using
> ocamlmktop. Currently if you want to try Unix module you have to build a
> customized toplevel with ocamlmktop command.

Yes, this is the dynamic loading feature in bytecode programs, i think it will
not only include the toplevel though.

> I don't know exactly how this loading works but it needs .so files and
> it search for them in a default directory and in directory specified at
> cmd line by user ("ocaml -I /usr/lib/mydir" for example).

Ok, up to there, all is ok.

> Well, if we leave all .so files where upstream installation put them, a
> user may have to specify several -I at command line to use different
> modules. If we reach an agreement on a location we may install all .so
> file in this location and compile ocaml with default .so search dir set
> to this location.

Erm, ...

1) if you are speaking about ocaml official libraries, my guess they will go
into /usr/lib/ocaml, for the ones from the otherlibs target (graphics and unix
come to mind).

2) other libraries, like the labltk library, altough part of the official
ocaml distribution, come in their own subdir, these and other non-official
packages which go into subdirectories have to be called with -I +labltk and
the like upto now. 

These second ones are the one that cause you problem.

But i suppose, both the :

	#directory "dir-name";;
	    Add the given directory to the list of directories searched for
	    source and compiled files.

and the :

	#cd "dir-name";;
	    Change the current working directory.

directive would solve the problem nicely.

Also i guess the #whatever directive should be able to acomodate a prefix
where to search the libraries, and as thus, you would do :

#whatever "dir-name/module_to_be_loaded" ?

Not sure about this last one, you could check it if you feel like it.

> In such a way a user that install a new module that require a .so file
> to be used in toplevel have nothing to do, he only has to run 'ocaml'
> and the new module can be loaded in the toplevel.

He still has to issue the #whatever directive to load the module, unless the
new modules does it by himself ? In this case, the new module could also add
the correct path to the directory list, don't you think.

Anyway, previous discution on the subject, both here, the caml list, and
private conversation with members of the caml team, it seems the approach is
to put things of the official ocam ldistrib in the camldir (/usr/lib/ocaml
under debian) and add-on libraries in camldir/library_name.

There is no reason not to put the .so in the same place as the rest of the
libraries, i think, a better approach would be to make sure such .so files can
easily be used, instead of putting all of them under the same subdir, but
then, maybe this is not how findlib sees it, or is there another reason for
having started this topic ?

Friendly,

Sven Luther
> 
> Is now clearer?
> 
> -- 
> Stefano "Zack" Zacchiroli <zack@cs.unibo.it> ICQ# 33538863
> Home Page: http://www.students.cs.unibo.it/~zacchiro
> Undergraduate student of Computer Science @ University of Bologna, Italy
>                  - Information wants to be Open -




Reply to: