Shylu Core not compiling with Cuda enabled
Created by: crtrott
The following set of errors occur when compiling Shylu with Cuda enabled:
[ 37%] Building CXX object packages/shylu/core/src/CMakeFiles/shylu.dir/epetra/shylu_local_schur_operator.cpp.o
/home/crtrott/Trilinos/packages/tpetra/kernels/src/Kokkos_ArithTraits.hpp(572): error: more than one instance of overloaded function "isinf" matches the argument list:
function "isinf(float)"
function "std::isinf(float)"
argument types are: (const float)
/home/crtrott/Trilinos/packages/tpetra/kernels/src/Kokkos_ArithTraits.hpp(578): error: more than one instance of overloaded function "isnan" matches the argument list:
function "isnan(float)"
function "std::isnan(float)"
argument types are: (const float)
/home/crtrott/Trilinos/packages/tpetra/kernels/src/Kokkos_ArithTraits.hpp(842): error: more than one instance of overloaded function "isinf" matches the argument list:
function "isinf(double)"
function "std::isinf(double)"
argument types are: (const double)
/home/crtrott/Trilinos/packages/tpetra/kernels/src/Kokkos_ArithTraits.hpp(848): error: more than one instance of overloaded function "isnan" matches the argument list:
function "isnan(double)"
function "std::isnan(double)"
argument types are: (const double)
/home/crtrott/Trilinos/packages/tpetra/kernels/src/Kokkos_ArithTraits.hpp(978): error: more than one instance of overloaded function "isinf" matches the argument list:
function "isinf(long double)"
function "std::isinf(long double)"
argument types are: (const long double)
/home/crtrott/Trilinos/packages/tpetra/kernels/src/Kokkos_ArithTraits.hpp(984): error: more than one instance of overloaded function "isnan" matches the argument list:
function "isnan(long double)"
function "std::isnan(long double)"
argument types are: (const long double)
Typically this type of error comes from including both <math.h> and , with the latter being the proper C++ include, while the former actually includes the C header file. Most compilers seem to have ways around including both files, but when dealing with nvcc you have two compilers and including both of those math headers often fails. Doing a very cursory search on where those includes might come from it looks like it is from Epetra:
$ grep "cmath" ~/Trilinos/packages/epetra/src/*
~/Trilinos/packages/epetra/src/Epetra_ConfigDefs.h:#include <cmath>
~/Trilinos/packages/epetra/src/Epetra_ConfigDefs.h:#include <cmath>
$ grep "math.h" ~/Trilinos/packages/epetra/src/*
~/Trilinos/packages/epetra/src/Epetra_ConfigDefs.h:#include <math.h>