pombreda / llvm-py

Automatically exported from code.google.com/p/llvm-py
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Compile error with default compiler on Gentoo #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use Gentoo
2. python setup.py build

What is the expected output? What do you see instead?
Should just build. Instead I get the following error:
Using llvm-config=llvm-config
running build
running build_py
creating build
creating build/lib.linux-i686-2.5
creating build/lib.linux-i686-2.5/llvm
copying llvm/__init__.py -> build/lib.linux-i686-2.5/llvm
copying llvm/core.py -> build/lib.linux-i686-2.5/llvm
copying llvm/ee.py -> build/lib.linux-i686-2.5/llvm
copying llvm/passes.py -> build/lib.linux-i686-2.5/llvm
copying llvm/_util.py -> build/lib.linux-i686-2.5/llvm
running build_ext
building 'llvm._core' extension
creating build/temp.linux-i686-2.5
creating build/temp.linux-i686-2.5/llvm
i686-pc-linux-gnu-g++ -pthread -fPIC -D__STDC_LIMIT_MACROS -D_GNU_SOURCE
-I/home/fn6/local/include -I/usr/include/python2.5 -c -D__STDC_LIMIT_MACROS
-D_GNU_SOURCE -I/home/fn6/local/include -I/usr/include/python2.5 -c
llvm/_core.c -o build/temp.linux-i686-2.5/llvm/_core.o
llvm/_core.c: In function ‘PyObject* _wLLVMConstICmp(PyObject*, PyObject*)’:
llvm/_core.c:385: error: invalid conversion from ‘unsigned int’ to
‘LLVMIntPredicate’
llvm/_core.c:385: error:   initializing argument 1 of ‘LLVMOpaqueValue*
LLVMConstICmp(LLVMIntPredicate, LLVMOpaqueValue*, LLVMOpaqueValue*)’
llvm/_core.c: In function ‘PyObject* _wLLVMConstFCmp(PyObject*, PyObject*)’:
llvm/_core.c:386: error: invalid conversion from ‘unsigned int’ to
‘LLVMRealPredicate’
llvm/_core.c:386: error:   initializing argument 1 of ‘LLVMOpaqueValue*
LLVMConstFCmp(LLVMRealPredicate, LLVMOpaqueValue*, LLVMOpaqueValue*)’
llvm/_core.c: In function ‘PyObject* _wLLVMConstVICmp(PyObject*, 
PyObject*)’:
llvm/_core.c:387: error: invalid conversion from ‘unsigned int’ to
‘LLVMIntPredicate’
llvm/_core.c:387: error:   initializing argument 1 of ‘LLVMOpaqueValue*
LLVMConstVICmp(LLVMIntPredicate, LLVMOpaqueValue*, LLVMOpaqueValue*)’
llvm/_core.c: In function ‘PyObject* _wLLVMConstVFCmp(PyObject*, 
PyObject*)’:
llvm/_core.c:388: error: invalid conversion from ‘unsigned int’ to
‘LLVMRealPredicate’
llvm/_core.c:388: error:   initializing argument 1 of ‘LLVMOpaqueValue*
LLVMConstVFCmp(LLVMRealPredicate, LLVMOpaqueValue*, LLVMOpaqueValue*)’
llvm/_core.c: In function ‘PyObject* _wLLVMSetLinkage(PyObject*, 
PyObject*)’:
llvm/_core.c:421: error: invalid conversion from ‘int’ to ‘LLVMLinkage’
llvm/_core.c:421: error:   initializing argument 2 of ‘void
LLVMSetLinkage(LLVMOpaqueValue*, LLVMLinkage)’
llvm/_core.c: In function ‘PyObject* _wLLVMSetVisibility(PyObject*,
PyObject*)’:
llvm/_core.c:425: error: invalid conversion from ‘int’ to 
‘LLVMVisibility’
llvm/_core.c:425: error:   initializing argument 2 of ‘void
LLVMSetVisibility(LLVMOpaqueValue*, LLVMVisibility)’
llvm/_core.c: In function ‘PyObject* _wLLVMAddAttribute(PyObject*, 
PyObject*)’:
llvm/_core.c:477: error: invalid conversion from ‘int’ to 
‘LLVMAttribute’
llvm/_core.c:477: error:   initializing argument 2 of ‘void
LLVMAddAttribute(LLVMOpaqueValue*, LLVMAttribute)’
llvm/_core.c: In function ‘PyObject* _wLLVMRemoveAttribute(PyObject*,
PyObject*)’:
llvm/_core.c:478: error: invalid conversion from ‘int’ to 
‘LLVMAttribute’
llvm/_core.c:478: error:   initializing argument 2 of ‘void
LLVMRemoveAttribute(LLVMOpaqueValue*, LLVMAttribute)’
llvm/_core.c: In function ‘PyObject* _wLLVMAddInstrAttribute(PyObject*,
PyObject*)’:
llvm/_core.c:514: error: invalid conversion from ‘int’ to 
‘LLVMAttribute’
llvm/_core.c:514: error:   initializing argument 3 of ‘void
LLVMAddInstrAttribute(LLVMOpaqueValue*, unsigned int, LLVMAttribute)’
llvm/_core.c: In function ‘PyObject* _wLLVMRemoveInstrAttribute(PyObject*,
PyObject*)’:
llvm/_core.c:515: error: invalid conversion from ‘int’ to 
‘LLVMAttribute’
llvm/_core.c:515: error:   initializing argument 3 of ‘void
LLVMRemoveInstrAttribute(LLVMOpaqueValue*, unsigned int, LLVMAttribute)’
llvm/_core.c: In function ‘PyObject* _wLLVMBuildICmp(PyObject*, PyObject*)’:
llvm/_core.c:633: error: invalid conversion from ‘int’ to 
‘LLVMIntPredicate’
llvm/_core.c:633: error:   initializing argument 2 of ‘LLVMOpaqueValue*
LLVMBuildICmp(LLVMOpaqueBuilder*, LLVMIntPredicate, LLVMOpaqueValue*,
LLVMOpaqueValue*, const char*)’
llvm/_core.c: In function ‘PyObject* _wLLVMBuildFCmp(PyObject*, PyObject*)’:
llvm/_core.c:634: error: invalid conversion from ‘int’ to 
‘LLVMRealPredicate’
llvm/_core.c:634: error:   initializing argument 2 of ‘LLVMOpaqueValue*
LLVMBuildFCmp(LLVMOpaqueBuilder*, LLVMRealPredicate, LLVMOpaqueValue*,
LLVMOpaqueValue*, const char*)’
llvm/_core.c: In function ‘PyObject* _wLLVMBuildVICmp(PyObject*, 
PyObject*)’:
llvm/_core.c:635: error: invalid conversion from ‘int’ to 
‘LLVMIntPredicate’
llvm/_core.c:635: error:   initializing argument 2 of ‘LLVMOpaqueValue*
LLVMBuildVICmp(LLVMOpaqueBuilder*, LLVMIntPredicate, LLVMOpaqueValue*,
LLVMOpaqueValue*, const char*)’
llvm/_core.c: In function ‘PyObject* _wLLVMBuildVFCmp(PyObject*, 
PyObject*)’:
llvm/_core.c:636: error: invalid conversion from ‘int’ to 
‘LLVMRealPredicate’
llvm/_core.c:636: error:   initializing argument 2 of ‘LLVMOpaqueValue*
LLVMBuildVFCmp(LLVMOpaqueBuilder*, LLVMRealPredicate, LLVMOpaqueValue*,
LLVMOpaqueValue*, const char*)’
error: command 'i686-pc-linux-gnu-g++' failed with exit status 1

Using 
CXX=gcc-4.3.1 python setup.py build
works.

What version of the product are you using? On what operating system?
python2.5, llvm 2.4, llvm-py 0.5, Gentoo 2008.0

Please provide any additional information below.
I don't know if this is llvm-py specific, but maybe you can hard code gcc
so that g++ does not get used.

Original issue reported on code.google.com by fnoed...@googlemail.com on 1 Dec 2008 at 10:57

GoogleCodeExporter commented 9 years ago
Correction:
Using
CXX=gcc-4.3.1 python setup.py build
does not work. It compiles cleanly, but the test cases don't work.

Traceback (most recent call last):
  File "testall.py", line 10, in <module>
    from llvm.core import *
  File "/home/fn6/exoself/3rdparty/pylibs/llvm/core.py", line 38, in <module>
    import llvm._core as _core  # C wrappers
ImportError:
/home/fn6/exoself/3rdparty/llvm-py/build/lib.linux-i686-2.5/llvm/_core.so: 
undefined
symbol: __cxa_pure_virtual

Original comment by fnoed...@googlemail.com on 1 Dec 2008 at 11:05

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Could you try with both CXX=gcc-4.3.1 and the following change:

In setup.py, locate:

std_libs    = [ 'pthread', 'm' ]

and change it to:

std_libs    = [ 'pthread', 'm', 'stdc++' ]

and then try a clean build (remove the directory 'build' and recompile, or use
'setup.py build -f').

This issue is same as Issue #7. Since I don't have access to a gentoo system, 
any
help in fixing this would be much appreciated.

Original comment by mdevan.f...@gmail.com on 2 Dec 2008 at 4:27

GoogleCodeExporter commented 9 years ago
Both gcc-4.3.1 and gcc-4.2.4 work with your change.

Original comment by fnoed...@googlemail.com on 2 Dec 2008 at 7:48

GoogleCodeExporter commented 9 years ago
r57 should fix this, please check. Now llvm-py should build with either gcc or 
g++.

Original comment by mdevan.f...@gmail.com on 22 Dec 2008 at 5:48