On 07/30/2010 04:19 PM, Dr. David Kirkby wrote: > I wish to compile Sage, which is a huge bit of maths software (300 MB > source code) > > http://www.sagemath.org/ > > Many of the parts in that code try to optimise the software for the > particular processor. Usually they select the fastest options for the > CPU. Since Sage consists of about 100 different packages, I can't easily > control the flags each part gets built with. (CFLAGS will be ignored by > much of Sage) > > Building for the current CPU is fine if one wishes to build on the same > machine as one wants to run on, but is a pain if you want to distribute > a binary for someone else to use. > > I hit this problem, when I built Sage on an UltraSPARC III+ processor > and someone tried to use it on an older UltraSPARC IIe processor. He got > an error, which looks to me like its due to code for an inappropiate > processor > > ImportError: ld.so.1: python: fatal: >>/user/hilbert/bin/sage-4.5.1-Solaris_10_SPARC-sun4u-SunOS/local/lib//libgmp.so.3: > >>: >> bad ELF flags value: [ EF_SPARC_32PLUS EF_SPARC_SUN_US1 > EF_SPARC_SUN_US3 ] > > I'm guessing the EF_SPARC_SUN_US3 if or an UltraSPARC III processor, > which this person did not have. > > Is there any way I can configure gcc whilst building it, so that it > positively will *never* generate code for later processors, irrespective > of what options might be sent to the compiler? That seems unlikely, but you could certainly write a small shell script called 'gcc' (or 'cc') that lived in the $PATH ahead of the real compiler, and replaced/removed any '-march', '-mcpu' or '-mtune' arguments that had been supplied by the caller. -- Kevin P. Fleming Digium, Inc. | Director of Software Technologies 445 Jan Davis Drive NW - Huntsville, AL 35806 - USA skype: kpfleming | jabber: kfleming@xxxxxxxxxx Check us out at www.digium.com & www.asterisk.org