|
|
|||
|
||||
Next: 64 Bit, Previous: Requirements, Up: Building on Unix
The netCDF configure script will set some environment variables that are important for building from source code. It is only necessary to set them to override default behavior.
The netCDF configure script searches your path to find the compilers and tools it needed. To use compilers that can't be found in your path, set their environment variables.
When finding compilers, vendor compilers will be preferred to GNU compilers. Not because we don't like GNU, but because we assume if you purchased a compiler, you want to use it. Setting CC allows you to over-ride this preference. (Alternatively, you could temporarily remove the compiler's directories from your PATH.)
For example, on an AIX system, configure will first search for xlc, the AIX compiler. If not found, it will try gcc, the GNU compiler. To override this behavior, set CC to gcc (in sh: export CC=gcc). (But don't forget to also set CXX to g++, or else configure will try and use xlC, the AIX C++ compiler to build the netCDF C++ API.)
By default, the netCDF library is built with assertions turned on. If you wish to turn off assertions, set CPPFLAGS to -DNDEBUG (csh ex: setenv CPPFLAGS -DNDEBUG).
If GNU compilers are used, the configure script sets CPPFLAGS to “-g -O2”. If this is not desired, set CPPFLAGS to nothing, or to whatever other value you wish to use, before running configure.
| CC | C compiler | If you don't specify this, the configure script will try to
find a suitable C compiler such as cc, c89, xlc, or gcc.
|
| FC | Fortran compiler (if any) | If you don't specify this, the configure script will try to find a
suitable Fortran 90 or Fortran 77 compiler. Set FC to "" explicitly,
or provide the –disable-f77 option to configure, if no Fortran
interface is desired.
|
| F90 | Fortran 90 compiler (if any) | If you don't specify this, the configure script will try to find a
suitable Fortran 90 compiler. Not needed if FC specifies a Fortran 90
compiler. Set F90 to "" explicitly, or use the –disable-f90 option to
configure, if no Fortran 90 interface is desired. For a vendor F90
compiler, make sure you're using the same vendor's F77 compiler. Using
Fortran compilers from different vendors, or mixing vendor compilers
with g77, the GNU F77 compiler, is not supported and may not work.
|
| CXX | C++ compiler | If you don't specify this, the configure script will try to find a
suitable C++ compiler. Set CXX to "" explicitly, or use the
–disable-cxx configure option, if no C++ interface is desired. If
using a vendor C++ compiler, use that vendor's C compiler to compile
the C interface. Using different vendor compilers for C and C++ may
not work.
|
| CFLAGS | C compiler flags | "-O" or "-g", for example. If you don't set this, configure may
set it based on your platform's needs (unless you have used the
–disable-flag-setting option is used with configure).
|
| CPPFLAGS | C preprocessor options | "-DNDEBUG" to omit assertion checks, for example. If you don't
set this, configure may set it based on your platform's needs (unless
you have used the –disable-flag-setting option is used with
configure).
|
| FCFLAGS | Fortran compiler flags | "-O" or "-g", for example. These flags will be used for both
fortran 77 and fortran 90. If you need to set these separately, use
FFLAGS for Fortran 77 and F90FLAGS for Fortran 90. If you don't set
the FCFLAGS variable configure may set it based on your platform's
needs (unless you have used the –disable-flag-setting option is used
with configure).
|
| FFLAGS | Fortran 77 compiler flags | "-O" or "-g", for example. If you are passing the same arguments
to the Fortran 90 and Fortran 77 builds, use the FCFLAGS instead. If
you don't set this, configure may set it based on your platform's
needs (unless you have used the –disable-flag-setting option is used
with configure).
|
| F90FLAGS | Fortran 90 compiler flags | "-O" or "-g", for example. If you are passing the same arguments
to the Fortran 90 and Fortran 77 builds, use the FCFLAGS
instead. Configure may set this based on your platform's needs (unless
you have used the –disable-flag-setting option is used with
configure).
|
| CXXFLAGS | C++ compiler flags | "-O" or "-g", for example. If you don't set this, configure may
set it based on your platform's needs (unless you have used the
–disable-flag-setting option is used with configure).
|
| ARFLAGS, NMFLAGS, FPP, M4FLAGS, LIBS, FLIBS, FLDFLAGS | Miscellaneous | One or more of these were needed for some platforms, as specified
below. Unless specified, you should not set these environment
variables, because that may interfere with the configure script.
|
| HDF5DIR | configure option | Set this to the directory you wish to specify in the –with-hdf5
argument of configure.
|
The section marked Tested Systems below contains a list of systems on which we have built this package, the environment variable settings we used, and additional commentary.
| Contact Us Site Map Search Terms and Conditions Privacy Policy Participation Policy | ||||||
|
||||||