{"action":"created","issue":{"url":"https://api.github.com/repos/trilinos/Trilinos/issues/320","repository_url":"https://api.github.com/repos/trilinos/Trilinos","labels_url":"https://api.github.com/repos/trilinos/Trilinos/issues/320/labels{/name}","comments_url":"https://api.github.com/repos/trilinos/Trilinos/issues/320/comments","events_url":"https://api.github.com/repos/trilinos/Trilinos/issues/320/events","html_url":"https://github.com/trilinos/Trilinos/issues/320","id":151730872,"number":320,"title":"Shylu Core not compiling with Cuda enabled","user":{"login":"crtrott","id":9490481,"avatar_url":"https://avatars.githubusercontent.com/u/9490481?v=3","gravatar_id":"","url":"https://api.github.com/users/crtrott","html_url":"https://github.com/crtrott","followers_url":"https://api.github.com/users/crtrott/followers","following_url":"https://api.github.com/users/crtrott/following{/other_user}","gists_url":"https://api.github.com/users/crtrott/gists{/gist_id}","starred_url":"https://api.github.com/users/crtrott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crtrott/subscriptions","organizations_url":"https://api.github.com/users/crtrott/orgs","repos_url":"https://api.github.com/users/crtrott/repos","events_url":"https://api.github.com/users/crtrott/events{/privacy}","received_events_url":"https://api.github.com/users/crtrott/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/trilinos/Trilinos/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/trilinos/Trilinos/labels/Epetra","name":"Epetra","color":"eb6420"},{"url":"https://api.github.com/repos/trilinos/Trilinos/labels/ShyLU","name":"ShyLU","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-04-28T20:05:17Z","updated_at":"2016-04-29T18:49:07Z","closed_at":null,"body":"The following set of errors occur when compiling Shylu with Cuda enabled: \r\n\r\n```\r\n[ 37%] Building CXX object packages/shylu/core/src/CMakeFiles/shylu.dir/epetra/shylu_local_schur_operator.cpp.o\r\n/home/crtrott/Trilinos/packages/tpetra/kernels/src/Kokkos_ArithTraits.hpp(572): error: more than one instance of overloaded function \"isinf\" matches the argument list:\r\n            function \"isinf(float)\"\r\n            function \"std::isinf(float)\"\r\n            argument types are: (const float)\r\n\r\n/home/crtrott/Trilinos/packages/tpetra/kernels/src/Kokkos_ArithTraits.hpp(578): error: more than one instance of overloaded function \"isnan\" matches the argument list:\r\n            function \"isnan(float)\"\r\n            function \"std::isnan(float)\"\r\n            argument types are: (const float)\r\n\r\n/home/crtrott/Trilinos/packages/tpetra/kernels/src/Kokkos_ArithTraits.hpp(842): error: more than one instance of overloaded function \"isinf\" matches the argument list:\r\n            function \"isinf(double)\"\r\n            function \"std::isinf(double)\"\r\n            argument types are: (const double)\r\n\r\n/home/crtrott/Trilinos/packages/tpetra/kernels/src/Kokkos_ArithTraits.hpp(848): error: more than one instance of overloaded function \"isnan\" matches the argument list:\r\n            function \"isnan(double)\"\r\n            function \"std::isnan(double)\"\r\n            argument types are: (const double)\r\n\r\n/home/crtrott/Trilinos/packages/tpetra/kernels/src/Kokkos_ArithTraits.hpp(978): error: more than one instance of overloaded function \"isinf\" matches the argument list:\r\n            function \"isinf(long double)\"\r\n            function \"std::isinf(long double)\"\r\n            argument types are: (const long double)\r\n\r\n/home/crtrott/Trilinos/packages/tpetra/kernels/src/Kokkos_ArithTraits.hpp(984): error: more than one instance of overloaded function \"isnan\" matches the argument list:\r\n            function \"isnan(long double)\"\r\n            function \"std::isnan(long double)\"\r\n            argument types are: (const long double)\r\n```\r\n\r\nTypically this type of error comes from including both <math.h> and <cmath>, 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:\r\n```\r\n$ grep \"cmath\" ~/Trilinos/packages/epetra/src/*\r\n~/Trilinos/packages/epetra/src/Epetra_ConfigDefs.h:#include <cmath>\r\n~/Trilinos/packages/epetra/src/Epetra_ConfigDefs.h:#include <cmath>\r\n$ grep \"math.h\" ~/Trilinos/packages/epetra/src/*\r\n~/Trilinos/packages/epetra/src/Epetra_ConfigDefs.h:#include <math.h>\r\n```"},"comment":{"url":"https://api.github.com/repos/trilinos/Trilinos/issues/comments/215846276","html_url":"https://github.com/trilinos/Trilinos/issues/320#issuecomment-215846276","issue_url":"https://api.github.com/repos/trilinos/Trilinos/issues/320","id":215846276,"user":{"login":"mhoemmen","id":926747,"avatar_url":"https://avatars.githubusercontent.com/u/926747?v=3","gravatar_id":"","url":"https://api.github.com/users/mhoemmen","html_url":"https://github.com/mhoemmen","followers_url":"https://api.github.com/users/mhoemmen/followers","following_url":"https://api.github.com/users/mhoemmen/following{/other_user}","gists_url":"https://api.github.com/users/mhoemmen/gists{/gist_id}","starred_url":"https://api.github.com/users/mhoemmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhoemmen/subscriptions","organizations_url":"https://api.github.com/users/mhoemmen/orgs","repos_url":"https://api.github.com/users/mhoemmen/repos","events_url":"https://api.github.com/users/mhoemmen/events{/privacy}","received_events_url":"https://api.github.com/users/mhoemmen/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T18:49:07Z","updated_at":"2016-04-29T18:49:07Z","body":"> Mark, do we have to do this for each call of isinf and other potential problems ? Any simpler way ?\r\n\r\nNot really.  It's a good idea to specify the namespace of such functions anyway.  You could also use `Kokkos::Details::ArithTraits` to get safely wrapped isinf etc.  At some point we'll promote this traits class out of the Details inner namespace.  Also, don't include C headers (math.h) into C++ code; prefer C++ headers (cmath)."}}