Building and Installing

Building and Installing the LDM-McIDAS decoders

If there is no binary distribution that will work on your machine, you will need to build the LDM-McIDAS decoders from source.

After you download the source distribution of the LDM-McIDAS package, you need to move it to a suitable location, compile, test, and install the software.

Table of Contents

Where to Install the Software

Like all Unidata packages, LDM-McIDAS is distributed as a separate package, and you can build and install it any place you like on the machine that is running the LDM so long as the user running the LDM has access to and execute privilege for its decoders.

Here are some guidelines for LDM-McIDAS:

If you follow these guidelines, your directory structure would look something like:

LDM-McIDAS built/installed in ldm account:

           |            |-util
           |            |
           |            |            |-bin-----
           |            |            |-doc-----
           |            |-ldm-5.2.x--|-include-
           |            |            |-lib-----
           |            |            |-man-----|-man1-
           |            |            |         |-man3-
           |-ldm--------|            |-src-----
           |            |
           |            |-lib        
           |            |-logs       
           |            |-man        
           |            |-runtime    
           |            |-src
           |            |
           |            |                  
           |            |                             |-bin-----
           |            |            |                |-lib-----
/usr/local-|            |-ldm-mcidas-|-ldm-mcidas-...-|
           |            |            |                |         |-decode--
           |            |                             |-src-----|-ingest--
           |            |                             |         |-libpng-
           |            |                             |         |-port----
           |            |                             |         |-tingest-
           |            |                             |         |-zlib----
           |            |                                       |
           |            |                                       |-include-
           |            |                                       |-man-----|-man1
           |            |                       
           |            |                       

LDM-McIDAS built/installed at the same level as the ldm account:

                        |            |-bin-----
                        |            |-doc-----
                        |            |-lib-----
                        |            |-man-----|-man1-
                        |            |         |-man3-
           |-ldm--------|            |-src-----
           |            |
           |            |-lib        
           |            |-logs       
           |            |-man        
           |            |-runtime    
           |            |-src
           |                             |-bin-----
           |                             |-lib-----
/usr/local-|            |                |
           |            |                |         |-decode--
           |                             |-src-----|-ingest--
           |                             |         |-libpng-
           |                             |         |-port----
           |                             |         |-tingest-
           |                             |         |-zlib----
           |                             |
           |                             |-include-
           |                             |-man-----|-man1

To build the source distribution or unpack the binary distribution in the ldm account, you would move the compressed tar file to the /usr/local/ldm/ldm-mcidas directory and uncompress and untar the file:

   <login as the user ldm>

   Type: mkdir ldm-mcidas
   Type: cd ldm-mcidas
   Type: mv <ldm-mcidas_download_directory>/ldm-mcidas-2004.tar.Z .
   Type: zcat ldm-mcidas-2004.tar.Z | tar xvf -

If you are working with a binary distribution, you can proceed to the Installing the Software section.

What to do Before Compiling

  1. Defining Environment Variables

    LDM-McIDAS uses the configure utility to create C header and compilation Makefile files. The packages that LDM-McIDAS decoders depend on are:

    • Unidata LDM
    • Unidata McIDAS-X
    • Unidata netCDF (bundled wth McIDAS-X)
    • zlib (bundled with LDM-McIDAS)
    • libpng (bundled with LDM-McIDAS)

    If both the LDM or McIDAS-X are installed in "standard" directories, configure will correctly guess values for needed, system-dependent environment variables. If those packages are not installed in "standard" directories, you will need to define environment variables that will tell configure where to find the packages.

    The easiest way to insure that configure will find all of the packages it needs is to define needed environment variables yourself. The full set of environment variables you may need to define to build LDM-MCIDAS are:

    Environment variable Use
    CC C compiler to use
    CFLAGS C compiler flags to use
    CPPFLAGS C preprocessor flags to use
    FC Fortran compiler to use
    FFLAGS Fortran compiler flags to use
    CPP_LDM Compile-time reference for LDM header files
    LD_LDM Link-time reference for LDM library
    CPP_MCIDAS Compile-time reference for McIDAS header files
    LD_MCIDAS Link-time reference for McIDAS library
    CPP_NETCDF Compile-time reference for netCDF header files
    LD_NETCDF Link-time reference for netCDF library
    LD_X11 Link-time reference for X11 library
    LD_MATH Link-time reference for math library

    Example environment variable settings for a Linux system:

    CPPFLAGS='-DNDEBUG -Df2cFortran'
    FFLAGS='-O -Wuninitialized -fno-automatic -ff90-intrinsics-hide'
    LD_LDM='-L/home/ldm/lib -lldm'
    LD_MCIDAS='-L/home/mcidas/lib -lmcidas'
    LD_NETCDF='-L/home/mcidas/lib -lnetcdf'
    LD_X11=-L/usr/X11R6/lib -lX11

    After defining the environment variables, you should go into the src directory of the LDM-McIDAS version you just unpacked:

       Type: cd ~ldm/ldm-mcidas/ldm-mcidas-200x/src

    and read the README and INSTALL files before proceeding. INSTALL provides additional information on running the configuration utility.

  2. Running configure

    The next step is to run the configure shell script located in the src directory of the LDM-McIDAS version tree:

       Type: ./confgure

Compiling the Software

Once configure has run, and assuming it ran with no errors, you use make to compile, test and install the LDM-McIDAS package.

There are 3 steps in the make process:

  1. creation of libraries and executables - where the source code is compiled and the libraries are created
  2. installation - where the binaries and libraries are moved to the directories you specified when you ran configure
  3. cleaning up - where the object files are deleted
To build, install, and then cleanup, you can type:

For `csh'-compatible shells:

    Type: make all install clean >&! ldm-mcidas.log &
    Type: tail -f ldm-mcidas.log

For POSIX.2-compatible shells (e.g `sh', `ksh', `bash:

    Type: make all install clean >ldm-mcidas.log 2>&1 &
    Type: tail -f ldm-mcidas.log

Following these examples, output from the make command will be sent to the file ldm-mcidas.log. The tail command allows you to view the output as it is sent to the log file. We recommend that you send the output to a log file. If there are problems, and you can't figure out what is wrong, you can mail the log file to <support-ldm-mcidas AT unidata.ucar.edu>.

Installing the Software

At this point, you could use the LDM-McIDAS decoders from the directory you just installed them in: ~ldm/ldm-mcidas/ldm-mcidas-200x/bin. We recommend, however, that you copy them to the either the ~ldm/decoders or ~ldm/util directory and use them from there. Which directory you copy them to will depend on which directory you have previously created and included in the PATH for the user running your LDM.

Since the most commonly used directory for LDM decoders is ~ldm/decoders, we recommend that copy them there:

   <while still logged in as 'ldm'>
   Type: cd ~ldm/ldm-mcidas/ldm-mcidas-200x/bin
   Type: chmod +x *
   Type: cp area2png ~ldm/decoders
   Type: cp nldn2md ~ldm/decoders
   Type: cp pnga2area ~ldm/decoders
   Type: cp pngg2gini ~ldm/decoders
   Type: cp proftomd ~ldm/decoders
   Type: cp zlibg2gini ~ldm/decoders

If this is a first-time installation for the LDM-McIDAS decoders on your system, also do the following (do not do this if you are upgrading):

   Type: cp batch.k ~ldm/decoders
   Type: cp uwgrid.sh ~ldm/decoders

Next, if you will be using pnga2area to decode MCIDAS and FNEXRAD datastream imagery into McIDAS usable formats, you will need to copy two files in the LDM-McIDAS etc to the ~ldm/etc directory:

   <while still logged in as 'ldm'>
   Type: cd ~ldm/ldm-mcidas/ldm-mcidas-200x/etc
   Type: cp SATANNOT ~ldm/etc
   Type: cp SATBAND ~ldm/etc

If you will be decoding FSL2 Wind Profiler and NLDN lightning data into McIDAS compatible data files, you must copy three files in the LDM-McIDAS etc to the to the directory where you want decoders for these data to write their output:

   <still logged in as 'ldm'>
   Type: cd ~ldm/ldm-mcidas/ldm-mcidas-200x/etc
   Type: chmod 664 ROUTE.SYS SYSKEY.TAB
   Type: chmod 666 SCHEMA
   Type: cp ROUTE.SYS ~ldm/data/mcidas
   Type: cp SYSKEY.TAB ~ldm/data/mcidas
   Type: cp SCHEMA ~ldm/data/mcidas

Diagnosing problems and other considerations

If an error occurs during the configure or make process, you can try to diagnose the problem by looking at the file config.status or by looking at the make log file.

If you are unable to figure out what is wrong, send a message to <support-ldm-mcidas AT unidata.ucar.edu>.
and include (if possible) the error message (ex: the output from the log file). A few of the common problems that occur and a brief description are listed below. A more complete listing of common problems (and solutions) can be found by searching the LDM-McIDAS email archive.

REMEMBER: You need to have the LDM, netCDF, and McIDAS-X libraries and include files installed on your system before you can build the LDM-McIDAS decoders.

[Go to Previous] [Go to Next]

Send questions/comments to <support-ldm-mcidas AT unidata.ucar.edu>.