If I'm not mistaken, there are still issues with people having to download Sage source code when their CPUs are older than what Sage was compiled with. I see someone had a Solaris issue the other day, as his processor was older than the processor on which I'd built Sage.

I asked on the gcc-help mailing list if there was any way to prevent gcc ever producing more advanced instructions than what one selected, even if gcc is passed command line options to build for newer CPUs. A reply suggested what might be a quite easy way to ensure that Sage can be built without relying on CPU instructions users may not have.

Essentially create a wrapper script for gcc, which strips out any options like -mtune, -mcpu, so the real gcc never sees them. That's would be trivial with 'sed'. Then we add whatever flags we want into the wrapper script, such as to build for a particular CPU.

Of course, if there is assembly code in Sage which gets assembled, there's nothing gcc can do about that if it makes use of newer CPU instructions.

As a matter of interest, I was reading the other day that often the generic CPU instructions produce faster code than those optimised for your processor. So one should not blindly assume that adding compiler options for your particular CPU will make code run any faster - it might actually run slower. I can only assume this is because more gcc developers spend time optimising the generic code, with less people looking at the code for exotic CPUs.

Dave

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

Reply via email to