From: "M. Edward (Ed) Borasky" Date: 2009-02-05T01:56:54+09:00 Subject: Re: Minor 1.8 <-> 1.9 performance comparison gotcha Rados�aw Bu�at wrote: > On Mon, Feb 2, 2009 at 3:18 AM, M. Edward (Ed) Borasky > wrote: >> cd >> export CFLAGS='-O3 -march=athlon64 -mtune=athlon64' >> ./configure >> make > > I do: > export CFLAGS="-O3 -march=native -mtune=native" > ./configure > make > > and see > > gcc -O3 -march=native -mtune=native -O2 -g -Wall -Wno-parentheses (...) > > It is ok if my options goes before default options to gcc? I wonder > what gcc will take, O2 or O3? > > Well ... gcc will take the *last* option it sees, so it will use -O2 :(. There is a work-around, though. After you unpack the 1.9.1 tarball, there will be a file in the main directory called "configure.in". Around line 193 you'll see a definition for "optflags": if test "$GCC" = yes; then linker_flag=-Wl, : ${optflags=-O2} ${warnflags="-Wall -Wno-parentheses"} else linker_flag= fi Change the "-O2" to "-O3". Then do autoconf export CFLAGS="-march=native" ./configure make Then the compile lines should look like this gcc -march=native -O3 -g -Wall -Wno-parentheses (...) Make sure you look at the output from "make test" to verify that the extra level of optimization didn't cause bugs. In fact, you should probably run "RubySpec" against the resulting Ruby interpreter as well. :) -- M. Edward (Ed) Borasky I've never met a happy clam. In fact, most of them were pretty steamed.