igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] installing igraph 0.7.0 python version into Canopy on OSX -


From: Blair Conn
Subject: Re: [igraph] installing igraph 0.7.0 python version into Canopy on OSX - _igraph.so
Date: Mon, 23 Feb 2015 15:19:24 -0300
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi Tamas,

So here is how it went. I did all three, although I'm not sure if you meant to try one at a time.


On 5/2/15 1:35 PM, Tamas Nepusz wrote:
Hi,

I think I have an idea but I'm not 100% sure. It seems that igraph is compiled
with thread-local storage support by default (meaning that global variables are
declared as thread-local, so in theory it should be safe to use igraph from
multiple threads at the same time -- although it's highly experimental and not
tested thoroughly at all, so we do not officially support this). This seems to
be an error in the configure script because that was definitely not our
intention at all. I will have to follow up on this later.

Now, this means that when you install the C core, you get a copy of the igraph
library somewhere in your library path where thread-local variables are
enabled. On OS X, thread-local storage is actually emulated, and the
___emutls_get_address function is needed for this.

The problem is then that later on you compile the Python interface, and the
setup script of the Python interface is not able to find the installed C core
(as you mentioned this), so it *downloads* the C core again and compiles it --
but this time the installer explicitly passes the --disable-tls argument to the
configure script. Then you end up with a Python interface which is expected to
link to a C core *without* thread-local support, while the actual igraph
library that you have on your system is compiled *with* thread-local support.

I see three possible solutions if this is really the case:

1) Get rid of the existing C core installation of igraph. If you installed it
    in /usr/local (which is what igraph does by default), you can simply remove
    /usr/local/lib/libigraph* and /usr/local/include/igraph*
I removed both of these

2) Try to make the setup.py script of the Python interface find where the
    C core was installed instead of downloading it again. By default the setup
    script uses pkg-config to figure out where the C core is, so first try
    typing "pkg-config --cflags --libs igraph" into a terminal and check whether
    it is working. (It should print a bunch of compiler flags).

I had to add PKG_CONFIG_PATH to the PATH to get this to work.

-I/usr/local/include/igraph -L/usr/local/lib -ligraph


3) Recompile the C core with "./configure --disable-tls && make && make
    install", then recompile the Python interface as well (just to be on the
    safe side).

the c code ran ok with some warnings but nothing fatal.

then I re-ran the python, but I'm getting this error in Canopy, so I'm not sure if I properly did what you suggested in Step 1.

import igraph
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-8e950eb5d8d8> in <module>()
----> 1 import igraph

/Users/bconn/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/python_igraph-0.7.0-py2.7-macosx-10.6-x86_64.egg/igraph/__init__.py in <module>()
     32 # pylint: disable-msg=W0401
     33 # W0401: wildcard import
---> 34 from igraph._igraph import *
     35 from igraph._igraph import __version__, __build_date__
     36 from igraph.clustering import *

ImportError: dlopen(/Users/bconn/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/python_igraph-0.7.0-py2.7-macosx-10.6-x86_64.egg/igraph/_igraph.so, 2): Symbol not found: ___emutls_get_address Referenced from: /Users/bconn/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/python_igraph-0.7.0-py2.7-macosx-10.6-x86_64.egg/igraph/_igraph.so
  Expected in: flat namespace
in /Users/bconn/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/python_igraph-0.7.0-py2.7-macosx-10.6-x86_64.egg/igraph/_igraph.so


Let me know if it didn't work so we can continue investigating.

All the best,
Tamas
Cheers,
Blair

--
------------------------------------------
Blair Conn
Assistant Scientist
Queue Coordinator
Gemini Observatory, Chile
Ph: +56 512 205 793
------------------------------------------




reply via email to

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