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

code not seeing "#if (defined"

mjssaic
Beginner
405 Views
Hi.

I am using mpif90 11.1.069 on fedora 2.6.18-128.el5 (x86_64 Intel Xeon). I have a configure file (that the Makefile "include"s) with FFLAGS and FFLAGS77 like:

FFLAGS = -fpp -e -P -Y/home/usrms/src/make -save-temps -c -g -u -traceback -fpe0 -nomixed_str_len_arg \\
-names lowercase -convert big_endian -assume byterecl \\
-DHIDE_SHR_MSG -DNO_SHR_VMATH -DIFC -I$(MOD_ESMF) \\
-I$(INC_MPI) -DSP_IFC \\
-DSPMD -DUSE_INCLUDE_MPI \\

Of course the MOD_ESMF, INC_MPI, etc are defined previously in the configure file, and these values are then used in the Makefile which "include"s this configure file.

I have not set #define SPMD in an include (.h) file, nor have I setenv SPMD TRUE. I can build the code just fine, but the .exe does not seem to see the "#if (defined SPMD)" statements from the code, so when running with openmpi (v1.4.2). I have tried several things to try and make sure the preprocessor handles these, seemingly to avail; print statements etc within the #if #endif never print, and the processors never stay in sync (the #if's are for mpibcasts etc, which of course never happen).

Any thoughts?

Thanks very much.
0 Kudos
1 Reply
jimdempseyatthecove
Honored Contributor III
405 Views
try

#if defined(SPMD)

else try

#ifdef SPMD

The second one will work for sure, the first format follows CPP syntax.
FPP is not fully compatible with CPP

Jim Dempsey
0 Kudos
Reply