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

Changing compiler options inside the code

van_der_merwe__ben
New Contributor II
471 Views
We are using the latest Intel Fortran compiler under Windows. Is it possible to override command line compiler options inside the code? Suppose you have:
ifort.exe @x.fcf x.for y.for z.for etc.for
And x.fcf contains some general options e.g./check:uninit
Now for a particular file I want to be able to turn this option off because it trips incorrectly under some conditions, via something like this (insde the Fortran source code file)
!DEC$ IF DEFINED(TESTFORCEHIGH64)
!DEC$ turn of check uninit how?
!DEC$ ENDIF
Is there a way to do this?
0 Kudos
2 Replies
Steven_L_Intel1
Employee
471 Views
There are very few command-line options you can change from within the code - /check:uninit is not among them. Here are the things you can change:

- Alignment within data structures
- Alignment of individual variables
- Whether or not alignment warnings are produced
- Whether or not source is treated as fixed-form or free-form

0 Kudos
mecej4
Honored Contributor III
471 Views
A word of caution, to add to what Dr. Fortran advised: Fortran compiler options may be specified in the command line, makefile, the configuration file (default ifort.cfg or alternative, controlled by environment variable IFORTCFG) and in the source.
If conflicting options are given or different alternatives are specified for a repeated option, rules of precedence will apply, as described in the Intel Fortran documentation. You may want to make sure that you understand how these rules work before using options in more than one place.
0 Kudos
Reply