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.
Tim, > I currently build netcdf 3.5.0 with the following environment variables > @if [ $(MACHINE_TYPE) = LINUX ] ; then \ > export CC=/usr/bin/gcc ; \ > export CXX=/usr/bin/g++ ; \ > export FC='' ; \ > > I don't need fortran (which both the environment variables you mentioned > seem to refer to). I don't need C++ either, so I just tried > export CXX='' ; \ OK, I'm also using CC=/usr/bin/gcc FC='' CXX='' as the only relevant exported environment variables. > and got a message that C++ would not be built, and then got the __ctype_b > error > again. Below is the relevant error report. The problem seems to be a > linking issue. > > Configuring netCDF (Network Common Data Format)... > configure: warning: Empty CXX variable > configure: warning: The C++ interface will not be built > configure: warning: Fortran-77 compiler is explicitly null > configure: warning: The Fortran-77 interface will not be built > configure: warning: Could not find working Fortran-90 compiler > configure: warning: The Fortran-90 interface will not be built > Making netCDF... > make[1]: Entering directory `/home/dowling/epic/netcdf/netcdf-3.5.0/src' > make[2]: Entering directory `/home/dowling/epic/netcdf/netcdf-3.5.0/src' > > Making `all' in directory /home/dowling/epic/netcdf/src/libsrc > > make[3]: Entering directory > `/home/dowling/epic/netcdf/netcdf-3.5.0/src/libsrc' > /usr/bin/gcc -c -O -I. -DNDEBUG attr.c > /usr/bin/gcc -c -O -I. -DNDEBUG dim.c > /usr/bin/gcc -c -O -I. -DNDEBUG error.c > /usr/bin/gcc -c -O -I. -DNDEBUG -DVERSION=`cat ../VERSION` libvers.c > /usr/bin/gcc -c -O -I. -DNDEBUG nc.c > /usr/bin/gcc -c -O -I. -DNDEBUG ncio.c > /usr/bin/gcc -c -O -I. -DNDEBUG ncx.c > /usr/bin/gcc -c -O -I. -DNDEBUG putget.c > /usr/bin/gcc -c -O -I. -DNDEBUG string.c > /usr/bin/gcc -c -O -I. -DNDEBUG v1hpg.c > /usr/bin/gcc -c -O -I. -DNDEBUG v2i.c > /usr/bin/gcc -c -O -I. -DNDEBUG var.c > ar cru libnetcdf.a attr.o dim.o error.o libvers.o nc.o ncio.o ncx.o putget.o > string.o v1hpg.o v2i.o var.o > ranlib libnetcdf.a > make[3]: Leaving directory `/home/dowling/epic/netcdf/netcdf-3.5.0/src/libsrc' > > Returning to directory /home/dowling/epic/netcdf/src > > make[2]: Leaving directory `/home/dowling/epic/netcdf/netcdf-3.5.0/src' > Not making `fortran/all' because no FORTRAN compiler > Not making `f90/all' because no FORTRAN-90 compiler > make[2]: Entering directory `/home/dowling/epic/netcdf/netcdf-3.5.0/src' > > Making `all' in directory /home/dowling/epic/netcdf/src/ncdump > > make[3]: Entering directory > `/home/dowling/epic/netcdf/netcdf-3.5.0/src/ncdump' > /usr/bin/gcc -c -O -I../libsrc -DNDEBUG ncdump.c > /usr/bin/gcc -c -O -I../libsrc -DNDEBUG vardata.c > /usr/bin/gcc -c -O -I../libsrc -DNDEBUG dumplib.c > /usr/bin/gcc -o ncdump -O ncdump.o vardata.o dumplib.o ../libsrc/libnetcdf.a > make[3]: Leaving directory `/home/dowling/epic/netcdf/netcdf-3.5.0/src/ncdump' > > Returning to directory /home/dowling/epic/netcdf/src > > make[2]: Leaving directory `/home/dowling/epic/netcdf/netcdf-3.5.0/src' > make[2]: Entering directory `/home/dowling/epic/netcdf/netcdf-3.5.0/src' > > Making `all' in directory /home/dowling/epic/netcdf/src/ncgen > > make[3]: Entering directory `/home/dowling/epic/netcdf/netcdf-3.5.0/src/ncgen' > /usr/bin/gcc -c -O -I../libsrc -I. -DNDEBUG main.c > /usr/bin/gcc -c -O -I../libsrc -I. -DNDEBUG load.c > /usr/bin/gcc -c -O -I../libsrc -I. -DNDEBUG ncgentab.c > /usr/bin/gcc -c -O -I../libsrc -I. -DNDEBUG escapes.c > /usr/bin/gcc -c -O -I../libsrc -I. -DNDEBUG getfill.c > /usr/bin/gcc -c -O -I../libsrc -I. -DNDEBUG init.c > /usr/bin/gcc -c -O -I../libsrc -I. -DNDEBUG genlib.c > /usr/bin/gcc -o ncgen -O main.o load.o ncgentab.o escapes.o getfill.o init.o > genlib.o ../libsrc/libnetcdf.a > make[3]: Leaving directory `/home/dowling/epic/netcdf/netcdf-3.5.0/src/ncgen' > > Returning to directory /home/dowling/epic/netcdf/src > > make[2]: Leaving directory `/home/dowling/epic/netcdf/netcdf-3.5.0/src' > Not making `cxx/all' because no C++ compiler OK, after setting the same environment variables and running configure and "make all", everything I get matches what you got to this point, disregarding the different directory names where you are building. But the above "Not making `cxx/all' because no C++ compiler" is the last line I see from "make all". After this I ran "make test" and the output all looked fine, with no linking errors. Is the linking error you see in the next few lines still from running "make all", or is this output from running "make all test" or ... ? > make[1]: Leaving directory `/home/dowling/epic/netcdf/netcdf-3.5.0/src' > ... > /home/dowling/epic/netcdf/lib/libnetcdf.a(string.o)(.text+0x37): In function > `NC_check_name': > : undefined reference to `__ctype_b' > collect2: ld returned 1 exit status > make[1]: *** [initial] Error 1 > make[1]: Leaving directory `/home/dowling/epic/src/single' > make: *** [all] Error 2 > > > > > My version of gcc is: > > c41%gcc -v > Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man > --infodir=/usr/share/info --enable-shared > --enable-threads=posix --disable-checking --with-system-zlib > --enable-__cxa_atexit --host=i386-redhat-linux > Thread model: posix > gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) And my version is: $ gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) which looks identical. Here's the output from "uname -a" on my RH 9.0: $ uname -a Linux sherman.unidata.ucar.edu 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux So I still can't duplicate the problem, but maybe this will get you closer to pointing me at it ... --Russ