Hi Folks!

Is it really impossible to use sage Cython classes outside the devel
tree (say, in an spkg)?

I made the following tests:

- The file TestImport.pyx contains a single line:
from sage.structure.element cimport RingElement

- If TestImport.pyx is contained in SAGE_ROOT/devel, then
 sage -cython TestImport.pyx
works.

- Trying
 sage -cython TestImport.pyx
does *not* work, if TestImport.pyx is in SAGE_ROOT or outside the sage
tree.

- suppose you have a setup.py comprising:
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from sage.all import SAGE_ROOT
setup(
  name = "TestImport",
  version = "1.0",
  author = "Simon A. King",
  ext_modules=[
    Extension("TestImport",
              sources = ["TestImport.pyx"],
              include_dirs = ['.',SAGE_ROOT+'/devel/'])],
  cmdclass = {'build_ext': build_ext})

Running "python setup.py build_ext --inplace" in the sage-shell does
not work.

This is surprising for me, because I expected that include_dirs would
provide search paths for pxd-headers, and because "sage -cython
Testimport.pyx" worked inside SAGE_ROOT/devel/.

So, what must I do in order to successfully build my TestImport
extension (don't worry, I am not going to submit TestImport as an
spkg...)?

Cheers,
     Simon

--~--~---------~--~----~------------~-------~--~----~
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
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to