#11680: support extra_compile_args (e.g., C99) when loading/attaching .pyx
(cython)
files, and when using %cython in the notebook
---------------------------+------------------------------------------------
Reporter: was | Owner: jason
Type: enhancement | Status: new
Priority: minor | Milestone: sage-4.7.2
Component: misc | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
---------------------------+------------------------------------------------
Right now, the following file foo.pyx cannot be just loaded into Sage:
{{{
from sage.rings.rational cimport Rational
from sage.rings.polynomial.polynomial_rational_flint cimport
Polynomial_rational_flint
from sage.libs.flint.fmpq_poly cimport (fmpq_poly_get_coeff_mpq,
fmpq_poly_set_coeff_mpq,
fmpq_poly_length)
def evaluate_at_power_of_gen(Polynomial_rational_flint f, unsigned long
n):
assert n >= 1
cdef Polynomial_rational_flint res = f._new()
cdef unsigned long k
cdef Rational z = Rational(0)
for k in range(fmpq_poly_length(f.__poly)):
fmpq_poly_get_coeff_mpq(z.value, f.__poly, k)
fmpq_poly_set_coeff_mpq(res.__poly, n*k, z.value)
return res
}}}
The main reason is that there is no way to tell Sage (i.e., the file
cython.py) that the code needs to have the extra compile flag:
{{{
extra_compile_args = ['-std=c99'],
}}}
Currently devel/sage/sage/misc/cython.py defines "clang", "clib", and
"cinclude". But none of these let us add an extra_compile_arg or use c99.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11680>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en.