Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cython error #25

Closed
adesnos opened this issue Aug 26, 2012 · 2 comments
Closed

cython error #25

adesnos opened this issue Aug 26, 2012 · 2 comments

Comments

@adesnos
Copy link

adesnos commented Aug 26, 2012

I have the following errors with the latest version:

python setup.py build_ext --inplace -f
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running build_ext
cythoning jnius/jnius.pyx to jnius/jnius.c

Error compiling Cython file:

...
#XXX not working with cython?
#jint (RegisterNatives)(JNIEnv, jclass, const_JNINativeMethod_, jint)
jint (UnregisterNatives)(JNIEnv, jclass)
jint (MonitorEnter)(JNIEnv, jobject)
jint (MonitorExit)(JNIEnv, jobject)
jint (GetJavaVM)(JNIEnv, JavaVM_*)

^

/home/desnos/python/pyjnius/jnius/jni.pxi:375:42: 'JavaVM' is not a type identifier

Error compiling Cython file:

...
jboolean JNI_FALSE
ctypedef struct JavaVMInitArgs:
jint version
jint nOptions
jboolean ignoreUnrecognized
JavaVMOption *options

^

/home/desnos/python/pyjnius/jnius/jnius_jvm_desktop.pxi:12:8: 'JavaVMOption' is not a type identifier

Error compiling Cython file:

...
j_env[0].ExceptionClear(j_env)
raise JavaException('JVM exception occured')

cdef dict assignable_from = {}
cdef void check_assignable_from(JNIEnv *env, JavaClass jc, bytes signature) except *:

^

/home/desnos/python/pyjnius/jnius/jnius_utils.pxi:44:45: 'JavaClass' is not a type identifier

Error compiling Cython file:

...
cdef dict assignable_from = {}
cdef void check_assignable_from(JNIEnv *env, JavaClass jc, bytes signature) except *:
cdef jclass cls

# if we have a JavaObject, it's always ok.
if signature == 'java/lang/Object':
            ^

/home/desnos/python/pyjnius/jnius/jnius_utils.pxi:48:17: Comparisons between bytes/unicode and str are not portable to Python 3

Error compiling Cython file:

...
cls = env[0].FindClass(env, signature)
if cls == NULL:
raise JavaException('Unable to found the class for {0!r}'.format(
signature))

    result = bool(env[0].IsAssignableFrom(env, jc.j_cls, cls))
                                                ^

/home/desnos/python/pyjnius/jnius/jnius_utils.pxi:66:53: Cannot convert Python object to 'jclass'

Error compiling Cython file:

...

for index in range(len(sign_args)):
    r = sign_args[index]
    arg = args[index]

    if r == 'Z':
        ^

/home/desnos/python/pyjnius/jnius/jnius_utils.pxi:103:13: Comparisons between bytes/unicode and str are not portable to Python 3

Error compiling Cython file:

...
if not isinstance(arg, bool):
return -1
score += 10
continue

    if r == 'B':
        ^

/home/desnos/python/pyjnius/jnius/jnius_utils.pxi:109:13: Comparisons between bytes/unicode and str are not portable to Python 3

Error compiling Cython file:

...
if not isinstance(arg, int):
return -1
score += 10
continue

    if r == 'C':
        ^

/home/desnos/python/pyjnius/jnius/jnius_utils.pxi:115:13: Comparisons between bytes/unicode and str are not portable to Python 3

Error compiling Cython file:

...
if not isinstance(arg, str) or len(arg) != 1:
return -1
score += 10
continue

    if r == 'S' or r == 'I' or r == 'J':
        ^

/home/desnos/python/pyjnius/jnius/jnius_utils.pxi:121:13: Comparisons between bytes/unicode and str are not portable to Python 3

Error compiling Cython file:

...
if not isinstance(arg, str) or len(arg) != 1:
return -1
score += 10
continue

    if r == 'S' or r == 'I' or r == 'J':
                    ^

/home/desnos/python/pyjnius/jnius/jnius_utils.pxi:121:25: Comparisons between bytes/unicode and str are not portable to Python 3

Error compiling Cython file:

...
if not isinstance(arg, str) or len(arg) != 1:
return -1
score += 10
continue

    if r == 'S' or r == 'I' or r == 'J':
                                ^

/home/desnos/python/pyjnius/jnius/jnius_utils.pxi:121:37: Comparisons between bytes/unicode and str are not portable to Python 3

Error compiling Cython file:

...
score += 5
continue
else:
return -1

    if r == 'F' or r == 'D':
        ^

/home/desnos/python/pyjnius/jnius/jnius_utils.pxi:131:13: Comparisons between bytes/unicode and str are not portable to Python 3

Error compiling Cython file:

...
score += 5
continue
else:
return -1

    if r == 'F' or r == 'D':
                    ^

/home/desnos/python/pyjnius/jnius/jnius_utils.pxi:131:25: Comparisons between bytes/unicode and str are not portable to Python 3

Error compiling Cython file:

...
if arg is None:
score += 10
continue

        # if it's a string, accept any python string
        if r == 'java/lang/String' and isinstance(arg, basestring):
            ^

/home/desnos/python/pyjnius/jnius/jnius_utils.pxi:150:17: Comparisons between bytes/unicode and str are not portable to Python 3

Error compiling Cython file:

...
score += 10
continue

        # if it's a generic object, accept python string, or any java
        # class/object
        if r == 'java/lang/Object':
            ^

/home/desnos/python/pyjnius/jnius/jnius_utils.pxi:156:17: Comparisons between bytes/unicode and str are not portable to Python 3

Error compiling Cython file:

...
cdef bytes r = definition[1:-1]
cdef JavaObject ret_jobject
cdef JavaClass ret_jc

# we got a generic object -> lookup for the real name instead.
if r == 'java/lang/Object':
    ^

/home/desnos/python/pyjnius/jnius/jnius_conversion.pxi:82:9: Comparisons between bytes/unicode and str are not portable to Python 3

Error compiling Cython file:

...
# we got a generic object -> lookup for the real name instead.
if r == 'java/lang/Object':
r = lookup_java_object_name(j_env, j_object)

# if we got a string, just convert back to Python str.
if r == 'java/lang/String':
    ^

/home/desnos/python/pyjnius/jnius/jnius_conversion.pxi:86:9: Comparisons between bytes/unicode and str are not portable to Python 3
building 'jnius' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/jvm/java-6-sun-1.6.0.26/include -I/usr/lib/jvm/java-6-sun-1.6.0.26/include/linux -I/usr/include/python2.7 -c jnius/jnius.c -o build/temp.linux-x86_64-2.7/jnius/jnius.o
jnius/jnius.c:1:2: erreur: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'gcc' failed with exit status 1
make: *** [build_ext] Erreur 1

@adesnos
Copy link
Author

adesnos commented Aug 26, 2012

With python 2.7, ubuntu 64 bits

@adesnos
Copy link
Author

adesnos commented Aug 26, 2012

ok I used cython 0.14.1 (default ubuntu package), with the latest version 0.16 it is ok.

@adesnos adesnos closed this as completed Aug 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant