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.
Hi, > Hi, I spend long time to install NetCDF for C++ because I'm not used to > Linux but finally did it. We have two versions of the netCDF-C++ library, an old one for netCDF-3 and a newer version for netCDF-4. You should use the most recent version, if possible, netCDF-cxx4 4.2.1. If you are already using that and built the library from it, did you run "make check" to run tests on the library, including compiling and running all the examples, such as simple_xy_wr? When I run "make check", the last part of the output is: PASS: simple_xy_wr PASS: sfc_pres_temp_wr PASS: pres_temp_4D_wr PASS: pres_temp_4D_rd PASS: simple_xy_rd PASS: sfc_pres_temp_rd PASS: simple_xy_wr_formats ============================================================================ Testsuite summary for netCDF-cxx4 4.2.1 ============================================================================ # TOTAL: 7 # PASS: 7 # SKIP: 0 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 ============================================================================ make[1]: Nothing to be done for `check-am'. If your versions of the test and the library are not the same, for example you have installed the old netCDF-3 library but are trying to run the netCDF-4 test, that may be the cause of the problem. The API's of the two versions, netcdf-cxx and netcdf-cxx4 are similar, but not the same. The netCDF-4 library makes use of Exceptions and Namespaces, but the old netCDF-3 version does not. If that's not the problem, then please send more details, for example the config.log file that was generated when you ran the configure script to build the library from source. If you have matching versions of the test examples and library, take a look at the output from "make check" to see if you are compiling and linking correctly. --Russ > However the example (simple_xy_wr) didn't run normally. > > The following line throws "NcNotNCF: Not a netcdf file" > > > > NcFile dataFile("simple_xy.nc", NcFile::replace); > > > > Any ideas? > > > > Sincerely, > > MURAKAMI Yuki > > > > ---- > > MURAKAMI Yuki > > Department of Energy and Environmental Engineering > > Interdisciplinary Graduate School of Engineering Sciences > > Kyushu university > > > Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: RSB-626499 Department: Support netCDF Priority: Normal Status: Closed