[mercury-users] Problems building Mercury 0.13.0 on Mac OS X 10.4.7 Tiger
Markus Morawitz
markusmorawitz at gmx.de
Fri Sep 22 06:36:57 AEST 2006
Hello,
I have compiled the new Mercury release 0.13.0 on a G4 running Mac OS
X 10.4.7 Tiger.
Although using gcc version 3.3 as recommended (gcc 4.0 indeed do not
work at all) I have run into problems. Luckily I was able to find a
workaround changing two files after running configure and the build
of Mercury succeeded.
In the following I will shortly describe all the necessary steps to
compile and install Mercury on Mac OS X including the problem I have
encountered.
Step 1:
Run the configuration script as follows:
./configure --with-cc=/usr/bin/gcc-3.3
Step 2:
The problem occurs by linking against libgcc.a.
The configuration mechanism uses the command `/usr/bin/gcc-3.3 -print-
libgcc-file-name` to link against the library. But unfortunately this
command only results in the string "libgcc.a" and not the full path
of the library (which gcc-4.0 does!). The linker cannot find libgcc.a
and fails.
The correct argument for the linker must either be
-lgcc
or using the full path of libgcc.a which should be
/usr/lib/darwin/libgcc.a
Step 3:
The workaround is to exchange every occurance of `/usr/bin/gcc-3.3 -
print-libgcc-file-name` by -lgcc so the linker can link against the
library.
The two files "scripts/ml" and "Mmake.common" are affected.
scripts/ml :
#SHARED_LIBS=${MERCURY_SHARED_LIBS="`/usr/bin/gcc-3.3 -print-libgcc-
file-name` $MATH_LIB -lc"}
SHARED_LIBS=${MERCURY_SHARED_LIBS="-lgcc $MATH_LIB -lc"}
Mmake.common :
#SHARED_LIBS = `/usr/bin/gcc-3.3 -print-libgcc-file-name` $(MATH_LIB)
-lc
SHARED_LIBS = -lgcc $(MATH_LIB) -lc
Step 4:
Running "make" and "make install" after those two changes will
succeed in building Mercury.
Perhaps the configuration process can be investigated and changed
somehow to cope with the strange behaviour of the argument "-print-
libgcc-file-name" for gcc on Mac OS X.
Thank you and best regards
Markus Morawitz
markusmorawitz at gmx.de
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to: mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions: mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the users
mailing list