From bug-request at octave dot org Thu Jan 12 00:15:38 2006 Subject: Re: Compiling octave with Intel C++/Fortran compilers on Linux From: Bill Denney To: Shai Ayal cc: "Tetsuji \"Maverick\" Rai" , bug@octave.org Date: Thu, 12 Jan 2006 01:14:26 -0500 (EST) It's generally accepted that intel's compilers create faster code on intel compatible processors than any other compiler. Check out the scimark score at http://www.coyotegulch.com/reviews/linux_compilers/ . I've seen similar numbers for ifort. And while gcc is about to reach version 4.1, icc is in version 9 now, so they both may have improved. Bill On Thu, 12 Jan 2006, Shai Ayal wrote: > Can you show some results which show it is faster and probably more accurate > ? > > Shai > > Tetsuji "Maverick" Rai wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> Hi, >> >> I've successfully compiled octave with Intel C++/Fortran compiler on >> Gentoo Linux on P4 to make it faster and probably more accurate (because >> it's more accurate than gcc-3.4.4 with proper options.) But I needed a >> tweak, so I write diff here. >> >> It's in src/oct-stream.cc, and the diff for 2.1.72 is >> >> *** ../../octave-2.1.72/src/oct-stream.cc Sat Nov 12 04:48:27 2005 >> - ---- ./oct-stream.cc Thu Jan 12 05:47:20 2006 >> *************** >> *** 1143,1148 **** >> - ---- 1143,1149 ---- >> octave_scan (std::istream&, const scanf_format_elt&, float*); >> #endif >> >> + #if !defined(__INTEL_COMPILER) // TMR >> template <> >> std::istream& >> octave_scan (std::istream& is, const scanf_format_elt& fmt, double* >> valptr) >> *************** >> *** 1317,1323 **** >> >> return is; >> } >> ! >> template std::istream& >> octave_scan (std::istream&, const scanf_format_elt&, double*); >> >> - ---- 1318,1324 ---- >> >> return is; >> } >> ! #endif //TMR >> template std::istream& >> octave_scan (std::istream&, const scanf_format_elt&, double*); >> >> >> In order to compile octave with Intel C++ 9.0/Fortran 9.0, at first >> install these compilers (as a matter of course!) and set these >> environment variables: >> >> export CC=icc >> export CFLAGS='-O3 -mp -xP -ip -I/usr/local/include' >> export CXX=icpc >> export CXXFLAGS='-O3 -mp -xP -ip -I/usr/local/include' >> export F77=ifort >> export FFLAGS='-O3 -mp -xP -ip -I/usr/local/include' >> export LDFLAGS='-L/usr/local/lib -lsvml' >> >> Last "-L/usr/local/lib" specifies the location of fftw library. Then >> ./configure and make as usual. In these options, -mp option keeps ieee >> compliant accuracy (by default, fortran compiler isn't given -mieee-fp >> option) -xP specifies sse3 (so one has to change it to -xW for sse2, -xK >> for sse), and -ip for single file interprocedural optimization. I also >> tried -ipo[n] flag, but I found octave was too large to utilize that >> option; it took too long to link octave. -ipo[large number] may work >> (I'm trying,) but in that case, one needs to set "export AR=xiar" also. >> >> fftw can also be compiled with these options to make it faster. >> >> regards, >> >> >> - -- >> Tetsuji 'Maverick' Rai >> main page http://maverick6664.bravehost.com/ >> PGP pubkey http://mav.atspace.com/maverick31337_at_gmail_dot_com.txt >> PGP Key ID: 0x971E57CA >> Key fingerprint: F790 28AF E95B 48C9 19AB 71FD 50B5 3572 971E 57CA >> Aviation Jokes: http://www.geocities.com/tetsuji_rai/ >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.2 (GNU/Linux) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iD8DBQFDxcaEULU1cpceV8oRAobwAJ44LvGYNxd6SFX064ZnmjahaKf/+gCggqP8 >> tmj5PEwQiJPZ7sjAuUIXqUc= >> =bD6e >> -----END PGP SIGNATURE----- >> >> >> >> ------------------------------------------------------------- >> Octave is freely available under the terms of the GNU GPL. >> >> Octave's home on the web: http://www.octave.org >> How to fund new projects: http://www.octave.org/funding.html >> Subscription information: http://www.octave.org/archive.html >> ------------------------------------------------------------- >> > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web: http://www.octave.org > How to fund new projects: http://www.octave.org/funding.html > Subscription information: http://www.octave.org/archive.html > ------------------------------------------------------------- > -- "Ni he la na gaoithe la na scolb" The day of the big wind is no time to be doing the thatching -- A Spoonful of Irish (from the back of a sugar packet) ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------