Installing The EMAPF Functions

The EMAPF functions are an extension of the Cmapf functions to accommodate Ellipsoidal Geoids. The Cmapf functions are a library of functions which process geographic and dynamic data between grids and geographical coordinates on a family of conformal map projections. The CMAPF functions assume a spherical shape to the Earth, and map this shape onto Lambert Conformal, Polar Stereographic or Mercator Projections. The EMAPF functions do the same to an ellipsoidal shape for the Earth, which may be chosen from a collection of geoids that have been used for the Earth, including WGS84 currently used by the United States, or the user may specify his own ellipsoidal shape.

The emapf functions are distributed as emapf.tar.gz, which may be expanded, configured, and compiled under Unix, Linux and cygwin.

After configuration and compilation, a library of functions or subroutines is created for use by the user’s own programs. Either a FORTRAN-compatible library, a C-compatible library, or both types of library can be created.

To compile and install libraries:

  • First, decompress the source code. select a directory to uncompress the source code (e.g. /usr/local/source) and copy emapf.tar.gzthere. run the command
    gunzip -c ./emapf.tar.gz | tar -xvf -

    This will create a sub-directory emapf.

  • Second, change to the sub-directory
    cd emapf
  • Third, configure the system:

    If a fortran-compatible library is desired, use

    ./configure --with-fortcalls

    In either case, a Makefile will be generated.

  • Compile the library with
  • If the compilation runs error-free, install the library with
    make install

    If a C-compatible library was chosen at ./configure time, the library libemapf.a will be installed in /usr/local/lib and the include file emapf.h is /usr/local/include. If a FORTRAN-compatible library was chosen at ./configure –with-fortcalls time, the library libemapfF.a will be installed in /usr/local/lib.

  • If a localtion other than /usr/local is desired, add the parameter –prefix=/desired/location to the ./configure command:
    ./configure --prefix=/home/emapfsite


    ./configure --with-fortcalls --prefix=/home/emapfsite
  • If both libraries are to be installed, simply configure, make and install one at a time, clearing the source directory between stages:
    make install
    make distclean
    ./configure --with-fortcalls
    make install