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 We installed the Portland Group 4.0 compilers on a Linux 2.4.18-14smp platform here, and the 3.5.1-beta10 version of netCDF builds and tests successfully, including the C++ tests. I also was able to reproduce the problems you saw with the 3.3 version of PG compilers on another platform, so this seems to indicate that the problems you saw were bugs in the PG compilers that have been fixed with the 4.0 release of the Portland Group products. For reference, here are the relevant environment variables I used to build and test netCDF 3.5.1-beta10 with PG 4.0 compilers: CC=pgcc FC='' F90='' CXX=pgCC After the above worked to verify the C and C++ interfaces, I also tried building the Fortran 77 and Fortran 90 interfaces, with CC=pgcc CPPFLAGS=-DpgiFortran FC='pgf77 -V' F90='pgf90 -V' CXX=pgCC and all tests succeeded. As a result of this testing, I recommend that you upgrade to Portland Group 4.0 compilers. --Russ