[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #YEN-120070]: netCDF-4.0.1 error for 'make check'



> Bug-report for netCDF-4
> VERSION: netCDF 4.0.1 (also for netCDF 4.0.1-beta3)
> 
> Compiler:
> Target: i486-linux-gnu
> Configured
> with: ../src/configure -v 
> --enable-languages=c,c++,fortran,objc,obj-c++,treelang
> --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib 
> --without-included-gettext
> --enable-threads=posix --enable-nls --program-suffix=-4.1 
> --enable-__cxa_atexit
> --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --with-tune=i686
> --enable-checking=release i486-linux-gnu
> Thread model: posix
> gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) 6
> 
> # -------------------------
> 
> I browsed the netCDF support archives, but could not find any reference to the
> failures during 'make check', so you might be interested.
> 
> Because of some failures, I applied 'make distclean' and restarted with the
> debug option (-g) set for gcc/g++. Using the kdbg debugger I found a fix,
> but of course I am not sure whether there are any side-effects.
> 
> Here is a short outline of the steps I have done, details follow below. The
> numeration of the list correspondes to the numbers in the file names appended
> to this e-mail (Note: file 'make.out.1' doesn't exist).
> 
> I hope, this could be helpful.
> 
> Best regards,
> hdh
> 
> 0) make distclean
> configure &> configure.out
> make &> make.out.0
> make check &> make.check.out.0
> Note: make check stopped with a compilation error
> 
> 1) fix a compilation problem in file cxx4/tst_simple.cpp:
> make check &> make.check.out.1
> Note: make check stopped after reaching
> *** testing simple groups...Exception Occured
> 
> 2) fix problem in file libsrc4/nc4file.c in function nc_open:
> make distclean -> configure -> make -> make check &> make.check.out.2
> Note: 'make check' stopped after reaching
> *** checking simple_xy.nc...
> simple_xy.nc ../C/simple_xy.nc differ: byte 1, line 1
> FAIL: do_comps.sh
> 
> 3a-c)
> Details of difficulties in:
> *** Testing that CXX examples produced same files as C examples.
> 
> 
> # --------------------
> DETAILS:
> 
> 1) cxx/4tst_simple.cpp
> The compiler complains about such lines:
> NcAtomicType* ncNoType = new NcAtomicType(NC_UNSPECIFIED);;
> 
> Apparantly, there is no class named 'NcAtomicType' available.
> Commenting these lines out, solves the compilation error.
> 
> 2) File libsrc4/nc4file.c
> Function:
> static int
> nc4_open_file(const char *path, int mode, MPI_Comm comm,
> MPI_Info info, NC_FILE_INFO_T *nc)
> 
> (The parameter 'int mode' was set to NC_NETCDF4  in file cxx4/ncfile.cpp
> in constructor NcFile::NcFile( string path, FileMode fMode)
> in the block 'case ReadOnly:')
> 
> The condition
> 
> /* Check the mode for validity. First make sure only certain bits
> * are turned on. Also MPI I/O and MPI POSIX cannot both be
> * selected at once. */
> if (mode & ~(NC_WRITE | NC_SHARE | NC_MPIIO | NC_MPIPOSIX | NC_LOCK) ||
> (mode & NC_MPIIO && mode & NC_MPIPOSIX))
> return NC_EINVAL;
> 
> is always true, thus the value of NC_EINVAL==(-36) is returned.
> 
> Here are the results of the sub-parts of the expression:
> -27650 = ~(NC_WRITE | NC_SHARE | NC_MPIIO | NC_MPIPOSIX | NC_LOCK )
> 4096   = mode & ~(NC_WRITE | NC_SHARE | NC_MPIIO | NC_MPIPOSIX | NC_LOCK )
> 0      = mode & NC_MPIIO
> 0      = mode & NC_MPIPOSIX
> 0      = mode & NC_MPIIO && mode & NC_MPIPOSIX
> 
> However, if NC_NETCDF4 is added to the bit operation
> ~(NC_WRITE | NC_SHARE | NC_MPIIO | NC_MPIPOSIX | NC_LOCK | NC_NETCDF4)
> 
> then testing reports
> '*** Testing tst_file in tst_suite  OK***'
> 
> 3a)
> make check reveals:
> *** Testing that CXX examples produced same files as C examples.
> *** checking simple_xy.nc...
> simple_xy.nc ../C/simple_xy.nc differ: byte 1, line 1
> FAIL: do_comps.sh
> 
> Note: Although there are some differences in the bit representation of the
> C and C++ generated files, respectively, 'ncdump -b c simple_xy.nc' tells no
> differences in the ascii representation.
> 
> 3b)
> after skipping line 'cmp simple_xy.nc ../C/simple_xy.nc' in do_comps.sh
> *** Testing that CXX examples produced same files as C examples.
> *** checking simple_xy.nc...
> *** checking sfc_pres_temp.nc...
> sfc_pres_temp.nc ../C/sfc_pres_temp.nc differ: byte 1, line 1
> FAIL: do_comps.sh
> 
> Note: there a some differences in two unit attributes of the ascii output
> given by
> 'ncdump -b c sfc_pres_temp.nc'
> 
> From examples/C/sfc_pres_temp.nc:
> float latitude(latitude) ;
> latitude:units = "degrees_north" ;
> float longitude(longitude) ;
> longitude:units = "degrees_east" ;
> 
> From examples/C/sfc_pres_temp.nc:
> float latitude(latitude) ;
> latitude:units = "?" ;
> float longitude(longitude) ;
> longitude:units = "l" ;
> 
> 3c)
> after skipping also line 'cmp pres_temp_4D.nc ../C/pres_temp_4D.nc' in
> do_comps.sh
> *** Testing that CXX examples produced same files as C examples.
> *** checking simple_xy.nc...
> *** checking sfc_pres_temp.nc...
> *** checking pres_temp_4D.nc...
> pres_temp_4D.nc ../C/pres_temp_4D.nc differ: byte 1, line 1
> FAIL: do_comps.sh
> 
> Note: also apparent errors in all unit attributes in the C++ generated output.
> 
> After skipping this test, too, 'make check' ran successfully to the end.
> 
> 
> -----------------------------------------------
> Dr. Heinz-Dieter Hollweg
> Max-Planck-Institut f. Meteorologie
> Gruppe Modelle & Daten
> Post adress: Bundesstr. 53, D-20146 Hamburg
> Office adress: Beim Schlump 58, D-20144 Hamburg
> Tel: (+49) 40 41173 -435, Fax: -476
> address@hidden
> 
> 

Howdy Herr Doktor!

Firstly, let me ask if you intend to use the C++ API? Many C++ programmers 
choose to use the C API because the C++ API is in the process of being replaced 
with a new API, the cxx4 project.

If you are not using C++, then configure netcdf with --disable-cxx and rerun 
make check.

If you do wish to use the C++ API, then it would be helpful if you could do a 
make distclean, and then rerun netCDF configure and make check, saving all the 
output. Send that output, and the config.h file, in the body of an email reply, 
and I can help solve your build problem.

In general, when the build breaks, it will not do much good to try and turn off 
tests and library code in an attempt to get the build to work. The tests serve 
as our early warning system that there will be a problem on your platform. We 
don't want you to think netCDF is working, and only find out that something is 
broken when you have used it to store years of important data.

It is known that the C++ API does not work on some C++ compilers, but it is 
known to work with g++, which should be what you are using. I will be able to 
tell more when I see your configure output.

Ticket Details
===================
Ticket ID: YEN-120070
Department: Support netCDF
Priority: High
Status: Open