CUDA Fortran samples compilation problem

Hi hupca_ovidiu,

From our FAQs c++config.h error messages

Q. When I try to compile any accelerator program I get the follow error messages:

% make f1.exe
pgfortran -o f1.exe f1.f90 -ta=nvidia -Minfo=accel -fast
/usr/include/c++/4.3/x86_64-suse-linux/bits/c++config.h(1642): error: expected a "{"

/usr/include/c++/4.3/bits/cpp_type_traits.h(74): error: expected a "{"

/usr/include/c++/4.3/bits/cpp_type_traits.h(81): error: expected a "{"

/usr/include/c++/4.3/bits/cpp_type_traits.h(299): error: name followed by "::" must be a class or namespace name

/usr/include/c++/4.3/bits/cpp_type_traits.h(299): error: too many arguments for class template "<error>::__is_normal_iterator"

/usr/include/c++/4.3/bits/cpp_type_traits.h(299): error: name followed by "::" must be a class or namespace name
... continues

A. This error is caused by an incompatibility between the GNU g++ 4.3 header files and the NVIDIA installation. To work around this issue add the line “set GCCVERSION=40301” line to your $PGI/linux86-64//bin/sitenvrc file.

For example:

cat /usr/pgi/linux86-64/9.0-1/bin/sitenvrc
set NVOPEN64DIR=/opt/cuda/open64/lib;
set CUDADIR=/opt/cuda/bin;
set CUDALIB=/opt/cuda/lib;
set GCCVERSION=40301;

Hope this helps,
Mat