pgc++ - Simple program compilation failing

Hello,

I’m having a very frustrating problem with the pgc++ compiler.

Trying to compile this simple program:

hello.cpp

#include <iostream>

int main ()
{
std::cout << "hello world!\n";
}

with

pgc++ -acc -Minfo=accel -o hello hello.cpp

fails and produces the following output:

"/usr/include/c++/8.2.1/type_traits", line 1049: error: type name is not
          allowed
        : public __bool_constant<__is_assignable(_Tp, _Up)>
                                                 ^

"/usr/include/c++/8.2.1/type_traits", line 1049: error: type name is not
          allowed
        : public __bool_constant<__is_assignable(_Tp, _Up)>
                                                      ^

"/usr/include/c++/8.2.1/type_traits", line 1049: error: identifier
          "__is_assignable" is undefined
        : public __bool_constant<__is_assignable(_Tp, _Up)>
                                 ^

"/usr/include/c++/8.2.1/bits/stl_function.h", line 431: error: identifier
          "__UINTPTR_TYPE__" is undefined
        return (__UINTPTR_TYPE__)__x < (__UINTPTR_TYPE__)__y;
                ^

"/usr/include/c++/8.2.1/bits/stl_function.h", line 431: error: expected a ";"
        return (__UINTPTR_TYPE__)__x < (__UINTPTR_TYPE__)__y;
                                 ^

5 errors detected in the compilation of "hello.cpp".

while trying to compile with g++ works fine.

Any thoughts on this one?

I’m using PGI 18.4 Community edition.

Hi xChi,

The PGI 18.4 C++ compilers are compatible with up to GNU 7.2, you’re using 8.2.1. PGI 18.7 added support for GNU 8.1.

FYI, you can find the currently support GNU versions in the compiler release notes under the “what’s new” section for each release.

See: Release Notes :: PGI version 18.7 Documentation for x86 and NVIDIA Processors


Hope this helps,
Mat