Open xuyumeng opened 4 years ago
This looks to me like there is a function index with prototype
char * index(const char*, int)
in your code that somehow messes up Kranc's use of the name index
for a local variable.
Looking at the calc_rhs.cc
in Kranc's repo for the SimpleWaveODE example the code seems to be just wrong as it tries to use index in line 88 before it has been properly declared:
86 /* Assign local copies of arrays functions */
87
88 CCTK_REAL aL CCTK_ATTRIBUTE_UNUSED = a[index];
89 CCTK_REAL bL CCTK_ATTRIBUTE_UNUSED = b[index];
90
91 /* Calculate temporaries and arrays functions */
92 CCTK_REAL arhsL CCTK_ATTRIBUTE_UNUSED = bL;
93
94 CCTK_REAL brhsL CCTK_ATTRIBUTE_UNUSED = -aL;
this seems to be bug in the generated code. Re-running SimpleWaveODE.m through Kranc
rm -rf SimpleWaveODE
make SimpleWaveODE
does not fix the issue. So this seems to be a bug in how Kranc generates code for ODEGroups
type groups that would seem to try and allow ODEs for simple grid arrays rather than grid functions.
For the example you may just want to remove all mention of the variables a
and b
and eg replace them both by the value 1
.
I want to use Kranc to calculate some model contains ODE equation, and I tried the
SimpleWaveODE.m
. But it cannot pass the build process of Cactus. Below is the error message