Carpet defines globally visible functions without a "Carpet" prefix in their names
Issue #2584
resolved
In carpet_public.h
(the C header) Carpet defines a couple of helper functions that do not have the thorn name anywhere in them:
/* Call a schedule group */
int CallScheduleGroup(cGH *const cgh, const char *const group);
/* Call a local function */
int CallLocalFunction(cGH *const cgh, void (*const function)(cGH *const cgh));
int CallSinglemapFunction(cGH *const cgh,
void (*const function)(cGH *const cgh));
int CallLevelFunction(cGH *const cgh, void (*const function)(cGH *const cgh));
int CallGlobalFunction(cGH *const cgh, void (*const function)(cGH *const cgh));
int CallMetaFunction(cGH *const cgh, void (*const function)(cGH *const cgh));
which causes conflicts with CarpetX, that defines an aliased (much better) function CallScheduleGroup
. Cactus thorn providing callable functions should prefix them by their thorn name to avoid name conflicts. Since these functions have been around for a while (and I think the one in conflict with CarpetX is used by CT_Multipole) some sort of backwards compatible solution that avoids the linker name clashes should be provided.
Comments (6)
-
reporter -
reporter - changed status to open
-
reporter Please review.
-
reporter Approved by @Yosef Zlochower in today’s ET call http://lists.einsteintoolkit.org/pipermail/users/2022-January/008344.html
-
reporter -
reporter - changed status to resolved
- Log in to comment
Pull request is here: https://bitbucket.org/eschnett/carpet/pull-requests/48/carpet-prefix-public-functions-with-carpet
For C code this should be source code compatible since it uses a couple of
#define
to mapCallScheduleGroup
toCarpetCallScheduleGroup
but the Fortran interface defined usingCCTK_FNAME(CallScheduleGroup)
cannot be fixed that way since Fortran code does not (tend to) include any header file.