caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: Suggestion for a site-lib directory
@ 1999-03-22 13:23 Reinhard Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Reinhard Budde @ 1999-03-22 13:23 UTC (permalink / raw)
  To: caml-list

Hello,

Gerd Stolpmann wrote:
> Let's consider another example, ocamltk. Usually this package resides in
> /usr/local/lib/ocaml/camltk, and it is not found by default; you have to add a
> -I option to all ocaml* commands. If all packages were installed this
> way, you would have to do setups for every project that uses such packages,
> i.e. modify your makefiles. That's not tolerable if you have many small
> projects.

Besides some large projects , I work on many small projects. I can live
perfectly with -I.

I'm using setup-makefiles that are included in many others. For example
sets the setup-makefile  a variable for being used in -I. 

Thus changes are reduced to 1 makefile, furthermore any dependant
makefile may change the setup locally (isn't that called implementation
inheritance :-). This way also solves my problem with generating code
for different OS on the same file-system.

Don't add too many bells and whistles, if that isn't really needed.
Often small is beautiful --- and easier to understand.

Reinhard
--------------
Reinhard Budde  reinhard.budde@gmd.de
GMD          -  German National Research Center for Information
Technology
AiS          -  Autonomous intelligent Systems
D-53754 St.Augustin     tel: +2241-14-2417,fax: +2241-14-2324
-- 
--------------
Reinhard Budde  reinhard.budde@gmd.de
GMD          -  German National Research Center for Information
Technology
AiS          -  Autonomous intelligent Systems
D-53754 St.Augustin     tel: +2241-14-2417,fax: +2241-14-2324




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

* Suggestion for a site-lib directory
@ 1999-03-19 19:34 Gerd Stolpmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Stolpmann @ 1999-03-19 19:34 UTC (permalink / raw)
  To: caml-list

Hi,

I'm currently trying the efuns package, and I've some comments
on the way efuns and other contributed packages could be better
installed. (Note: efuns is only an example.)

Efuns consists of several parts: some libraries that can be used
independently from the rest, and an application. This is rather
typical of contributed packages. Moreover, Efuns loads some
libraries dynamically. The problem is how libraries are located.
The efuns solution is trivial: all libraries are installed in 
Ocaml's default location, usually /usr/local/lib/ocaml. This
location has the advantage that it is checked by default such that
all ocaml* commands and the dynamic loader find compiled
interfaces and libraries stored there. The disadvantage is of course
that there is no clear separation between core files and added files,
and that it is difficult to uninstall (and upgrade) packages unless
a package manager is used. 

Let's consider another example, ocamltk. Usually this package resides in
/usr/local/lib/ocaml/camltk, and it is not found by default; you have to add a
-I option to all ocaml* commands. If all packages were installed this
way, you would have to do setups for every project that uses such packages,
i.e. modify your makefiles. That's not tolerable if you have many small
projects. 

As a first solution I thought about an environment variable OCAMLPATH. This
variable declares additional default locations that are searched in turn. The
idea is that you can now specify a default setup, i.e. put all locations into
OCAMLPATH where some package is installed which could be done in your profile.
That's of course more convenient than to maintain a bunch of makefiles.

But it has disadvantages, as there may be namespace conflicts. It is not
unlikely that several packages use the same names for modules (in efuns, for
example, there are some very common names like Time or Parse_file). It would
be better if you could specify which packages should be used.

Because of this I would prefer the following which is a compromise between
the various approaches.

- There should be at least one "site-lib" directory. This could be
  /usr/local/lib/ocaml/site-lib by default. 

- You can add further site-lib-like directories by setting an environment
  variable.
  (Or should the variable override the default? Think of multi-platform setups.)

- "site-lib" is NOT searched directly, but it contains directories where the
  packages can install their stuff. For example:
    site-lib/
        xlib/
            xlib.cmi
            ...
        asmdynlink/
            dynlink.cmi
            ...
        ocamltk/
            tk.cmi
            ...
- There is a new option -use-package <packagename> that searches the package-
  specific directory and has the same effect as if a corresponding -I option
  had been given with the absolute directory path. The difference is that
  -use-package includes a directory that is found upon a simple, unstructured
  package name whereas -I must have a path name (either absolute or relative)
  that may be different on different systems.

- The Dynlink module allows to refer to package directories, too.

- The #use directive can have optionally two parameters:
  E.g. #use "ocamltk", "tk.cma"

This type of overall setup makes Makefiles much simpler to maintain as
references to absolute locations can be avoided.

It would be nice if there were an ocamlinstall command that knows the absolute
location of the default site-lib directory. For example,

	ocamlinstall -make-package xlib xlib.cmi ...

first removes the xlib directory in site-lib (if existent), creates then a new
one and copies the given files to it.

	ocamlinstall -remove-package xlib

simply removes the directory where the named package resides. 

	ocamlinstall -whereis-package xlib

simply outputs the directory of "xlib".

What do you think about this suggestion? 

Gerd

--
----------------------------------------------------------------------------
Gerd Stolpmann      Telefon: +49 6151 997705 (privat)
Viktoriastr. 100             
64293 Darmstadt     EMail:   Gerd.Stolpmann@darmstadt.netsurf.de (privat)
Germany                     
----------------------------------------------------------------------------




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

end of thread, other threads:[~1999-03-22 14:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-22 13:23 Suggestion for a site-lib directory Reinhard Budde
  -- strict thread matches above, loose matches on Subject: below --
1999-03-19 19:34 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).