Supported Source File Extentions

Supported Source File Extentions

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!

7 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

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

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.

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!

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

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

Quote:

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.

Steve - Intel Developer Support

发表评论

登录添加评论。还不是成员?立即加入