error: more than one instance of overloaded function "isnan" matches the argument list

Issue #2705 new
Miguel Zilhão created an issue

With ET_2022_11, I’m finding the following error on at least two different machines when using the intel compilers:

error: more than one instance of overloaded function "isnan" matches the argument list:
            function "isnan(double)"
            function "std::isnan(double)"
            argument types are: (double)

and an equivalent error for the “isinf” function. The error points to lines 220 and 228 in the file cactustest/TestMath/src/ If I comment lines 218-232 in this file (or prefix the the calls with "std::") it seems to compile fine.

One machine where this happens is Marenostrum 4, but bizarrely, whether the error shows up or not, depends on which modules (and in which order) are loaded.

Comments (4)

  1. Roland Haas

    Cactus requires a C++ compiler with full C++11 support ( and For gcc this means at least gcc 6. For Intel this means that you have to (if the admins failed to do so) point icpc to use an STL from a g++ (it uses GCC’s C++ library) using the -gxx-name path-to-g++ option. Here path-to-g++ must point to a compatible g++ that is at least version 6. Intel does not make it easy to find out which versions are supported (used to be in the compiler release notes but those are now next to impossible to find). Your best guess is to start with a the newest version of g++ and check of icpc outputs a warning (it does) that the version of g++ is too new. Then go back to the next older one offered by the cluster until you find one that works.

  2. Miguel Zilhão reporter

    I see. On Marenostrum, I can indeed fix this by pointing to a suitable g++ version. On our local cluster, however, they only provide updated intel compiles and the gcc available is version 4. Is there anyway around this, or do I really need to ask the sysadmins to provide updated gcc compilers as well?

  3. Roland Haas

    uh there may be a way around. Though it would require that we added extra #ifdef to the code and the point of this was more or less to not have those around anymore.

    Nope, no luck. I took a look at the ticket where this was initial discussed: and keeping workarounds was considered optional and since we never ran into issues on “supported” clusters they were not implemented.

    I think you may stand a good chance asking the admins to install a newer gcc for you since gcc 4.X is really very old. In particular if you can point them to the Intel docs stating that g++'s STL is needed for icpc (see eg for intel 2019 and its requirements).

    If all else fails, you can also compile your own g++ and use that. Usually following the instructions at , , and (very carefully! note the build directory and the contrib/download_prerequisites script) works (it will take a while though) and afterwards you can pass the -gxx-name <path-to-g++> option to icpc to make it use the new stdc++ library.

    You can also experiment with using spack to install gcc (which is easier, but just as slow).

  4. Log in to comment