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.
> I downloaded netcdf-4.3.3.1.tar.gz and netcdf-cxx4-4.2.1.tar.gz. > NetCDF-4 with "--disable-netcdf-4" was already installed on the server and it > has been used for Fortran. I don’t know the details. > However I'm not good at Fortran and good at C++ so I tried to install on my > local directory. > > "make check" put out almost same log. "Leaving directory ..." was added. > I have looked > PASS: simple_xy_wr > and > # TOTAL: 7 > # PASS: 7 > in it. > > I built the example by using own Makefile (attached). You have LDFLAGS = -L/home/murakami/netcdf4/lib -L/home/murakami/netcdfcxx4/lib -lnetcdf -lnetcdf_c++4 Since the netCDF-4-C++ library depends on the netCDF-C libraryTry changing that to LDFLAGS = -L/home/murakami/netcdfcxx4/lib -lnetcdf_c++4 -L/home/murakami/netcdf4/lib -lnetcdf instead. If that doesn't fix the problem, please provide more details, such as whether simple_xy.nc is created, and if so, what the output is for ls -l simple_xy.nc and ncdump -sh simple_xy.nc --Russ > I noticed built simple_xy_wr was there after read your reply. It created a > file successfully. > > > ------ > MURAKAMI Yuki > Department of Energy and Environmental Engineering > Interdisciplinary Graduate School of Engineering Sciences > Kyushu university > > > -----Original Message----- > From: Unidata netCDF Support [mailto:address@hidden] > Sent: Saturday, September 19, 2015 6:49 AM > To: address@hidden > Cc: address@hidden > Subject: [netCDF #RSB-626499]: Failed to create file > > 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 > > > 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