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 Stefania, Sorry to have taken so long to respond to your question ... > I am trying to install netcdf on a Sun Sparc Solaris 10. > The command: > CC=gcc ./configure --disable-f90 > works well and provides the file log in attachment. The log shows several of the following errors in trying to compile a test C program and test Fortran program and trying to link them together, using g77 as the Fortran compiler: configure:24371: checking if Fortran "integer" is C "long" configure:24381: gcc -c -g -O2 conftest.c configure:24384: $? = 0 configure:24387: g77 -g -O2 -c conftestf.f configure:24390: $? = 0 configure:24393: g77 -o conftest -g -O2 conftestf.o conftest.o configure:24396: $? = 0 configure:24399: ./conftest ld.so.1: conftest: fatal: libg2c.so.0: open failed: No such file or directory ./configure: line 24400: 1388 Killed ./conftest configure:24402: $? = 137 configure:24415: result: no It looks like g77 could link the conftest program OK, but when it was run, it needed the shared library libg2c.so, which was not found. The libg2c library is a runtime library needed by programs linked by the g77 compiler, so the fact that it's missing means there's something wrong with your g77 installation. libg2c.so.0 should have been installed somewhere g77 could find it when g77 was installed. The newer GNU gfortran compiler doesn't require this runtime library, but would have to be used with a newer version 4.x gcc compiler. If you don't want the Fortran-77 netCDF interface, you could configure with --disable-fortran, but if you need the Fortran API, you'll need a working Fortran compiler ... You can also try building netCDF-3 by using the latest released version of netCDF (4.1.1) with --disable-netcdf-4, but you will still need a Fortran compiler to build and test the Fortran API. > When I try 'make check', I obtain this error message > > Making check in fortran > make[1]: Entering directory `/root/Desktop/netcdf-3.6.3/fortran' > echo '! NetCDF-3.' > netcdf.inc > cat ../fortran/netcdf3.inc >> netcdf.inc > echo >> netcdf.inc > echo '! NetCDF-2.' >> netcdf.inc > cat ../fortran/netcdf2.inc >> netcdf.inc > make check-am > make[2]: Entering directory `/root/Desktop/netcdf-3.6.3/fortran' > depbase=`echo fort-attio.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\ > /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H > -I. -I.. -I../libsrc -g -O2> -MT fort-attio.lo -MD -MP -MF > $depbase.Tpo -c -o fort-attio.lo> fort-attio.c &&\ > mv -f $depbase.Tpo $depbase.Plo > libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../libsrc -g -O2 > -MT fort-attio.lo -MD -MP > -MF .deps/fort-attio.Tpo -c fort-attio.c -o > fort-attio.o > In file included from fort-attio.c:7: > ncfortran.h:26:42: NF_INT_IS_C_... not defined: No such file or directory > fort-attio.c:13: error: syntax error before "NF_INTEGER" > fort-attio.c:13: error: syntax error before '*' token --Russ Russ Rew UCAR Unidata Program address@hidden http://www.unidata.ucar.edu Ticket Details =================== Ticket ID: PVH-773453 Department: Support netCDF Priority: Urgent Status: Closed