On Friday, March 23, 2012 2:07:21 PM UTC-7, Snark wrote:
>
> Le jeudi 22 mars, Julien Puydt a écrit:
> > Le jeudi 22 mars, William Stein a écrit:
> > > On Wed, Mar 21, 2012 at 7:34 PM, Julien Puydt wrote:
> > > > Hi,
> > > >
> > > > yesterday I noticed that there are many places in sage's sources
> > > > (I only checked in the sage spkg) where inclusions are made with a
> > > > filename which looks like ../../../../../whatever (no exageration:
> > > > up to *five* levels!).
> > > >
> > > > Shouldn't those be removed, and the right path added to the
> > > > include line?
> > > 
> > > Yes!  I did this in psage and it helped a lot.   This will be easy.
> > > Open a trac ticket and do it.  Thanks!
> > 
> > Opening the trac ticket is done ; the patch will be longer to write :
> > 
> > http://trac.sagemath.org/sage_​trac/ticket/12728<http://trac.sagemath.org/sage_trac/ticket/12728>
>
> I gave it a go today, and I'm not progressing as much as I would like,
> because I don't know exactly how such a command-line can come to be:
> {{{
> python `which cython` --cplus --old-style-globals
> --disable-function-​redefinition --embed-positions --directive
> cdivision=True,autotestdict=​False,fast_getattr=True
> -I/home/jpuydt/sage-5.0.beta8/​devel/sage-main -o
> sage/algebras/quatalg/​quaternion_algebra_element.cpp
> sage/algebras/quatalg/​quaternion_algebra_element.pyx
>
> Error compiling Cython file:
> ------------------------------​------------------------------
> ...
> include "ext/cdefs.pxi"
> ^
> ------------------------------​------------------------------
>
> sage/algebras/quatalg/​quaternion_algebra_element.​pxd:1:0:
> 'ext/cdefs.pxi' not found
> }}
>
> in module_list.py, there is :
> {{{
>     Extension('sage.algebras.​quatalg.quaternion_algebra_​element',
>                sources =
> ['sage/algebras/quatalg/​quaternion_algebra_element.​pyx\ '],
>                language='c++',
>                libraries = ["csage", "flint", "gmp", "gmpxx", "m",
> "stdc++", "n\ tl"],
>                     include_dirs = [ SAGE_INC + 'FLINT/'],
>                depends =
>                     flint_depends),
> }}}
>
> and as you see, there is already an include_dirs list which appears
> here... but I don't see any path ending with an uppercase FLINT in the
> command line.
>
> I checked that by going in the right directory, and using a
> modified command-line with the right -I option, that file compiles.
>
> So I have two questions:
> (1) where does the lone -I in the command-line come from?
>
Don't know.
 

> (2) how come the include_dirs isn't used at all!? Isn't that supposed
> to be precisely its intent?!
>

I'm far from being a cython expert, but take a look at the log file for the 
Sage library (SAGE_ROOT/spkg/logs/sage-...): there will be a line (like 
yours):

python `which cython` --cplus --old-style-globals 
--disable-function-redefinition --embed-positions --directive 
cdivision=True,autotestdict=False,fast_getattr=True 
-I/Users/palmieri/Desktop/Sage_stuff/sage_builds/GCC-no-check/sage-5.0.beta8-gcc/devel/sage-main
 
-o sage/algebras/quatalg/quaternion_algebra_element.cpp 
sage/algebras/quatalg/quaternion_algebra_element.pyx

I believe that this creates the file quaternion_algebra_element.cpp but 
doesn't compile it, so no need for include_dirs.  Then later there is a 
line like this -- this is where the includes are used:

gcc -fno-strict-aliasing -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes 
-I/Users/palmieri/Desktop/Sage_stuff/sage_builds/GCC-no-check/sage-5.0.beta8-gcc/local/include/FLINT/
 
-I/Users/palmieri/Desktop/Sage_stuff/sage_builds/GCC-no-check/sage-5.0.beta8-gcc/local/include
 
-I/Users/palmieri/Desktop/Sage_stuff/sage_builds/GCC-no-check/sage-5.0.beta8-gcc/local/include/csage
 
-I/Users/palmieri/Desktop/Sage_stuff/sage_builds/GCC-no-check/sage-5.0.beta8-gcc/devel/sage/sage/ext
 
-I/Users/palmieri/Desktop/Sage_stuff/sage_builds/GCC-no-check/sage-5.0.beta8-gcc/local/include/python2.7
 
-c sage/algebras/quatalg/quaternion_algebra_element.cpp -o 
build/temp.macosx-10.7-x86_64-2.7/sage/algebras/quatalg/quaternion_algebra_element.o
 
-w

Anyone, please correct me if I'm wrong.

-- 
John

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to