Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Supported Source File Extentions

mkandes
Beginner
1,470 Views

What source file extentions does ifort support? I know that gfortran supports source files with.f,.for,.fpp,.ftn,.F,.FOR,.FPP, and.FTNextensions as well as the.f90,.f95,.f03,.f08,.F90,.F95,.F03and.F08extensions. I ask only because it appears that I've run into a compile time error when using, for example, the .f08 extention. 

Sepcifically, when I compile using ifort and the .f08 file extention I get the following error(s):

ifort -c -free -implicitnone -O3 -stand f08 hfrak.f08
ifort: warning #10145: no action performed for file 'hfrak.f08'
ifort -free -implicitnone -O3 -stand f08 -o hfrak.x hfrak.o
ifort: error #10236: File not found:  'hfrak.o'
ifort: command line error: no files specified; for help type "ifort -help"
make: *** [hfrak.x] Error 1

Obviously, the error #10236 is, well, obvious. However, the warning #10145 is not, even after a bit of a google search. However, if i simply rename the same exact source code as 'hfrak.f' and use the same compiler options ...

ifort -c -free -implicitnone -O3 -stand f08 hfrak.f
ifort -free -implicitnone -O3 -stand f08 -o hfrak.x hfrak.o

... everything works automagically.

Am I missing something here? It seems like a trival option ifort should support, especially given that it has a -stand f08 compiler option. But I don't know what the logic might be. From what I can find, ifort only seems to support the .f .f90 .F .FOR .for extentions. Any help / explination would be awesome.

Thanks!



0 Kudos
8 Replies
Anonymous66
Valued Contributor I
1,470 Views
For a list of supported file extensions, see Intel® Fortran Compiler XE 13.0 User and Reference Guides - Understanding File Extensions" Intel® Fortran Compiler XE does not support .f95, .f03 or .f08. We have decided to use .f90 and .F90 to signify all free format source files rather than continually adding to the list of supported extensions for each standard. I agree that the error message could have been more clear. I have filed a feature request. The issue number is DPD200237198. I will post any updates I receive to this thread. Regards, Annalee Intel Developer Support
0 Kudos
mecej4
Honored Contributor III
1,470 Views
You may use the following compiler switches to specify that, for example, files with the extension ".f03" are to be treated as Fortran source in free format:
/extfor:f03 /free
If you use makefiles, in addition to the above you will have to specify rules for compiling source files with these non-standard extensions.
0 Kudos
mkandes
Beginner
1,470 Views
Thanks, Annalee. I do appreciate the quick response. I'm not going to lie. It's a bit annoying, especially since I believe the use of the .f95, .f03 and .f08 are all specified in the ISO/IEC Fortran 95/03/08 standards. But I could easily be wrong. Thanks again for the help.
Mecej4, I'll give that fix a go at some point. At this point, I need to finish coding, then worry about ifort support. I'll just gfortran until I'm ready to do so. But I am "make"ing my executable. Did you have a quick example of the specific rules you mention to support the non-standard exentions in a makefile? It'd be much appreciated. Thanks!
0 Kudos
Lorri_M_Intel
Employee
1,470 Views
One small correction; /extfor:XXX is a Windows switch. For Linux please use "-free -Tf filenam.f03" Also, sorry, there is no specification in the Fortran standard related to file extensions. -- Lorri
0 Kudos
mkandes
Beginner
1,470 Views
Thanks, Lorri. And good to know about the standards specifications with respect to this issue. I actually did find this note about the topic on Fortran Wiki: http://fortranwiki.org/fortran/show/File+extensions
-- Marty
0 Kudos
Steven_L_Intel1
Employee
1,470 Views
mkandes wrote:

Thanks, Annalee. I do appreciate the quick response. I'm not going to lie. It's a bit annoying, especially since I believe the use of the .f95, .f03 and .f08 are all specified in the ISO/IEC Fortran 95/03/08 standards. But I could easily be wrong.

And indeed you are (wrong). The Fortran standard specifies absolutely nothing about file types or even source files in general. As far as the standard is concerned, source lines are provided to the "processor" (compiler) by fairies in the night. I plan to write a "Doctor Fortran" post on this, but our view is that the use of the file type to indicate use of some particular standard revision is misguided - and usually incorrect. .f90 was generally adopted to mean "free-form source" when Fortran 90 compilers came out, as a way of distinguishing from Fortran 77's only source form, fixed-form. It might have made sense at the time, but was a bad choice - you can write Fortran 2008 code in fixed-form source. We should have picked something like .ffr instead. But what is done is done. We're aware that some other compilers accept all manner of file types, but we're not going down the same wrong road.
0 Kudos
JohnNichols
Valued Contributor III
1,422 Views

1. Did Dr Fortran ever write a note on the point of file extensions 

2. Down the wrong road, perhaps you meant the wrong rabbit hole as sometimes Fortran and this board reminds me of Alice or perhaps the Red Queen 

3. I stumbled across set of Fortran routines for large numbers from a retired Prof out of Loyola -- trust the Jesuits to beat us there, they are designed for gfortran - whatever that is and use f95 extensions that I looked up on line and found Dr Fortran. 

 

0 Kudos
Steve_Lionel
Honored Contributor III
1,413 Views

@JohnNichols  "Did Dr Fortran ever write a note on the point of file extensions"

He did.

0 Kudos
Reply