Jeroen:  Thank for the suggestion to use the SAGE_INSTALL_GCC=yes option, 
this solved most of the issues and lead me to a complete solution.  The 
updated GCC version allowed sage to compile with correctly passing the 
-mtune and -march flags with the exception of the MPIR package.  It would 
still insist on using the -mtune=K8 and -march=k8 flags.  For example the 
MPIR log shows:

Building MPIR with the C++ interface and (also) static libraries.
Checking what CFLAGS MPIR would use if they were empty...
Settings chosen by MPIR when configuring with CFLAGS unset:
  CC:      gcc -std=gnu99
  CFLAGS:  -m64 -O2 -march=k8 -mtune=k8
Settings added by Sage to build MPIR, taking into account SAGE_DEBUG etc.:
  CFLAGS:   -g
  LDFLAGS: 
  ABI:     64
Settings from the "global" environment:
  CC:      gcc
  CFLAGS:  -march=corei7 -mtune=corei7
  LDFLAGS: 
  ABI:     
  (CPP, CPPFLAGS, CXX and CXXFLAGS are listed below; these don't get 
modified.)
Finally using the following settings:
  CC=gcc
  CFLAGS=-m64 -O2 -march=k8 -mtune=k8  -g -march=corei7 -mtune=corei7
  CPP=
  CPPFLAGS=
  CXX=g++
  CXXFLAGS=-march=corei7 -mtune=corei7
  LDFLAGS= 
  ABI=64

I looked for how the MPIR package configured itself and found its 
config.guess command would not correctly identify the "Ivy-Bridge" Xeon. It 
used the generic build type of x86_64-unknown-linux-gnu, and hence the 
-march=k8 flags.  I made the new environment variable 
MPIR_CONFIGURE="--build=nehalem-unknown-linux-gnu" before I compiled sage, 
which then showed the correct choice in the logs.

Settings chosen by MPIR when configuring with CFLAGS unset:
  CC:      gcc -std=gnu99
  CFLAGS:  -m64 -O2 -march=corei7 -mtune=corei7

In sage the time to compute a=n(pi,10^7) is now 6.7s, rather than 13.5s 
without setting the MPIR_CONFIGURE variable.  I'm curious if this problem 
exists for all core processors after Nehalem or just for the Xeon line.  If 
so, some computations are needlessly running slower than they need to.

Thank you again for your advice!

Brian

On Sunday, March 16, 2014 9:36:03 PM UTC-10, Jeroen Demeyer wrote:
>
> On 2014-03-17 01:03, Brian Wissman wrote: 
> > I've tried globally setting the CFLAGS parameter, but it doesn't seem to 
> make any difference in the compiled program. 
> It should make a difference, but only after recompiling MPIR and MPFR. 
>
> My guess is that either your C compiler doesn't support -march=core2 
> (try recompiling from scratch with SAGE_INSTALL_GCC=yes perhaps), or 
> there is some environment variable set which influences the CFLAGS. 
>
> If you are still stuck, please send us the MPIR log file together with 
> the output from running "env". 
>
> Jeroen. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to