Re: Warning message: "Incompatible redefinition "


Subject: Re: Warning message: "Incompatible redefinition "
From: Erik Kluzek (erik@cgd.ucar.edu)
Date: Tue Jan 26 1999 - 13:51:37 MST


Regarding Sheo Prasad's message about "CRAY incompatible redefintion".
First of all this is harmless although annoying. And it occurred on a
fairly recent Cray compiler upgrade.

Sheo's message follows.
>
> I modified chem.F, cheini.F and comchem.h, and then recompiled. I now
> get this warning message when building the code on a CRAY T90 machine.
.
.
.
> CC-47 cpp: WARNING File = /work/u13338/ccm/run/obj/./misc.h, Line = 3
> Macro "CRAY" has an incompatible redefinition.
>
> #define CRAY
> ^
.
.
.
> The misc.h file the warning message refers to is :
>
> #ifndef MISC_SET
> #define MISC_SET
> #define CRAY
> #define PVP
> #define REALTYPE MPI_REAL
> #undef COUP_SOM
> #undef COUP_CSM
> #define NCPREC NF_FLOAT
> #define SHELL_MSS
> #define FORTFFT
> #undef SPMD
> #endif
>

What's going on is that the newer CRAY compilers define the preprocessor token
"CRAY". In the past this token wasn't defined, so we defined "CRAY" to indicate
CRAY-specific lines to compile. Now that the compiler itself also defines the
token, it complains about the fact that it defines it *and* the misc.h defines
it. However, it doesn't really hurt anything. There are a couple ways to avoid
getting the warning. One way would be to remove the "define CRAY" line in
misc.h and rely on the compiler to set it for you. Another way is to do the
following in your misc.h

#undef CRAY
#define CRAY

Or you could compile with "-U CRAY" to undefine the "CRAY" token. In future
releases of the CCM we might change the CRAY token to a different name
so that it doesn't conflict with the compiler definition.

We did test the new CRAY compiler when it came out and verified that answers were
within round-off of the old compiler. The above behaviour came when the CRAY
F90 compiler was upgraded from version 3.0 to 3.1.

Erik

Erik Kluzek, (CGD at NCAR)
National Center for Atmospheric Research
Boulder CO, (off) (303)497-1326 (fax) (303)497-1324
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



This archive was generated by hypermail 2b27 : Thu Jun 01 2000 - 09:26:43 MDT