Cactus math work-arounds break CarpetX reduction operators

Create issue
Issue #2407 open
Erik Schnetter created an issue

Years ago we introduced work-arounds for C++ compilers that didn’t properly support the std:: namespace (probably PGI, IBM, Cray). It turns out these work-arounds violate the C++ standard since the re-define global identifiers such as “isnan”. I found out today that they actually break the reduction operators in CarpetX when “-O2” is used (“-O0” is fine).

These versions of these compilers are not relevant any more, and these work-arounds can now be removed. This they cause problems and since they violate the C++ standard, I suggest that we do so.

Comments (4)

  1. Roland Haas

    The patch as of git hash 62bc14ab "Remove C++ math work-arounds" of cactus breaks compilation on QueenBee with

    COMPILING EinsteinEvolve/NewRad/src/extrap.cc
    In file included from /home/rhaas/ET_trunk/configs/sim/bindings/include/GenericFD.h(4),
                     from /home/rhaas/ET_trunk/arrangements/EinsteinEvolve/NewRad/src/extrap.cc(8):
    /home/rhaas/ET_trunk/arrangements/KrancNumericalTools/GenericFD/src/GenericFD.h(78): error: more than one instance of overloaded function "signbit" matches the argument list:
    In file included from /home/rhaas/ET_trunk/configs/sim/bindings/include/GenericFD.h(4),
                     from /home/rhaas/ET_trunk/arrangements/EinsteinEvolve/NewRad/src/extrap.cc(8):
                function "signbit(double)"
    In file included from /home/rhaas/ET_trunk/configs/sim/bindings/include/GenericFD.h(4),
                     from /home/rhaas/ET_trunk/arrangements/EinsteinEvolve/NewRad/src/extrap.cc(8):
                function "std::signbit(double)"
    In file included from /home/rhaas/ET_trunk/configs/sim/bindings/include/GenericFD.h(4),
                     from /home/rhaas/ET_trunk/arrangements/EinsteinEvolve/NewRad/src/extrap.cc(8):
                argument types are: (CCTK_REAL8)
    In file included from /home/rhaas/ET_trunk/configs/sim/bindings/include/GenericFD.h(4),
                     from /home/rhaas/ET_trunk/arrangements/EinsteinEvolve/NewRad/src/extrap.cc(8):
        int s = signbit(x);
    

    The current choice being between breaking the existing ET on QueenBee (old but in the official list of supported machines) and breaking CarpetX I would rather keep CarpetX broke until QueenBee’s option list etc has been updated.

  2. Log in to comment