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

How to use FORTRAN compiler "Data Options" together with a batch file

Reza_M_
Beginner
494 Views

Hi Intel developers,

The FORTRAN language prohibits changing the definition status of an argument associated with a constant or expression. My application needs to do so; therefore, I need to specify the /assume:noprotect_constants option. I use the following MSC.Marc batch scripts and its options:

run_marc.bat -j job_name -u user_subroutine

I wonder how I should add "-assume noprotect_constants" option? As you may know the default is "-assume protect_constants".

Thank you in advance for your assistance. 

Reza

0 Kudos
2 Replies
mecej4
Honored Contributor III
494 Views

Here are two ways in which you can supply non-default options to the compiler.

  • Specify the option in the command that invokes the compiler. In your case, that implies that you look for the line in your .BAT file that contains ifort (or ifort /c) and add the desired options to that line.
  • Modify the file ifort.cfg in the compiler's bin\ia32 or bin\intel64 directory, in which case the added options apply to all compilations using IFort, or place a modified ifort.cfg in your project directory and set the environmental variable IFORTCFG to the full path of the file. The added options are used only when IFORTCFG is set to the new file. Read the IFort documentation for details.
0 Kudos
andrew_4619
Honored Contributor III
494 Views

rather than messing with the Marc .bat files you can pre-compile the user-sub with whatever options you need  and the doing run_marc with    -obj objfilename.

It may be that you can do what you need to an other way by some simple modification to your usersub fortran but you would need to posts some bits of code and explain what you are trying to do a bit more.

 

 

0 Kudos
Reply