|
|||
|
Hello,
I'm quite new at Fortran, I hope this isn't a stupid question. Can someone summarize the pros and cons of gfortran vs ifort? The obvious one that I can think of is that gfortran is free and open source, while ifort is proprietary and only gratis for non-commercial use, which does not include academic use. Any other highlights? Does one have better standard compliance? Is one faster? Anything else I should know? For what it's worth, my OS is Ubuntu Linux. Thanks for the help. Cheers, Daniel. |
|
|
||||
|
||||
|
|
|
|||
|
Daniel Carrera wrote:
> I'm quite new at Fortran, I hope this isn't a stupid question. Can > someone summarize the pros and cons of gfortran vs ifort? > The obvious one that I can think of is that gfortran is free and open > source, while ifort is proprietary and only gratis for non-commercial > use, which does not include academic use. I think that summaries the most obvious differences. > Any other highlights? Does > one have better standard compliance? Is one faster? Anything else I > should know? I think both compilers are relatively similar - aiming at being general purpose compilers. In terms of Fortran 2003/2008 support [1], ifort is slightly ahead but also not much. Similarly in terms of performance: for the Polyhedron benchmark I find that ifort is about 1.5% faster (geometric mean) on a Core2, though for single benchmarks ifort needs between 170% and 49% of gfortran's run time [2]. Hence, it really depends on the program. If you are eligible for the non-commercial licence - or have for other reasons a licence, I would recommend to install both. That way you can find out which compiler is faster for your program. And as a developer, having multiple compilers helps to find programming bugs as the compile-time and run-time diagnostic catches different problems. Actually, in the latter case, you could consider to install even more compilers (g95, Sun [free on Linux/Solaris], Open64, ...). Tobias Disclaimer: I work on the gfortran compiler in my spare time [1] Cf. ACM Fortran Forum or the wiki pages at http://fortranwiki.org/fortran/show/Fortran+2003+status and http://fortranwiki.org/fortran/show/Fortran+2008+status [2] Benchmark http://users.physik.fu-berlin.de/~tb...benchmark/iff/ ; The "IMF" columns use Intel's math library libimf.so. |
|
|||
|
> reasons a licence, I would recommend to install both. That way you can
> find out which compiler is faster for your program. And as a developer, > having multiple compilers helps to find programming bugs as the > compile-time and run-time diagnostic catches different problems. > Actually, in the latter case, you could consider to install even more > compilers (g95, Sun [free on Linux/Solaris], Open64, ...). Totally agree with this! The more the merrier! For my application ifort is substantially faster than gfortran, but this may be a coincidence. Arjan |
|
|||
|
Hi Tobias,
Thanks. That was very informative. In summary: (1) A priori there is no speed difference between ifort and gfortran, either could be faster depending on the program. (2) Having multiple compilers is good anyway, because it helps you find bugs. Sounds good. I'll install ifort. I won't install the Sun compiler because they want too much personal information. They want my phone number, job title, company name, and complete mailing address, and I think that's none of their business. I didn't know about g95. Is there a particular reason why there are two FOSS fortran compilers? Hmm... g95 appears to be a one-man effort... Cheers, Daniel. |
|
|||
|
On 11/14/2010 7:48 AM, Arjan wrote:
>> reasons a licence, I would recommend to install both. That way you can >> find out which compiler is faster for your program. And as a developer, >> having multiple compilers helps to find programming bugs as the >> compile-time and run-time diagnostic catches different problems. >> Actually, in the latter case, you could consider to install even more >> compilers (g95, Sun [free on Linux/Solaris], Open64, ...). > > > Totally agree with this! The more the merrier! > > For my application ifort is substantially faster than gfortran, > but this may be a coincidence. > > Arjan ifort is capable of better auto-vectorization for loops involving a large number of arrays, and for cases which need the special directives, such as VECTOR ALIGNED, or the new SIMD. Default compilation options are not at all comparable, so require study in both cases. Disclaimer: I have work-related responsibility for promoting ifort, but can state only personal opinions. -- Tim Prince |
|
|||
|
On Nov 14, 5:19*pm, Daniel Carrera <dcarr...@gmail.com> wrote:
> I didn't know about g95. Is there a particular reason why there are > two FOSS fortran compilers? Hmm... g95 appears to be a one-man > effort... I think I found the answer to my question: http://gcc.gnu.org/wiki/TheOtherGCCBasedFortranCompiler Cheers, Daniel. |
|
|||
|
> > I didn't know about g95. Is there a particular reason why there are
> > two FOSS fortran compilers? Hmm... g95 appears to be a one-man > > effort... Though g95 does not yield the fastest code, I particularly like its feedback in compilation. Many errors I eliminated in an early phase were reported only by g95. @Tim: Thanks for the explanation. You won't hear me complain about ifort! One exception: there is no free ifort for Windows, which is the only OS I have at home... Arjan |
|
|||
|
Arjan <arjan.van.dijk@rivm.nl> wrote:
> > reasons a licence, I would recommend to install both. That way you can > > find out which compiler is faster for your program. And as a developer, > > having multiple compilers helps to find programming bugs as the > > compile-time and run-time diagnostic catches different problems. > > Actually, in the latter case, you could consider to install even more > > compilers (g95, Sun [free on Linux/Solaris], Open64, ...). > > > Totally agree with this! The more the merrier! Not totally sure : if you need to install some software librairies, that means that you need to compile them with both compilers, and install them in different directories, etc ... Might bring a few complications. Nevertheless, using several compilers is very useful to find bugs, non-conformance to standards, etc ... > > For my application ifort is substantially faster than gfortran, > but this may be a coincidence. > > Arjan Olivier |
|
|||
|
On 15/11/2010 4:48 a.m., Arjan wrote:
>> reasons a licence, I would recommend to install both. That way you can >> find out which compiler is faster for your program. And as a developer, >> having multiple compilers helps to find programming bugs as the >> compile-time and run-time diagnostic catches different problems. >> Actually, in the latter case, you could consider to install even more >> compilers (g95, Sun [free on Linux/Solaris], Open64, ...). > > > Totally agree with this! The more the merrier! > > For my application ifort is substantially faster than gfortran, > but this may be a coincidence. > > Arjan On the kinds of programs I run ifort is usually about 30% faster than gfortran. |
|
|||
|
Gib Bogle wrote:
>> For my application ifort is substantially faster than gfortran, >> but this may be a coincidence. >> > > On the kinds of programs I run ifort is usually about 30% faster than > gfortran. For curiosity, which version of gfortran and which options are you using? The result of ifort being 1.5% (on geometric average) faster was with GCC 4.6 and the options: gfortran -march=native -ffast-math -funroll-loops -flto -fwhole-program -fno-protect-parens -O3 And the Intel Fortran Compiler, version 11.1, with the options ifort -O3 -xHost -ipo -ip In case of single precision, x86-64 CPU and Linux, I would also be interested in the Linux distribution.* Tobias * The not-modified GLIBC's libm has very some slow math functions (e.g. for the trigonometric functions) in single precision on x86-64 (AMD64, Intel64); the double-precision functions are much faster. There are patches for x86-64 which make single-precision calculation as fast or a bit faster than the double-precision functions, but only few Linux distributions ship with those. |
|
|||
|
On 15/11/2010 10:42 a.m., Tobias Burnus wrote:
> Gib Bogle wrote: >>> For my application ifort is substantially faster than gfortran, >>> but this may be a coincidence. >>> >> >> On the kinds of programs I run ifort is usually about 30% faster than >> gfortran. > > For curiosity, which version of gfortran and which options are you using? The > result of ifort being 1.5% (on geometric average) faster was with GCC 4.6 and > the options: > > gfortran -march=native -ffast-math -funroll-loops -flto -fwhole-program > -fno-protect-parens -O3 > > And the Intel Fortran Compiler, version 11.1, with the options > ifort -O3 -xHost -ipo -ip > > > In case of single precision, x86-64 CPU and Linux, I would also be interested in > the Linux distribution.* > > Tobias > > * The not-modified GLIBC's libm has very some slow math functions (e.g. for the > trigonometric functions) in single precision on x86-64 (AMD64, Intel64); the > double-precision functions are much faster. There are patches for x86-64 which > make single-precision calculation as fast or a bit faster than the > double-precision functions, but only few Linux distributions ship with those. Hi Tobias, I haven't gone into this in any detail. With ifort I typically use -Oy or -O3, while with gfortran I use -O3. This is all Windows. gfortran was build with GCC 4.4.4. Most of what I do is single precision, and is not very floating-point intensive. Gib |
|
|||
|
On Sun, 14 Nov 2010 09:58:04 -0800 (PST), Arjan
<arjan.van.dijk@rivm.nl> wrote: >> > I didn't know about g95. Is there a particular reason why there are >> > two FOSS fortran compilers? Hmm... g95 appears to be a one-man >> > effort... > > >Though g95 does not yield the fastest code, I particularly like its >feedback in compilation. Many errors I eliminated in an early phase >were reported only by g95. > >@Tim: Thanks for the explanation. You won't hear me complain about >ifort! One exception: there is no free ifort for Windows, which is the >only OS I have at home... > >Arjan It does have a nice IDE on Windows though :-) to make up for it. What is an IDE which plays nice with g95/gfortran, and is good? Sebastian |
|
|||
|
On Nov 15, 12:48*am, Sebastian Rooks <sebastian_ro...@at.lavabit.com>
wrote: > It does have a nice IDE on Windows though :-) to make up for it. > > What is an IDE which plays nice with g95/gfortran, and is good? > > Sebastian I just use the command line on Linux. I find that easy and convenient. My editor ("IDE") is Geany, which supports gfortran (or any compiler) but I still find it more convenient to write a Makefile with various targets. Daniel. |
|
|||
|
On 15/11/2010 12:48 p.m., Sebastian Rooks wrote:
> On Sun, 14 Nov 2010 09:58:04 -0800 (PST), Arjan > <arjan.van.dijk@rivm.nl> wrote: > >>>> I didn't know about g95. Is there a particular reason why there are >>>> two FOSS fortran compilers? Hmm... g95 appears to be a one-man >>>> effort... >> >> >> Though g95 does not yield the fastest code, I particularly like its >> feedback in compilation. Many errors I eliminated in an early phase >> were reported only by g95. >> >> @Tim: Thanks for the explanation. You won't hear me complain about >> ifort! One exception: there is no free ifort for Windows, which is the >> only OS I have at home... >> >> Arjan > > It does have a nice IDE on Windows though :-) to make up for it. > > What is an IDE which plays nice with g95/gfortran, and is good? Code::Blocks |
|
|||
|
> > What is an IDE which plays nice with g95/gfortran, and is good? I also like makefiles and command line compilations. And I'm using emacs. I also think that having ifort and gfortran is a good idea. Unless you have very specific needs, both of them will do the same job. and you'll know them both, which is a good asset. |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|