[mercury-users] the "extras" package

Warwick HARVEY warwick at cs.mu.OZ.AU
Sat May 29 19:52:13 AEST 1999


Robert Ernst Johann JESCHOFNIK <rejj at students.cs.mu.OZ.AU> wrote:
> I just realised that I had not grabbed the "extras" package yet, so I
> thought I would.. and am no faced with the task of installing them. heh.
> I can compile a lib (I started with the complex_numbers one) but I have no
> idea where to install it, and there is no target for install in
> the Mmakefile..
> 
> How/where do I install these "extra" libraries?

Support for installing and using "extra" libraries is currently rather 
lacking in Mercury.  I'm working on some patches to fix this, but they are 
not ready yet.

In the mean time, it is possible to build an use such libraries, but 
typically in only one grade at a time.  I suggest you start by looking at 
the examples in, say, the references directory tree (mainly you have to 
worry about the Mmakefiles, don't worry if you don't understand the Mercury 
code).  Basically, you build the library and just leave it where it is, and 
then add a whole bunch of extra stuff to the Mmakefiles in the directories 
of whatever programs wish to make use of it (in this case the `samples' and 
`tests' subdirectories).

Another one to look at is the stuff in the graphics section, such as 
mercury_tcltk.  Read the HOWTO, and look at the Mmakefiles in that and the 
example subdirectories.  Note however that the mercury_tcltk library 
requires a specially built garbage collection library --- see the HOWTO for 
more details.

If you want to be able to support multiple grades, you need something more 
sophisticated.  If you have write access to the Mercury installation 
directories, you can arrange to install to these directories.  A good 
example of how to do this is with the CLP(R) interface, but I'm not sure 
that that is included in the extras distribution.  Otherwise, look at how 
the main Mercury system Mmakefiles build and install the standard 
libraries, and copy the relevant chunks of the Mmakefiles and use them 
yourself.  (Though if you're not familiar with this stuff, it could take a 
bit of work --- plus it's no good if you can't install to the regular 
directories.)

Eventually I hope the user will be able to put entries along the lines of:

INSTALL_LIBRARY = foo
INSTALL_PREFIX = /home/wharvey/mymercury

in the Mmakefile of a directory containing the source for the library 
`foo', and then just type `mmake install' and have it build the library in 
all the appropriate grades, and install them in `/home/wharvey/mymercury'.

Then in the directory of a program wishing to make use of the libraries, 
they just add:

MERCURY_EXTRA_LIB_DIRS += /home/wharvey/mymercury
MERCURY_EXTRA_LIBRARIES += foo

to the Mmakefile, and the libraries are automatically found and used with 
no further effort on the part of the user.

The second half appears to be working now, but the first half still needs 
work.

Warwick

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list