I tried to create llvm-py on Mac OS X.
This is what I was trying to do, I needed to download 11vm-2.7, and the README file has the following comment: Make sure '-enable-pic' is passed to LLVM '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, but when I tried to run the test file, I received this 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 to indicate that the "llvmExtractValueInst" function is missing with a flat memory problem. What is wrong with this?
In llvm 2.7, Makefile.rules has this line
SharedLinkOptions=-Wl,-flat_namespace -Wl,-undefined -Wl,suppress \
-dynamiclib
flat_namespace, .
ADDED
locojay brew llvmpy.
export REQUIRES_RTTI=1
brew install llvm --rtti
sudo pip install git+https://github.com/llvmpy/llvmpy
, , -
test> python example.py
Traceback (most recent call last):
File "example.py", line 4, in <module>
from llvm import *
File "/Library/Python/2.7/site-packages/llvm/__init__.py", line 11, in <module>
from 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
, 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)