#4000: Implement QQ['x'] via Flint ZZ['x'] + denominator
------------------------------+---------------------------------------------
 Reporter:  malb              |         Owner:  somebody                        
                          
     Type:  enhancement       |        Status:  needs_work                      
                          
 Priority:  blocker           |     Milestone:  sage-4.6                        
                          
Component:  basic arithmetic  |    Resolution:                                  
                          
 Keywords:                    |        Author:  Sebastian Pancratz, Martin 
Albrecht                       
 Upstream:  N/A               |      Reviewer:  John Cremona, Martin Albrecht, 
Alex Ghitza, Harald Schilly
   Merged:  sage-4.6.alpha1   |   Work_issues:  Solaris build error, doctest 
error                        
------------------------------+---------------------------------------------

Comment(by mpatel):

 On the Solaris build error: From `SAGE_ROOT/devel/sage/module_list.py`:
 {{{
 #!python
     Extension('sage.rings.polynomial.polynomial_rational_flint',
               sources =
 ['sage/rings/polynomial/polynomial_rational_flint.pyx',
 'sage/libs/flint/fmpq_poly.c'],
               language = 'c++',
               extra_compile_args=["-std=c99", "-D_XPG6"],
               libraries = ["csage", "flint", "ntl", "gmpxx", "gmp"],
               include_dirs = [SAGE_ROOT + '/local/include/FLINT/',
 SAGE_ROOT + '/devel/sage/sage/libs/flint/'],
               depends = [SAGE_ROOT + "/local/include/FLINT/flint.h"]),
 }}}
 If I understand correctly (and to recap, somewhat):

  * The `language` option just tells Cython to create a C++ file
 `polynomial_rational_flint.cpp` from the Cython file
 `polynomial_rational_flint.pyx`, so that we can compile the .cpp file with
 NTL's C++ headers, etc.
  * The `extra_compile_args` here are really only for compiling the C99
 file `fmpq_poly.c`.  But distutils also uses them (and `-Wstrict-
 prototypes`) to compile `polynomial_rational_flint.cpp`, too.  This can
 give the warnings
 {{{
 cc1plus: warning: command line option "-std=c99" is valid for C/ObjC but
 not for C++
 cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
 Ada/C/ObjC but not for C++
 }}}
  * We need `-std=c99` to compile the C99 file `fmpq_poly.c`.  Using
 `-std=gnu99` instead, gives, e.g.,
 {{{
 In file included from /usr/include/time.h:22:0,
                  from
 
/home/mpatel/build/fulvia/sage-4.6.alpha1pre-4000/local/include/FLINT/zmod_poly.h:35,
                  from
 
/home/mpatel/build/fulvia/sage-4.6.alpha1pre-4000/local/include/FLINT/fmpz_poly.h:40,
                  from sage/libs/flint/fmpq_poly.h:22,
                  from sage/libs/flint/fmpq_poly.c:15:
 /usr/include/sys/types.h:536:23: error: duplicate ‘unsigned’
 }}}
  The other extra argument, `-D_XPG6` is technically correct, as Bill says,
 but causes problems with gcc on Solaris.

 Are there any objections to using
 {{{
 #!python
               extra_compile_args=["-std=c99"] + uname_specific('SunOS',
 [], ['-D_XPG6']),
 }}}
 instead?

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4000#comment:110>
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.

Reply via email to