On Sun, Mar 4, 2012 at 11:00 PM, Jonathan Bober <[email protected]> wrote:
> I've learned that I can easily build and use a cython file by just typing
> "load filename.pyx" at the Sage command prompt (and this is wonderful). I'm
> guessing that when I do this, Sage automatically adds some include files or
> compilation flags or something, because it works and I don't have to define
> malloc or any other basic stuff. However, I can't just compile the same file
> now with cython; I get lots of errors when I type "sage -cython
> filename.pyx" because whatever magic happens when I use the load command
> isn't happening.
>
> So what I'm wondering is: what does Sage do when I type "load filename.pyx"
> and how can I do the same thing myself?

It creates a directory like this:

   /Users/wstein/.sage/temp/deep.local/71468/spyx/_Users_wstein__sage_a_pyx

and inside there it makes a setup.py file, runs "python setup.py
install", then dynamically links in the generated .so file.

The directory above is $DOT_SAGE/temp/hostname/pid/spyx

 -- William

> (For some reason, I always seem to
> have lots of trouble figuring out how to compile cython code. Maybe I don't
> do it frequently enough.) In this case, what I really want to do right now
> it look at annotated cython output to see if some things are compiling the
> way that I think they should be compiling, but this is a slightly more
> general question than that.
>
> --
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

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

Reply via email to