#12830: Improve handling of CFLAGS in GMP-ECM's spkg-install
----------------------------------------------------------------------------------------------------+
       Reporter:  leif                                                          
                    |         Owner:  leif        
           Type:  enhancement                                                   
                    |        Status:  needs_review
       Priority:  major                                                         
                    |     Milestone:  sage-5.0    
      Component:  packages                                                      
                    |    Resolution:              
       Keywords:  spkg -march=native assembler error Darwin MacOS __GMP_CFLAGS 
__MPIR_CFLAGS gmp.h  |   Work issues:              
Report Upstream:  N/A                                                           
                    |     Reviewers:              
        Authors:  Leif Leonhardy                                                
                    |     Merged in:              
   Dependencies:                                                                
                    |      Stopgaps:              
----------------------------------------------------------------------------------------------------+

Comment (by leif):

 Replying to [comment:4 jdemeyer]:
 > Concerning `march=native`: what do you think about using `testcflags.sh`
 for this?  Let's add
 > {{{
 > unsigned long fancy_insns() { return (unsigned long) d; }
 > }}}
 > to the program that `testcflags.sh` uses to check flags.
 >
 > Then we could do something like
 > {{{
 > if testcflags.sh -march=native >/dev/null; then
 >     CFLAGS="-march=native $CFLAGS"
 > elif testcflags.sh "-march=native -mno-avx" >/dev/null; then
 >     echo >&2 "Warning bla bla"
 >     CFLAGS="-march=native -mno-avx $CFLAGS"
 > fi

 Probably.  Although `testcflags.sh` is currently broken... ;-)

 I'm not sure if we should do such a complicated test whenever some
 arbitrary compiler flag is to be tested.  We'd never know whether the
 compiler, the assembler or the linker caused an error.

 Using it again requires newer versions of Sage for little reason, which I
 don't like in general.


 `testcflags.sh` might have an option to not use `CFLAGS` btw.; otherwise
 one would have to `(unset CFLAGS; testcflags.sh ...)` or specifically
 construct `CFLAGS` for the desired purpose.

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