There is a know problem with annotation that has been fixed in the  
dev version, and release shipped with sage. Annotation isn't on by  
default though, is it?

- Robert


On May 17, 2008, at 3:32 AM, criceto11 wrote:

>
> The example in http://www.sagemath.org/doc/html/prog/node43.html
> does not compile on Debian 2.6.22-3-686
>
> [cython]$ cat muladd.spyx
> cimport sage.rings.integer
> def muladd(sage.rings.integer.Integer a,
>            sage.rings.integer.Integer b,
>            sage.rings.integer.Integer c):
>     """
>     Compute a*b + c
>     """
>     cdef sage.rings.integer.Integer d
>     d = sage.rings.integer.Integer()
>     mpz_mul(d.value, a.value, b.value)
>     mpz_add(d.value, d.value, c.value)
>     return d
>
> Replacing
>     cdef sage.rings.integer.Integer d
>     d = sage.rings.integer.Integer()
> with
>     cdef sage.rings.integer.Integer d = sage.rings.integer.Integer()
> it compiles and runs.
>
> Here is the error message (very cryptic):
> [cython]$ sage
> ----------------------------------------------------------------------
> | SAGE Version 3.0.1, Release Date: 2008-05-05                       |
> | Type notebook() for the GUI, and license() for information.        |
> ----------------------------------------------------------------------
>
> sage: load "muladd.spyx"
> Compiling muladd.spyx...
> Error compiling cython file:
> Error converting muladd.spyx to C:
>
> Traceback (most recent call last):
>   File "/home/mario/Packages/sage/sage-2.10/local/bin/cython", line 8,
> in <module>
>     main(command_line = 1)
>   File "/home/mario/Packages/sage/sage-2.10/local/lib/python2.5/site-
> packages/Cy
> thon/Compiler/Main.py", line 340, in main
>     result = context.compile(source, options)
>   File "/home/mario/Packages/sage/sage-2.10/local/lib/python2.5/site-
> packages/Cy
> thon/Compiler/Main.py", line 213, in compile
>     tree.process_implementation(scope, options, result)
>   File "/home/mario/Packages/sage/sage-2.10/local/lib/python2.5/site-
> packages/Cy
> thon/Compiler/ModuleNode.py", line 57, in process_implementation
>     self.generate_c_code(env, options, result)
>   File "/home/mario/Packages/sage/sage-2.10/local/lib/python2.5/site-
> packages/Cy
> thon/Compiler/ModuleNode.py", line 251, in generate_c_code
>     code.save_annotation(result.c_file[:-1] + "pyx") # change?
>   File "/home/mario/Packages/sage/sage-2.10/local/lib/python2.5/site-
> packages/Cy
> thon/Compiler/Annotate.py", line 146, in save_annotation
>     line = line.replace(cc, html)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position
> 0: ordinal
> not in range(128)
>
> 

--~--~---------~--~----~------------~-------~--~----~
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