Compiling GNU Prolog 1.4.0 on MacOS X 10.7 (Lion)

Paulo Moura <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <[email protected]>
Hi,

This message is only of interest for MacOS X users that have upgraded to Lion (MacOS X 10.7) and which to compile GNU Prolog 1.4.0 from sources.

Lion's Xcode 4.1 changes the default C compiler from gcc-4.2 to llvm-gcc-4.2. The first part of the workaround for now is, you guessed it, to revert to gcc-4.2 when compiling GNU Prolog. If you're using MacPorts, you can patch the swi-prolog-devel portfile by adding the following lines:

platform darwin 11 {
	configure.compiler gcc-4.2
}

If you're not using MacPorts, you should be able to set the CC environment variable to gcc-4.2.

The issue with the default llvm-gcc-4.2 compiler (which also affects other Prolog compilers such as YAP and SWI-Prolog) seems to be related to memory management.

The second part of the workaround is to patch configure to make it aware of Lion. Open the configure file in a text editor and search for the two occurrences of the "darwin10" string, replacing it by "darwin1".

Cheers,

Paulo

-----------------------------------------------------------------
Paulo Jorge Lopes de Moura, PhD
Assistant Professor
Dep. of Computer Science, University of Beira Interior
6201-001 Covilhã, Portugal

Office 3.18  Ext. 3276
Phone: +351 275319891 Fax: +351 275319899
Email: <mailto:[email protected]>

Home page: <http://www.di.ubi.pt/~pmoura>
Research:  <http://logtalk.org/> Blog: <http://blog.logtalk.org/>
-----------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.