Hi Sebastian,
On 06/14/2011 05:28 PM, Sebastian Weber wrote:
Hi there!
To answer my previous question myself: The trouble with dl and the like ceases once one creates a DLFCN.py file via the h2py.py script inside the python 2.7 source distribution. This file must be kept somewhere reachable to python - for example in the graph-tool python directory.
Strange, I don't see this problem at all. Are you using the standard python from macports? The DLFCN module should be there, since it is an standard module which should be defined for MacOS.
Morever, I fixed the problem with the wrong installation paths in the Portfile. As a result I obtained a fully working graph-tool inside macports. Note, that I compile numpy and scipy with the apple gcc which is not the default in Macports.
Except for the compilation segfault with +openmp, I was also able to install graph-tool with macports. I did not have to fiddle with DLFCN.
If DLFCN is somehow buggy on macports, it could easily be replaced by ctypes. Could you try replacing it in the dl_import.py file (just replace DLFCN by ctypes at the beginning)?
When loading graph-tool, I get though this error:
Traceback (most recent call last): File "../../python/grid2gml.py", line 3, in <module> from graph_tool.all import * File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/graph_tool/all.py", line 31, in <module>
from graph_tool.draw import *
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/graph_tool/draw/__init__.py", line 69, in <module>
libc.open_memstream.restype = ctypes.POINTER(ctypes.c_char)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 366, in __getattr__
func = self.__getitem__(name)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 371, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: dlsym(RTLD_DEFAULT, open_memstream): symbol not found
This seems to relate to new changes in git.
Hm, yes, I hadn't tested this it on macos yet. You can just comment out the offending line 69 in graph_tool/draw/__init__.py, and this should just work for you. I'll work on a proper fix.
Included is the Portfile I used which now has openmp disabled by default, since this will crash the apple gcc anyway...
Thanks. I will put this version on the website.
Cheers, Tiago