[Users] ADMMacros: Identidier is undefined

Frank Loeffler knarf at cct.lsu.edu
Tue Jul 11 07:45:26 CDT 2017


On Tue, Jul 11, 2017 at 11:26:22AM +0200, Jens Mahlmann wrote:
>in the following, I assembled an exemplary code reproducing the problem 
>when compiling. I figured that making use of TRRICCI and UPPERMET in 
>different files does not yield any problems. So for now I split up my 
>routines to avoid this double declaration.

Hi Jens

The problem is that the includes use a macro to avoid problems for 
double-inclusion: if included a second time, it will be a no-op. This is 
in general a good idea (e.g., it prevents problems if you include RICCI 
and TRRICI, which also includes RICCI). However, this is a problem if 
you include the "declare" part not globally once, but locally (within a 
function) twice, since the second time the include will be a no-op, an 
nothing will be declared locally. It also explains why it works if you 
split things up into different files, as then you only include the 
_declare includes once in each file.

To prevent this without changing the ADMMacros thorn (which I don't know 
it would break), put a

  #undef TRRICCI_DECLARE

before every include of TRRICCI_declare.h (and likely also other 
_declare.h files). (You technically do not need it before the first, but 
it also shouldn't hurt.)

Frank

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
Url : http://lists.einsteintoolkit.org/pipermail/users/attachments/20170711/ea57f286/attachment.bin 


More information about the Users mailing list