#12855: FLINTQS fails to build on Solaris (with GCC 4.7.x)
------------------------+---------------------------------------------------
   Reporter:  leif      |             Owner:  tbd                               
                  
       Type:  defect    |            Status:  new                               
                  
   Priority:  major     |         Milestone:  sage-5.0                          
                  
  Component:  packages  |          Keywords:  spkg GCC 4.7.0 C++ g++ log() 
math.h overloaded SunOS
Work issues:            |   Report Upstream:  N/A                               
                  
  Reviewers:            |           Authors:                                    
                  
  Merged in:            |      Dependencies:                                    
                  
   Stopgaps:            |  
------------------------+---------------------------------------------------
 This is a rather subtle issue, related to Solaris' headers, and the fact
 that GCC (4.7.0) now defines `__cplusplus` to `199711L`, while previous
 versions defined it to just `1`.

 If `__cplusplus >= 199711L`, a lot of overloaded (originally C) functions
 like `div()` and `log()` get defined in the `std` namespace (if one
 includes `math.h`), e.g.
 {{{
 #!c++
 float std::log(float);             // logf() in C
 double std::log(double);           // log() in C
 long double std::log(long double); // logl() in C
 }}}
 which is correct in the first place, but on Solaris these also end up in
 the '''global''' namespace:
 {{{
 #!c++
 // /usr/include/math.h

 ...

 #if __cplusplus >= 199711L
 ...
 using std::log;
 ...
 #endif

 }}}

 Now FLINTQS happens to call `log()` with an `unsigned long` (without a
 cast) in one place, and with the overloaded functions present as well, the
 call gets ambiguous.  The obvious, trivial fix is to just cast the
 argument to a `double`, such that `double log(double)` gets called (as
 before).

 [[BR]]

 There's a lot wrong with the FLINTQS spkg, as I noted a couple of times
 before, but I won't address other issues ''here''.  [The most important
 fact being that ''a newer version'' of Bill Hart's quadratic sieve is
 included in FLINT since a long time, but the FLINT spkg simply doesn't
 install it.  So the FLINTQS spkg is obsolete in whole, but we can't remove
 it until ''someone''^TM^ fixes the FLINT spkg to also install the QS
 program included in it.]

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12855>
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