This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
>To: address@hidden >From: Merrill Bean <address@hidden> >Subject: Re: 20030217: building netcdf C++ interface using pgCC >Organization: NMSU/PSL >Keywords: 200302171812.h1HICP414593 netCDF C++ pgCC Merrill, > I tried the 3.5.1beta10 and I see the same errors, the warning in the c > compile, and the errors in the c++. If the log files would be helpful I > can send those as well, here are the errors: > > pgcc -c -DpgiFortran -I. -DpgiFortran -DNDEBUG putget.c > PGC-W-0142-Assignment to const object not allowed (putget.c: 373) > PGC-W-0142-Assignment to const object not allowed (putget.c: 11527) > PGC-W-0142-Assignment to const object not allowed (putget.c: 11532) > PGC/x86 Linux/x86 3.3-2: compilation completed with warnings > pgcc -c -DpgiFortran -I. -DpgiFortran -DNDEBUG string.c > Making `all' in directory /usr/local/src/netcdf/netcdf-3.5.1-beta10/src/cxx > > make[2]: Entering directory > `/usr/local/src/netcdf/netcdf-3.5.1-beta10/src/cxx' > pgCC -c -I../libsrc -I. -DpgiFortran -DNDEBUG netcdf.cpp > "ncvalues.h", line 35: warning: integer conversion resulted in a change of > sign > static const ncbyte ncBad_byte = NC_FILL_BYTE; > ^ > > pgCC -c -I../libsrc -I. -DpgiFortran -DNDEBUG ncvalues.cpp > "ncvalues.h", line 35: warning: integer conversion resulted in a change of > sign > static const ncbyte ncBad_byte = NC_FILL_BYTE; > > ar cru libnetcdf_c++.a netcdf.o ncvalues.o > ranlib libnetcdf_c++.a > pgCC -c -I../libsrc -I. -DpgiFortran -DNDEBUG nctst.cpp > "ncvalues.h", line 35: warning: integer conversion resulted in a change of > sign > static const ncbyte ncBad_byte = NC_FILL_BYTE; > ^ > > pgCC -o nctst nctst.o libnetcdf_c++.a -L../libsrc -lnetcdf > C++ prelinker: executing: /usr/pgi/linux86/bin/pgCC -I../libsrc -I. > -DpgiFortran -DNDEBUG -c nctst.cpp > "ncvalues.h", line 35: warning: integer conversion resulted in a change of > sign > static const ncbyte ncBad_byte = NC_FILL_BYTE; > ^ > > libnetcdf_c++.a(ncvalues.o): In function `NcValues_ncbyte::print( > const(std::basic_ostream<char,std::char_traits<char>> &))': > ncvalues.o(.text+0xb2f): undefined reference to > `std::__ls__tm__30_Q2_3std20char_traits__tm__2_c(std::basic_ostream<char,> &, > unsigned char)' > ncvalues.o(.text+0xb65): undefined reference to > `std::__ls__tm__30_Q2_3std20char_traits__tm__2_c(std::basic_ostream<char,> &, > unsigned char)' > libnetcdf_c++.a(ncvalues.o): In function `NcValues_char::print( > const(std::basic_ostream<char,std::char_traits<char>> &))': > ncvalues.o(.text+0x13ce): undefined reference to > `std::__ls__tm__30_Q2_3std20char_traits__tm__2_c(std::basic_ostream<char,> &, > char)' > ncvalues.o(.text+0x1408): undefined reference to > `std::__ls__tm__30_Q2_3std20char_traits__tm__2_c(std::basic_ostream<char,> &, > char)' > ncvalues.o(.text+0x1421): undefined reference to > `std::__ls__tm__30_Q2_3std20char_traits__tm__2_c(std::basic_ostream<char,> &, > char)' > make[2]: *** [nctst] Error 2 > make[2]: Leaving directory `/usr/local/src/netcdf/netcdf-3.5.1-beta10/src/cxx' > make[1]: *** [subdir_target] Error 1 > make[1]: Leaving directory `/usr/local/src/netcdf/netcdf-3.5.1-beta10/src' > make: *** [cxx/all] Error 2 Thanks for sending this. We'll have to get a working Portland Group compiler installed here to duplicate the problem before we can fix it, if it's not a pgCC bug. The C++ code seems to work OK with several other C++ compilers, including g++ version 3.2. In the meantime, can you get by with CXX=g++? --Russ _____________________________________________________________________ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu