On 9/19/07, Simon King <[EMAIL PROTECTED]> wrote: > > Hello Mike, > > On Sep 19, 10:41 am, "Mike Hansen" <[EMAIL PROTECTED]> wrote: > > You can import the SAGE functionality you need in your module by just > > importing the appropriate sage modules into your .pyx file. > <snip> > > Thank you! > However, there seems to be a problem with this: > On top of my .pyx file, i included > from sage.all import GF > from sage.all import MatrixSpace > > It did compile, i obtained an .so file.
How? Did you try the system-wide Pyrex? If so, instead try doing sage -cython filename.pyx etc. By the way, when you do sage: load foo.spyx a working .so file like you want is actually created. It is put in $HOME/.sage/spyx/the_hostname_of_your_computer So you might just load your file then use that. Currently it is deleted when you exit, since there were some subtle problems with leaving it sitting around so it doesn't have to be recompiled each time you load it (mainly, I was worried about having tons of these files wasting disk space). I will likely turn caching back on though, so that sage: load foo.spyx will only take time the first time around. Actually, this caching thing is I think just a matter of changing the default to use_cache=True in each function in SAGE_ROOT/devel/sage/sage/misc/cython.py William > And SAGE did not complain when > i imported it. However, when i called a function from my module, there > was a NameError: > ... > --> 388 MS = > sage.all.MatrixSpace(sage.all.GF(mtxmat.fl),mtxmat.nor,mtxmat.noc) > ... > <type 'exceptions.NameError'>: sage > > I had the same line 388 in my .spyx file as well, and it worked. > > Yours > Simon > > > > > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/ -~----------~----~----~----~------~----~------~--~---