<html>#974: Compilation problem in LoopControl with xlc compiler
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Wolfgang Kastaun</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td>development version</td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>minor</td></tr>
<tr><td style='text-align:right'>Component:</td><td>Carpet</td></tr>
</table>

<p>Changes (by Roland Haas):</p>
<p><table>
<tr><td>assignee:</td><td>Roland Haas (was Erik Schnetter)</td></tr>
<tr><td>responsible:</td><td>[] (was [])</td></tr>
</table></p>
<p>I was trying to compile ET on MareNostrum (BSC) using the xlc/xlC/xlf compiler suite version 10.01 and failed. The first relevant error reads:</p>
<p>"/gpfs/home/uv08/uv08986/source/Cactus/configs/z4pisky_std/build/LoopControl/loopcontrol.c", line 1371.1: 1506-343 (S) Redeclaration of lc_statmap_init differs from previous declaration on line 631 of "/gpfs/home/uv08/uv08986/source/Cactus/configs/z4pisky_std/build/LoopControl/loopcontrol.c".
"/gpfs/home/uv08/uv08986/source/Cactus/configs/z4pisky_std/build/LoopControl/loopcontrol.c", line 1371.1: 1506-376 (I) Redeclaration of lc_statmap_init has a different number of fixed parameters than the previous declaration.
"/gpfs/home/uv08/uv08986/source/Cactus/configs/z4pisky_std/build/LoopControl/loopcontrol.c", line 1371.1: 1506-377 (I) The type "char<em>" of parameter 3 differs from the previous type "const char</em> restrict const".</p>
<p>The fist declaration reads:</p>
<div class="codehilite"><pre><span></span><span>630 void</span>
<span>631 lc_statmap_init (int * restrict const initialised,</span>
<span>632                  lc_statmap_t * restrict const lm,</span>
<span>633                  char const * restrict const name)</span>
<span>634 {</span>
</pre></div>


<p>while the second is</p>
<p>1374 CCTK_FCALL
   1375 void
   1376 lc_statmap_init (int * restrict const initialised,
   1377                               lc_statmap_t * restrict const lm,
   1378                               ONE_FORTSTRING_ARG)
   1379 {</p>
<p>From the compiler message, I guess ONE_FORTSTRING_ARG expanded to something of type char*</p>
<p>It seems the idea here is to provide a version of a C function callable from Fortran. However, it ends up having the same name and argument types (apart from const-ness), which is forbidden. From the Cactus manual I would guess one needs to wrap the second declaration inside a CCTK_FNAME macro, like</p>
<p>void CCTK_FCALL CCTK_FNAME(lc_statmap_init)(int * restrict const initialised, lc_statmap_t * restrict const lm, ONE_FORTSTRING_ARG) {</p>
<p><str
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/974/compilation-problem-in-loopcontrol-with'>https://bitbucket.org/einsteintoolkit/tickets/issues/974/compilation-problem-in-loopcontrol-with</a></p>
</html>