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

LDM Source-Code Installation

Steps:

  1. Become the LDM user
  2. Obtain the distribution
  3. Unpack the distribution
  4. Build and install the distribution
  5. Vet the ldmadmin configuration-file
  6. Create the appropriate subdirectory structure only if you do not already have an LDM installation

Become the LDM User

Follow this advice on becoming the LDM user.

Workshop-specific instructions.


Obtain the LDM Source-Distribution

The LDM source-distribution can be obtained by clicking on the appropriate link in the LDM download page. Download the file into the LDM user's home directory.

The remaining instructions assume that the distribution was downloaded into the LDM user's home-directory.


Unpack the Distribution

Unpack the distribution in the LDM user's home directory using the gunzip(1) and tar(1) utilities. For example:

cd                                     # go to the LDM user's home-directory
gunzip -c ldm-6.7.0.tar.gz | tar xvf - # unpack the distribution
The name of the subdirectory will contain the version identifier of the just-unpacked package (e.g., ldm-6.7.0). For the meaning of the version identifier, see The LDM Version Identifier.

Assign the pathname of the version subdirectory to the shell variable VDIR, e.g.,

VDIR=ldm-6.7.0
This will be useful later.

Build and Install the Distribution

  1. Go to the top-level source-directory of the just-unpacked package:

    cd $HOME/$VDIR/src
    

  2. If you need to clean-up from a previous build attempt, then use the make(1) utility to return the distribution to a pristine state:

    make distclean
    
    Don't worry if this command fails or even fails to execute.
  3. (Optional) If necessary, override the default values for certain build-configuration parameters by setting the associated environment variables. The environment variables that you may set include the following:

    Variable Meaning Example Value
    CC C compiler /usr/gnu/bin/gcc
    CPPFLAGS C preprocessor options -DNDEBUG
    CFLAGS C compiler options -O3
    LIBS Libraries to use -lrpcsoc
    Normally, this step should not be necessary.

    How to set an environment variable depends on your user-shell. For example:

    User Shell Example
    Standard UNIX® (e.g. sh, ksh, bash) export CC=/usr/gnu/bin/gcc
    csh-like (e.g. csh, tcsh) setenv CC /usr/gnu/bin/gcc

    NOTE: Because of the following step, you should unset all of the above environment variables that you don't explicitly use. In particular, you should probably not set any of the above environment variables in your shell's profile-file.

  4. Decide if the LDM system needs to support a small product-queue from a previous installation. By default, the build procedure will create an LDM system that supports a 64-bit product-queue, which can be up to (2^64)-1 bytes in size (if that is possible on your computer system). This aspect of the LDM is different from version 6.1 (and earlier versions) which required manual modification of the build procedure in order to support a large product-queue. It could be, however, that you wish to continue to use the 32-bit product-queue created by a 6.1 (or earlier) version of the LDM, in which case, you should specify the option --disable-max-size when executing the configure script. This will result in an LDM system that will continue to work with the previously-existing product-queue.

    Step 7, below, contains related information.

  5. Run the configure script. You may use the following options, when and if appropriate:

    --disable-max-size
    Disables any attempt to maximize the size of the programming-environment. Use of this option depends on your decision from the previous step and whether or not it's necessary given your platform and C compiler. The default is to try to maximize the integer, long, pointer and off_t programming-environment in order to support large product-queues.

    --enable-logging=localn
    Configures the LDM to use the localn facility for logging messages. If you have a previous LDM installation, then you should use the same facility. The default is to use the local0 facility.

    Redirect both standard output and standard error to the file configure.log. The relevant command depends on your user-shell. For example:

    User Shell Example
    Standard UNIX® (e.g. sh, ksh, bash) ./configure ... >configure.log 2>&1
    csh-like (e.g. csh, tcsh) ./configure  ... >&! configure.log
    This step customizes the installation process for your particular system.
  6. Inspect the file configure.log to verify the configuration process. If an error occurred, then the reason for the error can often be found in the file config.log (note the slightly different name).

    If you email the UPC because of a problem with this step, be sure to enclose the files configure.log and config.log.

  7. Use the make(1) utility appropriate for your system to build the package, redirecting both standard output and standard error to the file make.log. The relevant command depends on your user shell. For example:

    User Shell Command
    Standard UNIX® (e.g. sh, ksh, bash) make >make.log 2>&1
    csh-like (e.g. csh, tcsh) make >&! make.log
    This step creates the package libraries and programs but doesn't install them.

    Inspect the file make.log to verify the build process. If something went wrong that you think might be fixed by setting an environment variable (such as using the cc compiler rather than the c89 compiler) then return to the clean-up step above.

    If you email the UPC because of a problem with this step, be sure to enclose the files configure.log, config.log, and make.log.

  8. (Optional) If you decided that the just-built LDM system should work with the previous product-queue from a version 6.1 (or earlier) LDM, then verify that it does so by executing the command

    pqcheck/pqcheck
    
    If this indicates that the product-queue is invalid, then you must either rebuild this package -- starting with the clean-up step above -- and specify the --disable-max-size option to the configure script when it is executed, or you will have to remove the previous product-queue and create a new, empty one using the programs of this package before starting the new LDM.
  9. Use the make utility appropriate for your system to install the package components, redirecting both standard output and standard error to the file install.log. The relevant command depends on your user shell. For example:

    User Shell Command
    Standard UNIX® (e.g. sh, ksh, bash) make install >install.log 2>&1
    csh-like (e.g. csh, tcsh) make install >&! install.log

    Inspect the file install.log to verify the installation process. Ignore all errors that make, itself, ignores.

    If you email the UPC because of a problem with this step, be sure to enclose the file install.log.

  10. Install some components with superuser privileges:

    su root -c 'make install_setuids'
    
    Note that you need the superuser's password to accomplish this step.

    This step is necessary for the LDM server to listen on port 388 (which is a restricted port) and for the hupsyslog(1) utility to notify the syslogd(8) daemon when a new log-file has been created.

  11. Use the make(1) utility to clean-up after yourself.

    make clean
    

Workshop-specific instructions.


Vet the ldmadmin configuration-file

Follow these instructions on vetting the ldmadmin configuration-file.


Create the appropriate subdirectory structure

You may skip this step if you already have an LDM installation (because you are upgrading your LDM, for example) because the directories should already exist.

Create subdirectories for data-files and LDM logfiles

If you back-up users' home-directories:

The LDM's product-queue must be on a locally-mounted disk, and it is highly recommended that locally-decoded and stored data also be written to locally-mounted disk(s). Also, because data-files and LDM logfiles are extremely volatile, they should probably not be automatically backed-up on a regular basis. For these reasons, we strongly recommend that the directories containing the LDM logfiles and decoded data-files be on locally-mounted but not automatically backed-up disk(s).

If you routinely back-up users' home-directories, then the LDM's log and data directories should not reside under the LDM user's home-directory but should, instead, be on other local, but not backed-up disk(s) (e.g., /var/data). In this case, you must create the data and log directories (possibly as root) and ensure that they can be managed by the LDM user and the LDM user's group. For example:

su                                    # become root
cd /var/data                          # go to a non-backed-up directory
mkdir ldm ldm/data ldm/logs           # create the subdirectories
chmod -R g+w ldm                      # set group write permission
chown -R ldm:groupId ldm            # set group to LDM user's group
exit                                  # become LDM user
cd                                    # go to home-directory
ln -s /var/data/ldm/data .            # symbolic-link to data directory
ln -s /var/data/ldm/logs .            # symbolic-link to logging directory

If you don't back-up users' home-directories:

If you don't routinely back-up users' home-directories, then you may simply create the necessary directories in the LDM user's home-directory. For example:

cd                                   # go to home-directory
mkdir data logs                      # create data and logging subdirectories

Workshop-specific instructions.

Create symbolic-link subdirectories

The symbolic-link subdirectories allow for easy switching between different versions of an LDM installation. Each symbolic-link subdirectory goes through a "runtime" symbolic-link, which, in turn, references the currently-active LDM installation.

Execute the following commands:

cd                         # go to the LDM user's home-directory
ln -s $VDIR runtime        # create the "runtime" symbolic-link
ln -s runtime/* .          # create the individual links through "runtime"

The directory structure should now look something like this (your data and logs "directories" might be different):

ls -lF
... bin -> runtime/bin/
... data -> /var/data/ldm/data/
... etc/
... include -> runtime/include/
... ldm-6.7.0/
... lib -> runtime/lib/
... logs -> /var/data/ldm/logs/
... man -> runtime/man/
... runtime -> ldm-6.7.0/
... src -> runtime/src/
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of 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