Dear Sage-Support,

off-list, Robert pointed me to the source of the problem.

In my original setup.py, I used the optional parameter ext_package,
according to http://docs.python.org/distutils/setupscript.html:
-------------
If you have a number of extensions all in the same package (or all
under the same base package), use the ext_package keyword argument to
setup(). For example,

setup(...,
      ext_package='pkg',
      ext_modules=[Extension('foo', ['foo.c']),
                   Extension('subpkg.bar', ['bar.c'])],
     )

will compile foo.c to the extension pkg.foo, and bar.c to
pkg.subpkg.bar.
------------

Robert pointed out that this is not supported by Cython. With
examples, we found that it *is* supported if one only has .pyx-files,
but it fails as soon as one has .pxd-files. One has to provide the
fully qualified package name.

Moreover, in order to get the right package name hardcoded into the
modules, the source directory names have to match the package name.

I changed my sources and setup.py accordingly, removed the build/
directory that was created by "python setup.py install", and tried
again -- and still it failed!

Robert then pointed out that it does not suffice to remove (or empty)
the build/ directory --- I was not aware that the Cython-generated c-
files for the extension modules reside in the source directory. They
have to be removed, too, before rebuilding.

Now it works, including pickling.

Thank you, Robert!
      Simon

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

Reply via email to