On Monday 25 July 2011, john_perry_usm wrote:
> Thanks, William.
> 
> I don't know why I didn't try cimport on that other example; that
> certainly works with Rational.
> 
> But I shouldn't have simplified the example to that level. What I
> *really* want to cdef is MPolynomial_libsingular. Something like this:
> 
>     from sage.rings.polynomial.multi_polynomial_libsingular cimport
> MPolynomial_libsingular
> 
>     cpdef MPolynomial_libsingular add(MPolynomial_libsingular a,
> MPolynomial_libsingular b):
>       return a+b
> 
> But I get all kinds of errors. First a bunch like this:
> 
> -------------------------
> In file included from _Users_user_test_import_pyx_1.c:206:
> /Applications/Sage-4.6.2-OSX-64bit-10.6.app/Contents/Resources/sage/
> local/include/factory.h:29:20: error: iostream: No such file or
> directory
> In file included from /Applications/Sage-4.6.2-OSX-64bit-10.6.app/
> Contents/Resources/sage/local/include/factory.h:51,
>                  from _Users_user_test_import_pyx_1.c:206:
> /Applications/Sage-4.6.2-OSX-64bit-10.6.app/Contents/Resources/sage/
> local/include/templates/ftmpl_array.h:19: error: expected ‘=’, ‘,’,
> ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
> /Applications/Sage-4.6.2-OSX-64bit-10.6.app/Contents/Resources/sage/
> local/include/templates/ftmpl_array.h:43: error: expected ‘=’, ‘,’,
> ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
> -------------------------
> 
> then more of other types.

You'll need to compile your extension module (i.e. your pyx file) with C++ 
instead of C. See

http://sagemath.org/doc/developer/coding_in_cython.html#special-pragmas

Cheers,
Martin

--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://martinralbrecht.wordpress.com/
_jab: martinralbre...@jabber.ccc.de

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to