Next: , Previous: The Usual Build Problems, Up: If Something Goes Wrong


5.2 Troubleshooting

5.2.1 Problems During Configuration

If the ./configure; make check fails, it's a good idea to turn off the C++ and Fortran interfaces, and try to build the C interface alone. All other interfaces depend on the C interface, so nothing else will work until the C interface works. To turn off C++ and Fortran, set environment variables CXX and FC to NULL before running the netCDF configure script (with csh: setenv FC ”;setenv CXX ”).

Turning off the Fortran and C++ interfaces results in a much shorter build and test cycle, which is useful for debugging problems.

If the netCDF configure fails, most likely the problem is with your development environment. The configure script looks through your path to find all the tools it needs to build netCDF, including C compiler and linker, the ar, ranlib, and others. The configure script will tell you what tools it found, and where they are on your system. Here's part of configure's output on a Linux machine:

     checking CPPFLAGS...  -Df2cFortran
     checking CC CFLAGS... cc -g
     checking which cc... /usr/bin/cc
     checking CXX... c++
     checking CXXFLAGS... -g -O2
     checking which c++... /usr/local/bin/c++
     checking FC... f77
     checking FFLAGS...
     checking which f77... /usr/bin/f77
     checking F90... unset
     checking AR... ar
     checking ARFLAGS... cru
     checking which ar... /usr/bin/ar
     checking NM... nm
     checking NMFLAGS...
     checking which nm... /usr/bin/nm

Make sure that the tools, directories, and flags are set to reasonable values, and compatible tools. For example the GNU tools may not inter-operate well with vendor tools. If you're using a vendor compiler, use the ar, nm, and ranlib that the vendor supplied.

As configure runs, it creates a config.log file. If configure crashes, do a text search of config.log for thing it was checking before crashing. If you have a licensing or tool compatibility problem, it will be obvious in config.log.

5.2.2 Problems During Compilation

If the configure script runs, but the compile step doesn't work, or the tests don't complete successfully, the problem is probably in your CFLAGS or CPPFLAGS.

5.2.3 Problems During Testing

If you are planning on using large files (i.e. > 2 GiB), then make sure you run “make extra_check to ensure that large files work on your system. Run this in addition to “make check.

If any of the tests in “make extra_check fail, before reporting a problem, run “make slow_check” to run additional large file tests, including one that will check your file system for large files.