Fortran Programming Language
compiler flags for gfortran on Intel Xeon 64-bit wkstation
I am trying to port my old code to my new Intel Quad Core Xeon
workstation with two "clovertown" processors. I have a 64-bit Linux OS
installed (Ubuntu 7.04) and I'm trying to use gfortran 4.1.2.
1) I'm trying to install LAPACK 3.1.1. I have downloaded the
precompiled ATLAS 3.6.0 library "Linux_HAMMER64SSE2_2", and was going
to link against it. What compiler flags should I use?
2) I am trying to run a code written in standard f90. It does Monte
Carlo simulation so optimum speed is critical. What compiler flags
should I use? Note my code also uses fftw which I downloaded and
In my old "32-bit" machine the flags I used where: -O3 -
march=pentium4. What should I use for the "64-bit" machine? Just
reading the gcc manual it seams the it should be -O3 -m64, is there
any -march or -mtune parameters that I should consider? The Xeon
Clovertown processor can apparently use MMX,SSE,SSE2,SSE3,SSSE3 and
EM64T instructions, should I use -march=nocona?
Any help would be appreciated
That's what I use when compiling stuff with gcc.
On May 24, 5:47 pm, email@example.com wrote:
> Several questions: It should already default to -m64 on x86-64 machines.
> In my old "32-bit" machine the flags I used where: -O3 -
> march=pentium4. What should I use for the "64-bit" machine? Just
> reading the gcc manual it seams the it should be -O3 -m64, is there
> any -march or -mtune parameters that I should consider? Depending what Ubuntu did, using -march=native could work.
(I think it was added in GCC 4.2, but several distributions had it
This enables the right -march* for that processor.
> The Xeon > Clovertown processor can apparently use MMX,SSE,SSE2,SSE3,SSSE3 and Yes. Note that this does not imply SSSE3. -mssse3 exists, but only in
> EM64T instructions, should I use -march=nocona?
the GCC 4.3 developer versions. (Unless your distribution did backport
this - mine did for 4.1.x.)
I personally like to use -ftree-vectorize, which should speed up
I think GCC 4.2 is faster (especially gfortran) than 4.1. Ubuntu might
provide some optional 4.2 packages. (openSUSE does so in Factory and
via the build service for older distributions; at http://gcc.gnu.org/wiki/GFortranBinaries
are also 4.2 and 4.3 binaries available.)
> It does Monte Carlo simulation so optimum speed is critical. It's funny how different can be the points of view of people doing
essentialy the same kind of thing. I also work with Monte Carlo
simulations, and I would have said something more like: "It does Monte
Carlo simulation so calculation precision is critical".
> What compiler flags should I use? Note my code also uses fftw which I Have you studied how your overall performance is dependent of BLAS/LAPACK
> downloaded and installed.
and FFTW speed? Working on speed optimization before you actually profile
the code is always a bet.
About the details of the optimization flags, other people have answered.
In the end, if speed is really that valuable to you, you might want to
look at optimization flags selection tools like Acovea
(http://www.coyotegulch.com/products/acovea/ ; I have no interest in that
product myself, but find the idea pleasant).
"Tobias Burnus" <bur
@net-b.de> wrote in message
> It should already default to -m64 on x86-64 machines. Not in osx, and -m64 isn't even available in xp-x64.
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &