Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Next: , Previous: parallel, Up: Building on Unix


3.5 Running the configure Script

To create the Makefiles needed to build netCDF, you must run the provided configure script. Go to the top-level netCDF directory.

Decide where you want to install this package. Use this for the "–prefix=" argument to the configure script below. The default installation prefix is “/usr/local,” which will install the package's files in usr/local/bin, usr/local/lib, and usr/local/man. The default can be overridden with the –prefix argument to configure.

(Note that this is a new default location for version 3.6.2 of netCDF. Previous versions used the directory in which netCDF was built as the default install directory).

Here's how to execute the configure script with a different installation directory:

         ./configure --prefix=/whatever/you/decided --enable-netcdf-4 --with-hdf5=/home/ed/local

The above would cause the netCDF libraries to be installed in /whatever/you/decided/lib, the header files in /whatever/you/decided/include, the utilities (ncdump/ncgen) in /whatever/you/decided/bin, and the man pages in /whatever/you/decided/man.

The –enable-netcdf-4 option tells configure that you wish to build the netCDF-4/HDF5 features. The –with-hdf4= argument tells configure where HDF5 is installed. It must be version 1.8.0-beta2, and it must be built with zlib, version 1.2.3.

There are other options for the configure script. The most useful ones are listed below. Use the –help option to get the full list.

--prefix
Specify the directory under which netCDF will be installed. Subdirectories lib, bin, include, and man will be created there, if they don't already exist.
--enable-netcdf-4
Turn on netCDF-4 features.
--with-hdf5=/location
Specify the location of the HDF5 library.
--with-zlib=/location
Specify the location of the zlib library. NetCDF-4 requires that HDF5 be built with zlib, for variable compression.
--with-szlib=/location
Specify the location of the szlib (a.k.a. szip) library. This is optional, and netCDF-4 does not make use of the szlib, due to licence issues. However, if HDF5 is build with szlib, then you must provide the location of szlib when building netCDF-4.
--enable-shared
Build shared libraries (as well as static) on platforms which support them.
--enable-docs-install
By default, the netCDF distribution will install man pages, but not any other documentation.

The latest documentation is available on-line at the the netCDF website. http://www.unidata.ucar.edu/netcdf. However, for users who cannot always reach the web, all netCDF documentation is included in the distribution in the “man” subdirectory, in PDF, HTML, postscript, info, ASCII text, and other formats.

Using the –enable-docs-install causes “make install” to install the netCDF documentation under $(prefix)/doc/netcdf-4.0.1.

–enable-docs-install does not cause the documentation to be built from source; it causes the documentation which was shipped with the distribution to be installed.

Users who wish to contribute to the documentation development are urged to make any suggested changes to the documentation source files, which have the .texi filename extension (netcdf.text, netcdf-c.texi, etc.). Building the netCDF documentation from source requires recent versions of the open-source tools sed, m4, texinfo, and tex.

--disable-largefile
This omits OS support for large files (i.e. files larger than 2 GB).
--disable-f77
This turns off building of the F77 and F90 APIs. (The F90 API cannot be built without the F77 API). This also disables some of the configure tests that relate to fortran, including the test of the F90 compiler. Setting the environment variables FC or F77 to NULL will have the same effect as –disable-f77.
--disable-f90
This turns off the building of the F90 API. Setting the environment variable F90 to null for configure will have the same effect.
--disable-cxx
This turns off the building of the C++ API. Setting the environment variable CXX to null for configure will have the same effect.
--disable-v2
This turns of the V2 API. The V2 API is completely replaced with the V3 API, but is usually built with netCDF for backwards compatibility, and also because the C++ API depends on the V2 API. Setting this has the effect of automatically turning off the CXX API, as if –disable-cxx had also been specified.
--enable-cxx4
Turns on the new C++ API, which is currently under development, and will expose the full expanded model in the C++ API. The cxx4 API is experiemental, unfinished, and untested. It is provided for experiemental purposes only.
--enable-large-file-tests
Turn on tests for large files. These tests create files over 2 GB in size, and need about 13 GB of free disk space to run. These files are deleted after the test successfully completes. They will be created in the netCDF nc_test directory, unless the –with-temp-large option is used to specify another location (see below).
--with-temp-large
Normally large files are not created during the netCDF build, but they will be if –enable-large-file-tests is specified (see above). In that case, this configure parameter can be used to specify a location to create these large files, for example: –with-large-files=/tmp/ed.
--enable-benchmarks
Turn on tests of the speed of various netCDF operations. Some of these operations take a long time to run (minutes, on a reasonable workstation).
--enable-valgrind-tests
Causes some tests to be re-run under valgrind, the memory testing tool. Valgrind must be present for this to work.
--disable-fortran-compiler-check
Normally the netCDF configure checks the F77 and F90 compilers with small test programs to see if they work. This is very helpful in supporting netCDF installations on different machines, but won't work with cross-compilation. Use the –disable-fortran-compiler-check to turn off the fortran compiler tests, and just assume that the compilers will work.
--disable-fortran-type-check
The netCDF configure compiles and runs some programs to test fortran vs. C type sizes. Setting this option turns off those test, and uses a set of default values (which can be overridden by environment variables see Environment).
--disable-compiler-recover
Normally, if the netCDF configure finds a F90 compiler, and it fails to build the test program described in –disable-f90-check, it will print a warning, and then continue to build without the F90 API, as if the user has specified –disable-f90. With the –disable-compiler-recover option set, it will not continue, but will just stop if the fortran 90 compiler doesn't work. This is useful for automatic testing, where we want the tests to fail if something causes the fortran compiler to break.
--disable-examples
Starting with version 3.6.2, netCDF comes with some examples in the “examples” directory. By default, the examples are all built during a “make check” unless the –disable-examples option is provided.
--enable-separate-fortran
This will cause the Fortran 77 and Fortran 90 APIs to be built into their own separate library, instead of being included in the C library. This is useful for supporting more than one fortran compiler with the same netCDF C library. This is turned on by default for shared library builds.
--enable-extra-tests
During the beta release phase, this option may turn on tests which are known to fail (i.e. bugs that we are currently working to fix).
--enable-dap
Enable DAP support. The configure script will attempt to locate a usable curl library, but if it fails, then it is necessary to specify their location using –with-curl=/some/path. It is assumed that the directories /some/path/include and /some/path/lib exist. This feature is currently provided for experimental purposes until more detailed testing is accomplished. Note that when DAP is enabled, this can be tested for in a configure script by looking for the function “nc__opendap”.
--enable-dap-remote-tests
If DAP support is enabled, it is possible to also enable extra dap tests that utilize an external server at opendap.org. Since that server may be inaccessible for a variety of reasons, it is only used if this flag is enabled.
--enable-ncgen4
Turns on the build of a version of ncgen, called ncgen4, that can process CDL files using the netcdf-4 data model. It is currently provided for experimental purposes only. All comments in this document about ncgen will also apply to ncgen4. If compiled with the –enable-netcdf-4 option, its full range of functionality is available. If compiled without the –enable-netcdf-4 option, its functionality is limited to more-or-less that of the existing ncgen utility, except that FORTRAN output is not supported.

The configure script will examine your computer system – checking for attributes that are relevant to building the netCDF package. It will print to standard output the checks that it makes and the results that it finds.

The configure script will also create the file "config.log", which will contain error messages from the utilities that the configure script uses in examining the attributes of your system. Because such an examination can result in errors, it is expected that "config.log" will contain error messages. Therefore, such messages do not necessarily indicate a problem (a better indicator would be failure of the subsequent "make"). One exception, however, is an error message in "config.log" that indicates that a compiler could not be started. This indicates a severe problem in your compilation environment – one that you must fix.
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690