Ticket #12468 (closed defect: invalid)
# cython: cdivision=True
| Reported by: | was | Owned by: | GeorgSWeber |
|---|---|---|---|
| Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
| Component: | build | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | N/A | Reviewers: | |
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
The file matrix_window_modn_dense.pyx starts with
# cython: cdivision=True
which suggests that putting a line like
# cython: cdivision=False
would have an impact on the directives used when compiling Cython code. This is not the case at all. Such a line is completely ignored.
To resolve this ticket, either make the directive not be ignored, or delete this line from matrix_window_modn_dense.pyx.
Note that the actual directories used are currently hard coded in devel/sage/sage/setup.py in this code:
# call cython, abort if it failed
cmd = "python `which cython` %s --old-style-globals --disable-function-redefinition --embed-positions --directive cdivision=True,autotestdict=False,fast_getattr=True -I%s -o %s %s"%(cplus, os.getcwd(), outfile, f)
r = run_command(cmd)
The default with PSAGE is cdivision=False. This is causing me headaches when porting code from psage to sage. (E.g., #12465). For #12465 I'll probably try to figure out how to rewrite my code to work with cdivision=True, or use explicit cython directives on a function-by-function level.

OK, now I feel stupid. So even though the command line explicitly has --directive cdivision=True,, when cython sees the file it does cdivision=False, as long as # cython: cdivision=False is in the file. So I'm basically just totally wrong. I'm closing this ticket as invalid. Sorry for the noise and confusion.