-i flag

-i flag

Quickie:

I was comiling something with the -i8 flag (should force integers to be kind=8, unless specifically overriden by source e.g. integer(4) :: myint), and it wouldn't run....

System protested "Permission denied." I thought, that's weird. Anyway so then I did

$ chmod +x

and tried

$

and got:

cannot execute binary file

FINALLY I realized that I hadn't typed "-i8", I had typed "-i":
$ ifort -i .F90

Soon as I changed it to -i8, or just dropped it entirely, things worked fine.

So my question is, what DOES a plain -i flag do? I can't find it in man, or info, or ifort -help.

Thanks,
Peter

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

Quoting - mrentropy

So my question is, what DOES a plain -i flag do? I can't find it in man, or info, or ifort -help.

I think the ifort driver is behaving badly here. It seems to be ignoring the option and passing it to the linker.

In the case of compile only (-c) the option is simply ignored. In the case of compile & link, since it isn't a supported ifort option thedriverpasses it to the linker (ld) which accepts it and performs an incremental link.

$ ifort -i sample.f90

$ file a.out
a.out: ELF 64-bit LSB relocatable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, not stripped

$ ifort sample.f90

$ file a.out
a.out: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

I believe ifort should issue an error (like that below) and not do what some compilers do of just ignoring the option not passing it through to the link.

$ ifort -badoption sample.f90
ifort: command line warning #10006: ignoring unknown option '-badoption'

I submitted the suggested improvementto Development.

(Internal tracking id: DPD200138822)

(Resolution Update on 12/23/2009): The -i option is one of a handful of special linker options the ifort driver accepts and passes directly to the linker. Instead of changing the behavior as suggested the option was documented under ifort -help in the Intel Fortran Compiler Professional Edition 11.1 Update 4 (11.1.064 - Linux).

Ahhhhh. OK. Makes sense. Thanks for figuring that out!

I should have used "file" as you did - a good 'nix command to know, for sure.....

Leave a Comment

Please sign in to add a comment. Not a member? Join today