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 Maggie, > I was wondering if I could get a little help. I've been trying to > install NetCDF 3.6.3 on my Macbook Pro. I'm running Mac OSx 10.6, and > my compiler is gfortran. > > The actual install seems to go well. I get a message saying that > NetCDF was successfully installed. But when I do "make check" there > seems to be some problem with the library path. > > Attached are the output from the .configure, make, sudo make install, > and make check commands. It looks like all the tests for the C and Fortran interfaces and ncgen and ncdump utility programs worked fine. The only problem occurred in trying to link the C++ interface with g++: > Making check in cxx > make nctst tst_failure > depbase=`echo nctst.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ > g++ -DHAVE_CONFIG_H -I. -I.. -I../fortran -I../libsrc -g > -O2 -MT nctst.o -MD -MP -MF $depbase.Tpo -c -o nctst.o nctst.cpp &&\ > mv -f $depbase.Tpo $depbase.Po > /bin/sh ../libtool --tag=CXX --mode=link g++ -g -O2 -o nctst nctst.o > ../cxx/libnetcdf_c++.la ../libsrc/libnetcdf.la > libtool: link: g++ -g -O2 -o nctst nctst.o -Wl,-bind_at_load > ../cxx/.libs/libnetcdf_c++.a ../libsrc/.libs/libnetcdf.a > ld: warning: in ../libsrc/.libs/libnetcdf.a, file was built for unsupported > file format which is not the architecture being linked (x86_64) > Undefined symbols: > "_nc_put_vara_short", referenced from: > NcVar::put(short const*, long const*)in libnetcdf_c++.a(netcdf.o) > NcVar::put(short const*, long, long, long, long, long)in > libnetcdf_c++.a(netcdf.o) The specific problem is that the version of g++ you are using, /usr/bin/g++, compiles 64-bit code for the x86_64 platform, but you're linking against a 32-bit library for the 32-bit i386 platform. (You can check that is your platform by running the "arch" command.) If you only need the C and Fortran netCDF interfaces, there is no need to build the C++ netCDF API, becasue it's not used by any of the utilities or most of the third-party applications built on netCDF. So if you can get by without the C++ API, just invoke "make distclean" and rebuild, setting the CXX environment variable to '' first, to specify no C++ API is desired, then running the configure script and "make all check" and "sudo make install" again. If you really need the C++ interface, you might be able to rebuild with the environment variable CXXFLAGS="-m32" to specify that g++ should build 32-bit code, or alternatively by setting CXX="g++ -m32". You could also try the most recent release, 4.1.1, configuring with "--disable-netcdf-4 --disable-cxx" to indicate that you only want the netCDF-3 version and you don't want the C++ interface. --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: HAA-836654 Department: Support netCDF Priority: Normal Status: Closed