[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] python-igraph OSX Lion install errors

From: Tamas Nepusz
Subject: Re: [igraph] python-igraph OSX Lion install errors
Date: Fri, 04 Nov 2011 14:18:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1


> I am using the Python distribution from python.org because earlier, while 
> installing scipy and mat plotlib, it turned out that the Mac OS pythons are 
> not preferable.
Yes, you're right, as far as I know the installers for SciPy and Matplotlib
are created for the Python distribution from python.org. I'm using the
system Python on my Mac and I'm testing the Python interface with that so I
have little experience with Python from python.org. Anyway, we'll try to
figure this out.

The way I see it, the problem is that Python from python.org is built with
the 32-bit version of gcc-4.0. When building a C extension module, Python
will try to use the same compiler version and options that Python itself was
built with. Since Mac OS X Lion does not include gcc-4.0 any more, the
default install script fails for igraph. *Sometimes* you can get around this
by tricking Python into using llvm-gcc-4.2 (this is the "export CC="
trickery that you did). Sometimes it does not work. The error message you
see implies that it does not work in your case.

First, I'd try "export CC=gcc-4.2; export CXX=g++-4.2". These are the
"non-LLVM" versions of gcc and they are hopefully more compatible with
python.org's Python than llvm-gcc. So, try building the Python interface
after "export CC=gcc-4.2; export CXX=g++-4.2". If it fails, try going back
to python.org and download a combined 64-bit/32-bit Python installer ("Mac
OS X 64-bit/32-bit x86-64/i386 Installer (2.7.2) for Mac OS X 10.6 and
10.7"). Chances are that this version was compiled with a newer gcc, most
likely gcc-4.2, so it would probabily solve your problem. However, before
doing this, you have to make sure that you have compiled the C core of
igraph for the i386 architecture! The easiest way to check this is as follows:

$ file /usr/local/lib/libigraph.0.dylib

If it says "i386" somewhere in the output, then you are okay. If it says
"x86_64", then your igraph library is currently compiled for 64-bit
architectures, so you have to go back to compiling the C core as follows:

export CC="gcc-4.2 -arch i386"
export CXX="g++-4.2 -arch i386"
make install

Hope this helps.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]