[mercury-users] Mac OS X Compilation HOWTO

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Apr 16 20:04:43 AEST 2001


On 16-Apr-2001, Roy Ward <roy at videoscript.com> wrote:
> On with the hacks: 
> ================== 
> 
> 1) get recent versions of config.sub and config.guess

This is fixed in our CVS repository now.

> 2) The garbage collector needs to be told separately which platform we are
> on.

So is this.  The fix for this one is only on the main branch, not the
release branch, so it's only in the release-of-the-day releases, not
the 0.10.2-beta releases.

> [ 3) There was an issue with libm.a and Darwin 1.0 with mercury 0.9.1,
> this has been resolved with either MacOSX or Mercury 0.10.1]

Good ;-)

> 4) There is no gcc in OSX - it's called cc (but is still actually gcc,
> just with a different name). Mercury mostly autodetects, but one place
> got missed.

I think that one will only result in spurious error messages;
I don't think anything should actually break.
But we ought to fix it nevertheless.

> 5) There is a symbol conflict with r0..r31 between Mercury and some of
> the MacOSX libraries, the fix is to not define the symbols in Mercury.
> 
> In mercury_bootstrap.h, about line 31, add
> 
> #define MR_NO_BACKWARDS_COMPAT
> 
> above the 
> 
> #ifdef MR_NO_BACKWARDS_COMPAT

Probably we should make that the default sometime soon.
But currently that step is still needed.

> 6) I'm not sure how Darwin handles library stripping, but it didn't like
> the -s on about line 950 of scripts/ml.

I've just committed a fix for that one to our CVS repository.

> 7a) There's a patch which has I think now been committed to the
> Mercury source for later versions:
> 
> Index: runtime/mercury_heap.h

Yes, this is fixed in our CVS repository.

> 7b) Some more patches, at least some of these to workaround
> bugs in gcc on OSX:
> 
> Index: mercury_trace.c

That one is fixed in our repository.

> Index: mercury_trace_external.c

That one just avoids a warning when building on MacOS.
It's not needed.

> Index: mercury_wrapper.c

I've just committed a modified version of that patch to our CVS repository.

> 8) Now do the ./configure.
> 
> MacOSX doesn't support su 'out of the box' so you might have trouble
> getting privileges do the install. I used
> 
> ./configure --prefix <somewhere in user space>
> 
> to do an install I didn't need root permission to get at.
> 
> 9) After I compiled and installed Mercury, I found that I had to ranlib a
> few libraries. I was prompted for this.

That ought to be done automatically during installation.
Probably something went wrong in the autoconf detection of ranlib.
We ought to fix that.  But currently I don't have enough information to
know exactly what when wrong or how to fix it.

Anyway, in summary, for release-of-the-day releases dated *after*
2001-04-17, only steps 4, 5, 8, and 9 in your list should be needed.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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