Strange problem when using isinf function

I have just downloaded PGI compilers 16.10 for OSX (I am using OSX10.10.5).
I experienced a strange problem when compiling a large program I produced, problem that can be reproduced with this tiny piece of C++ code (pgc_pb.cc):

#include <iostream>
#include <cmath>

int main()
{
	std::cerr << isinf(1e10) << std::endl;
}

When compiling I got an error:

pgc++ -o pgc_pb pgc_pb.cc
Undefined symbols for architecture x86_64:
“_inf”, referenced from:
___inline_isinfd in pgc_pb.o
ld: symbol(s) not found for architecture x86_64

Maybe a missing library during linking, but which library?
I tried linking various library…

pgc++ -o pgc_pb pgc_pb.cc -lgcc -lSystem -lm

…but the error is the same…

Which library should I link?

I have replicated the issue and I have filed TPR 23625 to log it.

Thanks for the report.


dave

Do you think that older releases are affected by the same problem?
Where can I get older releases?
Many thanks!

Fabio

PGI has made the archive releases only available to users who have a
valid PIN tied.

If you are using a community edition license, 16.10 is the only version
that will work with the community license.

I am not sure this is only a missing library issue.

apparently the problem can be solved by undefining GNUC before EACH include of cmath as in the following example:

#include <iostream>
#undef __GNUC__
#include <cmath>

int main()
{
	std::cerr << isinf(1e10) << std::endl;
}

Doing so, I solved the problem also for my big program.
Fabio

17.3 is out, and fixes the issues logged as TPR 23625 for using OSX86-64 compilers.

dave