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

Compiler definitions are ambiguous

Reynolds__John
Beginner
401 Views
I have two executables that both depend on one library. These executables each make calls into a separate C++ DLL depending on whether LICENSING_INACTIVE is defined. I build them all at the same time, and I checked the project options to verify that LICENSING_INACTIVE is not defined. I know for a fact, it isn't defined in either executable or the library.

Yet, when I run the apps, the first one behaves as if LICENSING_INACTIVE is not defined. The second one behaves as if it IS. When I explicitly un-define LICENSING_INACTIVE, the second app acts like it's supposed to.

This is the compiler version: Intel Visual Fortran 11.0.072 [IA-32]

I copied and pasted both pieces of code separately. I know they're identical, but I'm trying to make that point:
Program 1:
#ifndef LICENSING_INACTIVE
call PerformLicenseChecks()
#endif

Program 2:
#ifndef LICENSING_INACTIVE
call PerformLicenseChecks()
#endif

You might ask me if the fortran preprocessor is enabled in all three places. Yes, it is. If it were not, the code would not compile without errors. You might suggest that I not use compiler definitions. That's not an option. I use them all over the place. If they're not being evaluated correctly here, how can I trust a scientific code with 800 lines of FORTRAN?

I know I can't prove that I'm actually experiencing this behavior and that I'm not doing something wrong. Be that as it may, I am experiencing this behavior. If I'm experiencing it, there are others that might not realize they're experiencing it too.

Thanks,

John
0 Kudos
1 Reply
Lorri_M_Intel
Employee
401 Views

Have you tried keeping the intermediate preprocessed files, and looking to see if there's anything "interesting" there?

Use /Qsave-temps You might have to specify it explicitly on the COMMAND LINE tab. The intermediate files will be called .i or .i90, depending on the original file extension.

- Lorri

0 Kudos
Reply