PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

pgc++ fails to compile code which uses std::isnan

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
jirikraus



Joined: 02 Apr 2013
Posts: 2

PostPosted: Wed Jul 17, 2013 7:47 am    Post subject: pgc++ fails to compile code which uses std::isnan Reply with quote

When I try to compile the following code with pgc++:

Code:

#include <cmath>

int main()
{
        double val = 0.0;
        std::isnan(val);
        return 0;
}


I get
> pgc++ -o pgi_test pgi_test.cpp
"/usr/include/c++/4.3/cmath", line 540: error: identifier "__builtin_isnan" is
undefined
return __builtin_isnan(__type(__f));
^
detected during instantiation of
"__gnu_cxx::__enable_if<std::__is_arithmetic<_Tp>::__value,
int>::__type std::isnan(_Tp) [with _Tp=double]" at line 6
of "pgi_test.cpp"

1 error detected in the compilation of "pgi_test.cpp".

Is this an issue with my installation or an issue with pgc++? Is there a possible workaround?

pgc++ is pgc++ 13.6-0 64-bit target on x86-64 Linux -tp nehalem
g++ is g++ (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973][/code]
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6125
Location: The Portland Group Inc.

PostPosted: Wed Jul 17, 2013 10:33 am    Post subject: Reply with quote

Hi jirikraus,

Thanks for the report. This is actually a known issue but hasn't been fixed in an external release as of yet. To track, I added TPR#19468. Hopefully since it's been addressed internally, we can get the updates into the next external release (13.9).

As a work-around till then, remove "std::" from "isnan".

Best Regards,
Mat
Back to top
View user's profile
jirikraus



Joined: 02 Apr 2013
Posts: 2

PostPosted: Wed Jul 17, 2013 10:57 am    Post subject: Reply with quote

Thanks for the simple workaround. Jiri
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group