ADIOS2 icon indicating copy to clipboard operation
ADIOS2 copied to clipboard

Compile ADIOS2 using nvhpc/21.7, got no instance of overloaded function error

Open halehawk opened this issue 4 years ago • 7 comments

Hi,

I tried to compile ADIOS2 using nvhpc/21.7 with setting std=c++14, I still got the following errors. Do you know how I can solve the problems? The CMakeLists.txt is almost same except settting "set(CMAKE_CXX_STANDARD 14)" ''' ADIOS2 build configuration: ADIOS Version: 2.7.1.745 C++ Compiler : PGI 21.7.0 /dav/opt/ncarcompilers/0.5.0/nvhpc/21.7/nvc++

Fortran Compiler : PGI 21.7.0 /dav/opt/ncarcompilers/0.5.0/nvhpc/21.7/nvfortran

Installation prefix: /usr/local bin: bin lib: lib64 include: include cmake: lib64/cmake/adios2 python: lib/python3.7/site-packages

Features: Library Type: shared Build Type: Release Testing: ON Examples: ON Build Options: Blosc : OFF BZip2 : ON ZFP : OFF SZ : OFF MGARD : OFF PNG : OFF MPI : ON DataMan : OFF DAOS : OFF MHS : ON SSC : ON SST : ON BP5 : ON DataSpaces: OFF ZeroMQ : OFF HDF5 : ON HDF5_VOL : OFF IME : OFF Python : OFF Fortran : ON SysVShMem : ON Profiling : ON Endian_Reverse: OFF LIBPRESSIO: OFF RDMA Transport for Staging: Available ''' "/usr/include/c++/4.8.5/complex", line 475: error: no instance of overloaded function "std::complex::real" matches the argument list and object (the object has type qualifiers that prevent a match) object type is: const std::complex { return __x.real() != __y.real() || __x.imag() != __y.imag(); } ^ detected during: instantiation of "bool std::operator!=(const std::complex<_Tp> &, const std::complex<_Tp> &) [with _Tp=float]" at line 81 of "/ADIOS2/source/adios2/toolkit/format/bp/bp3/BP3Serializer.tcc" instantiation of "void adios2::format::BP3Serializer::PutVariablePayload(const adios2::core::Variable<T> &, const adios2::core::Variable<T>::BPInfo &, bool, adios2::core::Variable<T>::Span *) [with T=std::complex]" at line 691 of "/ADIOS2/source/adios2/toolkit/format/bp/bp3/BP3Serializer.cpp"

halehawk avatar Nov 22 '21 20:11 halehawk

I don't know about this, but I am using PGI compiler to build ADIOS and use NVHPC to build the application.

pnorbert avatar Nov 22 '21 20:11 pnorbert

@halehawk is it possible to use a more recent gcc version? I don't think gcc 4.8.5 supports C++14. Hope it helps.

williamfgc avatar Nov 22 '21 20:11 williamfgc

I used gnu/9.1.0 compile ADIOS2 and had no problem, but when I used NVHPC/21.3 to compile an application that include "adios2.h" in *.C file, I got the following errors: /ADIOS2/install/include/adios2/cxx11/ADIOS.h", line 203: error: expected an identifier template <class R, class... Args> ^

"/ADIOS2/install/include/adios2/cxx11/ADIOS.h", line 205: error: expected a type specifier const std::function<R(Args...)> &function, ^ "/ADIOS2/install/include/adios2/cxx11/ADIOS.inl", line 22: error: expected an identifier template <class R, class... Args> ^

"/ADIOS2/install/include/adios2/cxx11/ADIOS.inl", line 24: error: expected a type specifier const std::function<R(Args...)> &function, ^

halehawk avatar Nov 22 '21 22:11 halehawk

@halehawk thanks. Somehow NVHPC is using gcc 4.8.5 under the hood as shown in the logs. Is there a way to use a more recent gcc version from within NVHPC. There is an old issue with PGI compilers (my guess is that NVHPC is a rebrand) using the system's old gcc, see 4) here.

williamfgc avatar Nov 22 '21 22:11 williamfgc

I ran the command: /glade/u/apps/opt/nvhpc/21.7/Linux_x86_64/21.7/compilers/bin/makelocalrc -d /glade/u/apps/dav/opt/ncarcompilers/0.5.0/nvhpc/21.7/mpi -gcc /glade/u/apps/dav/opt/ncarcompilers/0.5.0/gnu/9.1.0/gcc -gpp /glade/u/apps/dav/opt/ncarcompilers/0.5.0/gnu/9.1.0/g++ -g77 /glade/u/apps/dav/opt/ncarcompilers/0.5.0/gnu/9.1.0/gfortran -o -net 1>${HOME}/.mypgirc 2>/dev/null

When I look the mypgirc, it is set LDSO=/lib64/ld-linux-x86-64.so.2; set GCCDIR=/usr/lib/gcc/x86_64-redhat-linux/4.8.5; set G77DIR=/usr/lib/gcc/x86_64-redhat-linux/4.8.5/; set OEM_INFO=64-bit target on x86-64 Linux $INFOTPVAL; set GNUATOMIC=-latomic;

Did I do anything wrong?

halehawk avatar Nov 22 '21 23:11 halehawk

@halehawk hard to tell, try editing the file manually. BTW, are you able to reproduce the error with gcc 4.8.5 outside of NVHPC?

williamfgc avatar Nov 23 '21 16:11 williamfgc

After I used makelocalrc command and created mypgirc, I still got the same error. @williamfgc do you mean this?

halehawk avatar Nov 24 '21 18:11 halehawk