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:

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:

    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 the following:

            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 the following:


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 the following:

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>.

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 the 'ldm' user, type the following:

      cd ~ldm/ldm-mcidas/ldm-mcidas-200x/bin
      chmod +x *
      cp area2png ~ldm/decoders
      cp nldn2md ~ldm/decoders
      cp pnga2area ~ldm/decoders
      cp pngg2gini ~ldm/decoders
      cp proftomd ~ldm/decoders
      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 the following:

      cp batch.k ~ldm/decoders
      cp ~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 the 'ldm' user, type the following:

      cd ~ldm/ldm-mcidas/ldm-mcidas-200x/etc
      cp SATANNOT ~ldm/etc
      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. While still logged in as the 'ldm' user, type the following:

      cd ~ldm/ldm-mcidas/ldm-mcidas-200x/etc
      chmod 664 ROUTE.SYS SYSKEY.TAB
      chmod 666 SCHEMA
      cp ROUTE.SYS ~ldm/data/mcidas
      cp SYSKEY.TAB ~ldm/data/mcidas
      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> 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.

[Previous: Download] [Next: Using the Decoders]