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.

Frequently shared libraries are a rich source of problems. If your build is not working, and you are using the –enable-shared option to generate shared libraries, then try to build without –enable-shared, and see if the static library build works.

5.2.3 Problems During Testing

If you are planning on using large files (i.e. > 2 GiB), then you may wish to rerun configure with –enable-large-file-tests to ensure that large files work on your system.