Re: [sage-support] Re: how does one do this in Cython?

2011-09-01 Thread Martin Albrecht
Funny you should ask because this was just fixed at SD32 where we ran into each other: http://trac.sagemath.org/sage_trac/ticket/11680 once it is merged you can write $SAGE_ROOT in these pragmas :) On 31 August 2011 19:17, john_perry_usm john.pe...@usm.edu wrote: Hi Martin, Sorry for the

[sage-support] Re: how does one do this in Cython?

2011-09-01 Thread john_perry_usm
On Sep 1, 4:50 am, Martin Albrecht martinralbre...@googlemail.com wrote: Funny you should ask because this was just fixed at SD32 where we ran into each other: http://trac.sagemath.org/sage_trac/ticket/11680 I actually read part of that ticket when I was there, though a lot more took place

[sage-support] Re: how does one do this in Cython?

2011-08-31 Thread john_perry_usm
Hi Martin, Sorry for the long reply; I looked at the solution a long time ago it seems to work. A natural question, naturally :-) is there an easier way to specify the include directory? after all, this changes by machine version. john On Jul 25, 8:34 am, Martin Albrecht

[sage-support] Re: how does one do this in Cython?

2011-07-25 Thread john_perry_usm
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

Re: [sage-support] Re: how does one do this in Cython?

2011-07-25 Thread Martin Albrecht
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

[sage-support] Re: how does one do this in Cython?

2011-07-25 Thread john_perry_usm
On Jul 25, 6:46 am, Martin Albrecht martinralbre...@googlemail.com wrote: 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 From that link, I understood that I need to prepend

Re: [sage-support] Re: how does one do this in Cython?

2011-07-25 Thread Martin Albrecht
Hi John, see attachment. You'll have to change the cinclude path for it to work on your machine. On Monday 25 July 2011, john_perry_usm wrote: On Jul 25, 6:46 am, Martin Albrecht martinralbre...@googlemail.com wrote: You'll need to compile your extension module (i.e. your pyx file) with

[sage-support] Re: how does one do this in Cython?

2011-07-24 Thread john_perry_usm
What about not-the-notebook? :-) For example, I have the following file, called test_rational.pyx: from sage.rings.rational import Rational cpdef Rational add(a, b): return a + b When I try to attach it to sage, I get: [lots of output removed]