Problem when compiling

Dear all I have a problem when compiling with pgc++.

I have installed pgc++ 17.4-0 64-bit on Ubuntu 17.10. I have also GNU 4.8, 5.0 and 7.0 installed but I have selected GNU 5.0 (update alternatives) . When I am trying to compile a .cpp file I get the following errors:

pgc++ -c -o obj/vector_sum_cpu_openacc.o src/vector_sum_cpu.cpp -g  -std=c++11
"/usr/include/x86_64-linux-gnu/bits/floatn.h", line 62: error: invalid argument
          to attribute "__mode__"
  typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
                                                               ^

"/usr/include/x86_64-linux-gnu/bits/iscanonical.h", line 51: error: function
          "iscanonical(long double)" has already been defined
  inline int iscanonical (_Float128 __val) { return __iscanonicalf128 (__val); }
             ^

"/usr/include/math.h", line 505: error: function "issignaling(long double)" has
          already been defined
  inline int issignaling (_Float128 __val) { return __issignalingf128 (__val); }
             ^

3 errors detected in the compilation of "src/vector_sum_cpu.cpp".

This file was compiled with no error on another computer with Ubuntu 16.04.

Do you have any idea how to solve the problem ?

Regards,
JM

Hello,

Either post the source(s) and headers for the file that failed to
compile with Ubuntu 17.10, or send them to trs@pgroup.com
and we will determine if they still fail on current releases and the
upcoming PGI 17.10 professional and community releases.

It’s always a risk to install the newest Linux and GNU versions,
and then expect a 6-month old PGI release to work with them.
Linux and GNU love to change things.

regards,
dave

I am trying to compile the following code with the pgi c++ compiler in ubuntu 17.10

// my first program in C++
#include

int main()
{
std::cout << “Hello World!”;
}


I get the following error
“/usr/include/x86_64-linux-gnu/bits/floatn.h”, line 62: error: invalid argument
to attribute “mode
typedef _Complex float __cfloat128 attribute ((mode (TC)));


How do I solve this?

I have asked engineering to create an Ubuntu1710 system to check out
your issue.

Our release notes (Bar at Top->Support->Documentation->Release Notes->Platforms supported) indicate
Ubuntu 12.04+ to Ubuntu 16.10 are what we support.

Wait for the support to come, or install a version of Linux
the current compilers support.

dave

Hello Dave,
I’m experiencing the same issue.
I have also installed Ubuntu 17.10 and installed the pgi community edition 17.10. and getting the same errors. The code worked in Ubuntu 17.04.

In another post (https://forums.developer.nvidia.com/t/pgc-17-10-has-trouble-with-glibc-2-26/135473/1) you tell that it is the gcc version that mostly creates incompatibilities. So, is there any hope of making pgi work changing the gcc version using “update-alternatives”? If so, what should I do?
Edit: I have installed gcc-5 and changed using “update-alternatives” but I’m still getting the error.

Many thanks,

Xavier

Very easy to explain.

Ubuntu 1704 uses gcc 6.3.0 which is supported in PGI 17.10

Ubuntu 1710 uses gcc 7.2.0 which is not supported in PGI 17.10

gcc 7.2.0 is supported by the PGI Professional 18.1 release, out now.

The next Community Edition will probably be 18.4 , which should work.


dave

Thank your for your reply.

Sorry for chasing up. As you said, is easy to understand that your compiler does not support gcc-7.2.

What I would like to know is if it should work if I change the gcc version to one supported by the pgi compiler using “update-alternatives”?

Thank you very much for your time,

Xavier

The script makelocalrc creates the localrc file which handles
the local differences, like where gcc is, where the libs are, which headers PGI should use, etc.

It does not work well with gcc versions that are not default.

If you retrofit an older gcc version, look at what

gcc -v -o hello_gcc hello.c

puts out for your new compiler, and what

pgcc -v -o hello_pgi hello.c

puts out, along with

pgcc -dryrun -o hello_pgi hello.c

and determine what is different between them, and edit
the localrc file.so the same headers, assembler, linker used
by the new gcc is also used by pgcc when using integrated gcc headers and libs.

dave