I have this tiny program, which does not compile using pgcc:
#include <tgmath.h>
int main(){
double f;
f=fabs((double)1.0);
f=sqrt((double)2.0);
}
Compiling:
$ pgcc -c99 bla.c
"bla.c", line 7: error: identifier "cfabs" is undefined
f=fabs((double)1.0);
^
"bla.c", line 7: error: identifier "cfabsf" is undefined
f=fabs((double)1.0);
^
"bla.c", line 7: error: identifier "cfabsl" is undefined
f=fabs((double)1.0);
^
"bla.c", line 5: warning: variable "f" was set but never used
double f;
^
3 errors detected in the compilation of "bla.c".
The PGI 19.10 compiler still mentioned :
PGC-F-0249-#error -- "Unsupported compiler; you cannot use <tgmath.h>" (/usr/include/tgmath.h: 244)
while the PGI 20.4 compiler gives many warnings, but does compile:
"bla.c", line 7: warning: __real/__imag applied to real value
f=fabs((double)1.0);
Is there something silly wrong in the code, or does the 20.7 compiler have an issue with the fabs() function?