Compiling with pgCC and including complex.h

Based on this post

https://forums.developer.nvidia.com/t/severe-problem-with-pgf90/130124/1

we just upgraded our compilers to version 6.1-3 and rebuilt mpich accordingly. However, we still get the same error message, even for a simple test program which just includes complex.h. Does the 6.1-3 version support this part of C99? If so, can someone point the way out of my confusion?

Thanks

Hi ghoti,

C99 Complex numbers are supported in both pgcc and pgCC. With pgcc you would use the “complex.h” header file. However, pgCC uses the C++ header file “complex”. So changing “#include <complex.h>” to "#include " will allow you to use compex numbers with pgCC.

Hope this helps,
Mat

Thanks,

I’ll give that a shot.

I am having the same issue with pgcc version 6.1-3, when add
#include “complex.h” I get the same error messages a in the post https://forums.developer.nvidia.com/t/severe-problem-with-pgf90/130124/1

Hi KRB,

To use “complex.h” with the 6.1 pgcc compiler, you need to enable C99 support by adding the “-c9x” flag. Note that “-c9x” is used by default with the 6.2 compilers.

Hope this helps,
Mat

% cat cmp.c
#include <complex.h>

int main () {
   exit(0);
}
% pgcc -V6.1-3 cmp.c -c9x