Simon King wrote: > > Dear sage team, Hi Simon,
> i wrote some module defining a class "Tensor" (just a quick hack), and > if this is in a file Tensors.spyx, then > sage: attach Tensors.spyx > works perfectly. > > Now, i changed it to a file Tensors.pyx, and created Tensors.so like > this: >> sage -cython Tensors.pyx >> gcc -c -fPIC -I/usr/local/include/python2.5/ -o Tensors.o Tensors.c >> gcc -shared -o Tensors.so Tensors.o > > I thought that "attach Tensors.spyx" does essentially the same. But > when i now say > sage: from Tensors import Tensor > i get > <type 'exceptions.ImportError'>: ./Tensors.so: undefined symbol: > PyUnicodeUCS2_DecodeUTF8 This indicates that this extension module has been build against a python bild with ucs2 while we now build python with ucs4. The solution is likely top include Sage's python headers located in $SAGE_LOCAL/include/python > What is the reason? Why is the internal compilation of the spyx file > working but not the compilation of the pyx file? It's the headers since you pick the wrong ones :) - Sage 2.10 was the first Sage release after we switched to ucs4, so with 2.8.x and 2.9.x the above would have worked. > Yours > Simon Cheers, Michael > > > --~--~---------~--~----~------------~-------~--~----~ 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://www.sagemath.org -~----------~----~----~----~------~----~------~--~---