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

Preprocessors from a file

forsjh
Beginner
659 Views
I have A LOT of preprocessor definitions.
I would like to put my preprocessor definitions in a file - rather than separately on the command line.
Is there a way I can do this?
0 Kudos
1 Solution
Steven_L_Intel1
Employee
659 Views
Yes. Put the /D commands in a file - let's call it defines.inc

Then do this:

ifort @defines.inc /fpp ....

It will insert the options in the defines.inc at the point where you specified @filename. This is described in the documentation under "Response files".

View solution in original post

0 Kudos
6 Replies
Steven_L_Intel1
Employee
660 Views
Yes. Put the /D commands in a file - let's call it defines.inc

Then do this:

ifort @defines.inc /fpp ....

It will insert the options in the defines.inc at the point where you specified @filename. This is described in the documentation under "Response files".
0 Kudos
forsjh
Beginner
659 Views
Perfect! Thank you!
0 Kudos
forsjh
Beginner
659 Views
Sorry to come back after telling you it was perfect, but after working with it for a while, it seems that ALL of the values in the define file aren't being defined.

I've checked the formatting had /D in front of all. Don't appear to be any hidden characters.
Is there something else I needed to do to get it to read the entire file?

Thanks again for your help!
0 Kudos
Steven_L_Intel1
Employee
659 Views
Not that I know of. Please attach the file here and I'll look into it. There might be some sort of size limit. You might try splitting it into two files and specifying them both to see what happens.
0 Kudos
forsjh
Beginner
658 Views
I split them and it seemed happy, then put them back together and it was happy again. I'm guessing I had a ctrl character somewhere that was messing with me. Seems to be working now. Thanks for your help!
0 Kudos
Steven_L_Intel1
Employee
659 Views
Ok - glad to hear it.
0 Kudos
Reply