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.
Nope, it is not. At least on my machine macports does not install any DLFCN.py.
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)?
I changed the respective line to
from ctypes import RTLD_LAZY, RTLD_GLOBAL
which does not work:
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/__init__.py", line 90, in <module> from dl_import import * File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/graph_tool/dl_import.py", line 28, in <module> from dl import RTLD_LAZY, RTLD_GLOBAL ImportError: No module named dl
Apparently, he falls back to the dl module, which is not installed on macports python.
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.
Thats what I did. After commenting this out, things work.
BTW, I saw this
I guess it is quite tedious to split every function declaration in a separate cpp file (and you do already to some extent in graph-tool), but using this technique a little more would help in cutting down compilation efforts. I am using here a machine with 8GB of RAM for the compilation and when I use 2 compilation processes in parallel my machine is swapping a lot! Apart from the fact that it takes really long to compile things. Ccache somehow did not help here to much for some reason as I always have to reject all compilations and start from scratch. Maybe the ccache macports integration will help here though, I will try.
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.
-- Tiago de Paula Peixoto email@example.com
graph-tool mailing list firstname.lastname@example.org http://lists.skewed.de/mailman/listinfo/graph-tool