dabeaz / bitey

Other
608 stars 32 forks source link

python dumps core on "import fib" in "typical" install #4

Open jn0 opened 12 years ago

jn0 commented 12 years ago

The question is: which versions of the libs are required?

I've tried to install things in "dumb user" way (in Ubuntu 12.04):

sudo apt-get install clang llvm-dev python-llvm \  
&& git clone https://github.com/dabeaz/bitey.git \  
&& cd bitey \  
&& python ./setup.py build \  
&& sudo python ./setup.py install  \  
&& python  
Python 2.7.3 (default, Aug  1 2012, 05:16:07)   
[GCC 4.6.3] on linux2  
Type "help", "copyright", "credits" or "license" for more information.  
>>> import bitey  
>>> import fib  
Segmentation fault (core dumped)

where

$ cat fib.c
/* fib.c */
int fib(int n) {
    if (n < 3) {
       return 1;
    } else {
       return fib(n-1) + fib(n-2);
    }
}
$ file fib.*
fib.c: ASCII text
fib.o: LLVM bitcode
$ dpkg -l | egrep 'clang|llvm-dev|python-llvm'
ii  clang                                   3.0-6ubuntu3                            Low-Level Virtual Machine (LLVM), C language family frontend
ii  libclang-common-dev                     3.0-6ubuntu3                            clang library - Common development package
ii  llvm-dev                                2.9-7                                   Low-Level Virtual Machine (LLVM), libraries and headers
ii  python-llvm                             0.6+svn105-1                            Python bindings for LLVM
dabeaz commented 12 years ago

You're going to need LLVM/Clang 3.1 and the latest llvmpy at http://www.llvmpy.org/. It is extremely unlikely that Bitey will work with any older versions of either library.

jn0 commented 12 years ago

But I afraid, it'd be difficult to build the bitey in case one have the libs installed in both ways (standard & custom)...

Well, not too much :) It works.

BTW, --mar options is not supported by configure script of llvm-3.1.