Compiling ECL 11.1.1 on Mac OS X 10.7 (Lion)
-
25-12-2020 - |
Question
I have been trying to build ECL under OS X 10.7 and I have been running into trouble. When I try building it I end up getting a segfault on the ecl_min stage.
I configure with the following line:
./configure --build=x86_64 --target=x86_64 --prefix=`pwd`/install_ecl
CC=/Developer/usr/bin/gcc-4.2
And the compile fails with:
if [ -f CROSS-COMPILER ]; then \
./CROSS-COMPILER compile; \
else \
ECLDIR=`pwd`/ ./ecl_min compile; \
fi
/bin/sh: line 1: 17433 Segmentation fault: 11 ECLDIR=`pwd`/ ./ecl_min compile
I have tried building gmp and boehm-gc externally and not using the included ones, but unfortunately it ended up with the same results. I have also tried the default llvm-gcc without much luck either.
Has anyone been able to compile ECL under Lion, and if so, what configure options / patches did you need to apply.
Update: I was able to compile thanks to the accepted answer below. Here is the scripts that I used (Note: This is from a fresh git clone of ECL):
#!/bin/sh
ECL_INSTALLDIR="`pwd`/install_ecl"
mkdir -p $ECL_INSTALLDIR
./configure\
--prefix=$ECL_INSTALLDIR\
--enable-boehm\
--enable-unicode=no\
CC=/Developer/usr/bin/gcc\
CXX=/Developer/usr/bin/g++\
CFLAGS="$CFLAGS"
LDFLAGS="$LDFLAGS"
make && make install
Solution
This page describes the two causes of the problem (an issue with the compiler, and an issue with garbage collector compatibility), and offers a temporary solution until the issue itself is fixed. The instructions come down to:
- Download a new build of the Boehm-Weiser garbage collector library, apply a patch (you can get a link to download both the library and the patch from that page as well), and install it somewhere
- Configure ECL with these extra options:
--enable-boehm=system CPPFLAGS=-I/location/for/library/include LDFLAGS=-L/location/for/library/lib
Where /location/for/library
is the prefix you used to install the garbage collector.
And then it should build properly.
I also found this MacPorts ticket which seems to be tracking this issue; check there for future updates to see if it will be fixed.
OTHER TIPS
This problem has been fixed in git/CVS. As explained above, the cause for the miscompilation was the version of our garbage collector: we shipped the last one available: 7.1, but this does not work with OS X Lion. ECL now ships with two versions (7.1 and 7.2-cvs), using the newest one in OS X Lion. In other words, ECL from git/CVS (http://ecls.sourceforge.net/download.html) should compile and run out of the box.