python - Building and running llvm-py on Mac OS X -
python - Building and running llvm-py on Mac OS X -
i trying build llvm-py on mac os x.
this tried do, needed download 11vm-2.7, , readme file has comment: create sure '--enable-pic' passed llvm's 'configure'
download llvm 2.7. build llvm 2.7: run./configure --prefix=llvm_directory --enable-pic
download llvm-py 0.6. build llvm-py 0.6: run python setup.py build --llvm-config=llvm_directory/bin/llvm-config
everything compiles without errors, when tried run test file, got error message.
importerror: 'dlopen(/library/python/2.7/site-packages/llvm/_core.so, 2): symbol not found: __ztvn4llvm16extractvalueinste\n referenced from: /library/python/2.7/site-packages/llvm/_core.so\n expected in: flat namespace\n in /library/python/2.7/site-packages/llvm/_core.so'
the message error seems there missing function "llvmextractvalueinst" flat namemspace issue. what's wrong this?
in llvm 2.7, makefile.rules has line
sharedlinkoptions=-wl,-flat_namespace -wl,-undefined -wl,suppress \ -dynamiclib
i tried remove flat_namespace
, got compilation error.
following locojay's answer, build brew , llvmpy.
export requires_rtti=1 brew install llvm --rtti sudo pip install git+https://github.com/llvmpy/llvmpy
however, when tried execute examples in test directory, still got different kind of error-
test> python example.py traceback (most recent phone call last): file "example.py", line 4, in <module> llvm import * file "/library/python/2.7/site-packages/llvm/__init__.py", line 11, in <module> llvm import _core importerror: dlopen(/library/python/2.7/site-packages/llvm/_core.so, 2): symbol not found: __zn4llvm10datalayout2ide referenced from: /library/python/2.7/site-packages/llvm/_core.so expected in: flat namespace in /library/python/2.7/site-packages/llvm/_core.so
this result when run otool -l /library/python/2.7/site-packages/llvm/_core.so
/library/python/2.7/site-packages/llvm/_core.so: /usr/lib/libsystem.b.dylib (compatibility version 1.0.0, current version 159.1.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
have @ docs of llvmpy
for llvm 3.2, create sure environment variable requires_rtti=1 defined when running make. otherwise, may see "undefined symbol: _ztin4llvm24passregistrationlistenere". please refer http://llvm.org/docs/packaging.html#c-features details.
so me worked
export requires_rtti=1 brew install llvm --rtti pip install git+https://github.com/llvmpy/llvmpy
i guess 1 can give anaconda seek in worst case....
python osx build llvm llvm-py
Comments
Post a Comment