2011-07-29 20:51:11 mark florisson napisał(a):
> On 29 July 2011 19:18, Arfrever Frehtes Taifersar Arahesis
> <arfrever....@gmail.com> wrote:
> > 2011-07-26 13:00:10 mark florisson napisał(a):
> >> Unfortunately the output of the testrunner is rather useless here.
> >> Could you run the tests with --no-cleanup and attach the .c and .cpp
> >> files (found in build/run/c/numpy_cimport.c, etc)? I think something
> >> is up with your numpy version and headers. The numpy tests should be
> >> automatically skipped if numpy is not available.
> >
> > I have found the following lines in earlier part of output:
> >
> > runTest (__main__.CythonRunTestCase)
> > compiling (c) and running numpy_bufacc_T155 ... numpy_bufacc_T155.c: In 
> > function ‘PyInit_numpy_bufacc_T155’:
> > numpy_bufacc_T155.c:3652:5: warning: ‘return’ with no value, in function 
> > returning non-void
> > numpy_bufacc_T155 ()
> > Doctest: numpy_bufacc_T155 ... ok
> > runTest (__main__.CythonRunTestCase)
> > compiling (cpp) and running numpy_bufacc_T155 ... cc1plus: warning: command 
> > line option "-Wpointer-sign" is valid for C/ObjC but not for C++
> > numpy_bufacc_T155.cpp: In function ‘PyObject* PyInit_numpy_bufacc_T155()’:
> > numpy_bufacc_T155.cpp:3652:5: error: return-statement with no value, in 
> > function returning ‘PyObject*’
> > ERROR
> > runTest (__main__.CythonRunTestCase)
> > compiling (c) and running numpy_cimport ... numpy_cimport.c: In function 
> > ‘PyInit_numpy_cimport’:
> > numpy_cimport.c:3327:5: warning: ‘return’ with no value, in function 
> > returning non-void
> > numpy_cimport ()
> > Doctest: numpy_cimport ... ok
> > runTest (__main__.CythonRunTestCase)
> > compiling (cpp) and running numpy_cimport ... cc1plus: warning: command 
> > line option "-Wpointer-sign" is valid for C/ObjC but not for C++
> > numpy_cimport.cpp: In function ‘PyObject* PyInit_numpy_cimport()’:
> > numpy_cimport.cpp:3327:5: error: return-statement with no value, in 
> > function returning ‘PyObject*’
> > ERROR
> > runTest (__main__.CythonRunTestCase)
> > compiling (c) and running numpy_parallel ... numpy_parallel.c: In function 
> > ‘PyInit_numpy_parallel’:
> > numpy_parallel.c:3824:5: warning: ‘return’ with no value, in function 
> > returning non-void
> > test_parallel_numpy_arrays (line 11) (numpy_parallel.__test__)
> > Doctest: numpy_parallel.__test__.test_parallel_numpy_arrays (line 11) ... ok
> > runTest (__main__.CythonRunTestCase)
> > compiling (cpp) and running numpy_parallel ... cc1plus: warning: command 
> > line option "-Wpointer-sign" is valid for C/ObjC but not for C++
> > numpy_parallel.cpp: In function ‘PyObject* PyInit_numpy_parallel()’:
> > numpy_parallel.cpp:3824:5: error: return-statement with no value, in 
> > function returning ‘PyObject*’
> > ERROR
> > runTest (__main__.CythonRunTestCase)
> > compiling (c) and running numpy_test ... numpy_test.c: In function 
> > ‘PyInit_numpy_test’:
> > numpy_test.c:11604:5: warning: ‘return’ with no value, in function 
> > returning non-void
> > numpy_test ()
> > Doctest: numpy_test ... ok
> > runTest (__main__.CythonRunTestCase)
> > compiling (cpp) and running numpy_test ... cc1plus: warning: command line 
> > option "-Wpointer-sign" is valid for C/ObjC but not for C++
> > numpy_test.cpp: In function ‘PyObject* PyInit_numpy_test()’:
> > numpy_test.cpp:11604:5: error: return-statement with no value, in function 
> > returning ‘PyObject*’
> > ERROR
> >
> > Relevant source files:
> >
> > http://people.apache.org/~Arfrever/numpy_bufacc_T155.c
> > http://people.apache.org/~Arfrever/numpy_bufacc_T155.cpp
> > http://people.apache.org/~Arfrever/numpy_cimport.c
> > http://people.apache.org/~Arfrever/numpy_cimport.cpp
> > http://people.apache.org/~Arfrever/numpy_parallel.c
> > http://people.apache.org/~Arfrever/numpy_parallel.cpp
> > http://people.apache.org/~Arfrever/numpy_test.c
> > http://people.apache.org/~Arfrever/numpy_test.cpp
> 
> The compiler complains about the init function of the module, not sure
> why, but the line numbers don't seem to correspond with the files you
> provided. The tests run fine for me on both osx, fedora, and ubuntu,
> all with different gcc versions, so I'm assuming something is wrong
> with your setup.

Actually line numbers correspond to the files provided by me.
You probably tested with Python 2 instead of Python 3.

The files generated by Cython contain this line:
    import_umath();

numpy/__ufunc_api.h defines (see 'return' at the end):
#define import_umath() { UFUNC_NOFPE if (_import_umath() < 0) {PyErr_Print(); 
PyErr_SetString(PyExc_ImportError, "numpy.core.umath failed to import"); 
return; }}

pyport.h of Python 2.* defines:
#define PyMODINIT_FUNC void

pyport.h of Python 3.* defines:
#define PyMODINIT_FUNC PyObject*

-- 
Arfrever Frehtes Taifersar Arahesis

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to