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

fpp problem (ifort 9.0.27)

ceresoli
Beginner
549 Views
Dear all,
I've got a strange problem in preprocessing. The (over-)simplified code reads:

program pippo
#if defined PIPPO
print*, 'PIPPO'
#elif defined PLUTO
print*, 'PLUTO'
#elif defined TOPOLINO
print*, 'TOPOLINO'
#else
print*, 'CIAO'
#endif
end program pippo

If I do:
ifort -fpp -DPIPPO -DTOPOLINO pippo.f90; ./a.out

it prints 'PIPPO' and 'CIAO' which should not be the case,
if I understand correctly.

Instead, when I:
ifort -fpp -DPLUTO -DTOPOLINO pippo.f90; ./a.out
it prints only 'PLUTO'.

Am I right?

Bye,
Davide
0 Kudos
2 Replies
Steven_L_Intel1
Employee
549 Views
I agree with you that this behavior does not seem correct. If I run the code through cpp instead, I do not get the 'CIAO' line. Please report this to Intel Premier Support.
0 Kudos
jim_dempsey
Beginner
549 Views

#ifdef

#ifndef

#else

#endif

seem to work but you may have problems with

#if defined

#elif defined

I had similar problems with IVF on Windows

I never went back to see if they fixed the problem

Jim Dempsey

0 Kudos
Reply