Unidata / netcdf-cxx4

Official GitHub repository for netCDF-C++ libraries and utilities.
Other
124 stars 49 forks source link

Errors in make check compiling with PGI 16.4 compilers #38

Open justbennet opened 8 years ago

justbennet commented 8 years ago

I am trying to compile netcdf-cxx4-4.3.0 on a CentOS 7.2 64-bit machine, and I am getting failures from 'make check'.

This is with the PGI compilers, version 16.4, HDF5, version 1.8.16, and NetCDF, version 4.4.1, all recently build, and all of which pass their tests upon making.

The configure options for netcdf-cxx4-4.3.0 is just the prefix, and the resulting nc-config --all reports

$ ./nc-config --all

This netCDF 4.4.1 has been built with the following features: 

  --cc        -> pgcc
  --cflags    ->  -I/sw/arcts/centos7/netcdf/4.4.1/pgi-16.4-hdf5-1.8.16/include -DpgiFortran -I/sw/arcts/centos7/hdf5/1.8.16-pgi-16.4/include
  --libs      -> 

  --has-c++   -> no
  --cxx       -> 
  --has-c++4  -> no
  --cxx4      -> 

  --fc        -> 
  --fflags    -> 
  --flibs     -> 
  --has-f90   -> no
  --has-f03   -> no

  --has-dap   -> yes
  --has-nc2   -> yes
  --has-nc4   -> yes
  --has-hdf5  -> yes
  --has-hdf4  -> no
  --has-logging-> no
  --has-pnetcdf-> no
  --has-szlib -> 

  --prefix    -> /sw/arcts/centos7/netcdf/4.4.1/pgi-16.4-hdf5-1.8.16
  --includedir-> /sw/arcts/centos7/netcdf/4.4.1/pgi-16.4-hdf5-1.8.16/include
  --version   -> netCDF 4.4.1

My configure line for netcdf-cxx4-4.3.0 is just configure --prefix=$PREFIX and I set the following environment variables.

export CC=pgcc
export CXX=pgc++
export FC=pgfortran
export F90=pgfortran
export F77=pgfortran
export CPP='pgcc -E'
export CXXCPP='pgc++ -E'
export CFLAGS='-O tp=p7-64'
export CXXFLAGS='-O tp=p7-64'
export FFLAGS='-O tp=p7-64'

 # These are set for the NetCDF C library build
export CPPFLAGS="-DpgiFortran -I${HDF5_INCLUDE}"
export CFLAGS="$CFLAGS ${CPPFLAGS} -L${HDF5_LIB} -lhdf5 -lz"
export LDFLAGS="-L${HDF5_LIB}"

 # These are set for the NetCDF C++ library build
export CPPFLAGS="-DpgiFortran -I${PREFIX}/include -I${HDF5_INCLUDE}"
export LDFLAGS="-L${PREFIX}/lib -L${HDF5_LIB}"

Rerunning each test program by hand results in the following failures

test_att
Opening file "firstFile.cdf" with NcFile::replace
Testing addGroup("groupName")                              -----------   passed
 [ . . . . ]
Testing getValues()                                        -----------   passed
terminate called after throwing an instance of 'netCDF::exceptions::NcEnoGrp'
  what():  NetCDF: No group found.
file: ncGroup.cpp  line:129
Testing attCount([netCDF::Location])                   Aborted (core dumped)

test_dim
Opening file "firstFile.cdf" with NcFile::replace
Testing addGroup("groupName")                              -----------   passed
 [ . . . . ]
Testing NcDim::getName()                                   -----------   passed
terminate called after throwing an instance of 'netCDF::exceptions::NcEnoGrp'
  what():  NetCDF: No group found.
file: ncGroup.cpp  line:129
Testing NcGroup::getDimCount([netCDF::Location])       Aborted (core dumped)

test_group
Opening file "firstFile.cdf" with NcFile::replace
Testing addGroup("groupName")                         -----------   passed
terminate called after throwing an instance of 'netCDF::exceptions::NcEnoGrp'
  what():  NetCDF: No group found.
file: ncGroup.cpp  line:129
Testing getGroupCount([netCDF::Location])         Aborted (core dumped)

test_open_close
terminate called after throwing an instance of 'netCDF::exceptions::NcException'
  what():  No such file or directory
file: ncFile.cpp  line:63
Attempting to open a file that doesn't exist... Aborted (core dumped)

test_type
Opening file "firstFile.cdf" with NcFile::replace
Testing addGroup("groupName")                                -----------   passed
[ . . . .  all passed . . . . ]
Testing VLEN ncFile::putVar() and NcFile::getVar()           -----------   passed
Testing COMPOUND with VLEN ncFile::putVar() and NcFile::getVar()    -----------   passed

test_var
Opening file "firstFile.cdf" with NcFile::replace
Testing addGroup("groupName")                              -----------   passed
 [ . . . . ]
terminate called after throwing an instance of 'netCDF::exceptions::NcEnoGrp'
  what():  NetCDF: No group found.
file: ncGroup.cpp  line:129
Testing addVar("varName","typeName","dimName")         Aborted (core dumped)

test_var2
terminate called after throwing an instance of 'netCDF::exceptions::NcEnoGrp'
  what():  NetCDF: No group found.
file: ncGroup.cpp  line:129
Aborted (core dumped)

The only warnings I get from compiling are

"ncDim.h", line 47: warning: type qualifier on return type is meaningless
      const int getId() const {return myId;};

several that look like

"test_type.cpp", line 162: warning: conversion from pointer to smaller integer
      compoundType1.addMember("member1",ncByte,offsetof(struct1,mem1));

with additional warnings about the pointer conversion to smaller integer on lines 163, 164, 168, 169, 170, 390, 391, 393, 518, and 519. There are also these warnings

"test_type.cpp", line 412: warning: variable "dummyStruct2" was set but never
          used
        struct3 dummyStruct2[2];
                ^
"test_type.cpp", line 533: warning: expression has no effect
        dummyData2.mem1[0];
        ^

I recently built using virtually the same procedure and compiler options with gcc 4.8.5, gcc 4.9.3, gcc 5.4.0, and Intel 16.0.3.

Please let me know if there is additional information you would like.

justbennet commented 8 years ago

PGI has been able to replicate and I have an open issue with them.