Next: , Previous: If Something Goes Wrong, Up: If Something Goes Wrong


5.1 The Usual Build Problems

5.1.1 Taking the Easy Way Out

Why not take the easy way out if you can?

Pre-compiled binaries for many platforms can be found at http://www.unidata.ucar.edu/software/netcdf/binaries.html. Click on your platform, and copy the files from the bin, include, lib, and man directories into your own local equivalents (Perhaps /usr/local/bin, /usr/local/include, etc.).

5.1.2 How to Clean Up the Mess from a Failed Build

If you are trying to get the configure or build to work, make sure you start with a clean distribution for each attempt. If netCDF failed in the “make” you must clean up the mess before trying again. To clean up the distribution:

     make distclean

5.1.3 Platforms On Which NetCDF is Known to Work

At NetCDF World Headquarters (in sunny Boulder, Colorado), as part of the wonderful Unidata organization, we have a wide variety of computers, operating systems, and compilers. At night, house elves test netCDF on all these systems.

Output for the netCDF test platforms can be found at http://www.unidata.ucar.edu/software/netcdf/builds.

Compare the output of your build attempt with ours. Are you using the same compiler? The same flags? Look for the configure output that lists the settings of CC, FC, CXX, CFLAGS, etc.

On some systems you have to set environment variables to get the configure and build to work.

For example, for a 64-bit IRIX install of the netCDF-3.6.2 release, the variables are set before netCDF is configured or built. In this case we set CFLAGS, CXXFLAGS, and FFLAGS. (This can also be accomplished automatically by using –enable-64bit with configure.)

     flip% uname -a
     IRIX64 flip 6.5 07080050 IP30 mips
     flip% setenv CFLAGS -64
     flip% setenv CXXFLAGS -64
     flip% setenv FFLAGS -64
     flip% make distclean;./configure;make check

5.1.4 Platforms On Which NetCDF is Reported to Work

If your platform isn't listed on the successful build page, see if another friendly netCDF user has sent in values for environment variables that are reported to work: (http://www.unidata.ucar.edu/software/netcdf/other-builds.html).

If you build on a system that we don't have at Unidata (particularly if it's something interesting and exotic), please send us the settings that work (and the entire build output would be nice too). Send them to support@unidata.ucar.edu.

5.1.5 If You Have a Broken Compiler

For netCDF to build correctly, you must be able to compile C from your environment, and, optionally, Fortran 77, Fortran 90, and C++. If C doesn't work, netCDF can't compile.

What breaks a C compiler? Installation or upgrade mistakes when the C compiler was installed, or multiple versions or compilers installed on top of each other. Commercial compilers frequently require some environment variables to be set, and some directories to appear ahead of others in your path. Finally, if you have an expired or broken license, your C complier won't work.

If you have a broken C compiler and a working C compiler in your PATH, netCDF might only find the broken one. You can fix this by explicitly setting the CC environmental variable to a working C compiler, and then trying to build netCDF again. (Don't forget to do a “make distclean” first!)

If you can't build a C program, you can't build netCDF. Sorry, but that's just the way it goes. (You can get the GNU C compiler - search the web for “gcc”).

If netCDF finds a broken Fortran 90, Fortran 77, or C++ compiler, it will report the problem during the configure, and then drop the associated API. For example, if the C++ compiler can't compile a very simple test program, it will drop the C++ interface. If you really want the C++ API, set the CXX environment variable to a working C++ compiler.

5.1.6 What to Do If NetCDF Still Won't Build

If none of the above help, try our troubleshooting section: See Troubleshooting.

Also check to see of your problem has already been solved by someone else (see Finding Help).

If you still can't get netCDF to build, report your problem to Unidata, but please make sure you submit all the information we need to help (see Reporting Problems).