  $Id: INSTALL,v 1.12.6.1 2003/07/28 17:14:12 edavis Exp $

INSTALL
DODS, version 3.4

Building and installing the DODS software you have downloaded from
source distributions

---------------------------------------------------------------------------

1. Downloading and unpacking DODS software
2. Building and installing DODS software
3. Requirements
4. Suggestions
5. Notes

---------------------------------------------------------------------------

1. Downloading and unpacking DODS software
------------------------------------------

  The DODS source distributions are available from

  ftp://ftp.unidata.ucar.edu/pub/dods/

  Go to the directory for the version of code you are interested in
  downloading, e.g., DODS-3.4/RC2/. Download the tar files for the
  components you desire (see the README file in this directory for
  information on what distribution files are required).

  Decide on a directory in which to build the DODS software and unpack
  the source distribution tar file(s) there. E.g.:

    gzip -d -c DODS-idl-cmdln-<ver>.tar.gz | tar -xvf -
  OR (if you are using GNU tar)
    tar xvzf DODS-idl-cmdln-<ver>.tar.gz

  (<ver> should be replaced by the version number of the tar file(s) you
  have downloaded.)

  We will be refering to the <DODS_ROOT> directory in this and other
  documents. Suppose you unpacked the DODS distributions in
  /usr/local, <DODS_ROOT> would then refer to /usr/local/DODS.


2. Building and installing DODS software
----------------------------------------

  This information is also available on our web site at

  http://www.unidata.ucar.edu/packages/dods/home/faq/buildProcedure.html

  To build all of the DODS software (or just the parts you have
  downloaded), follow these steps:

    0. Please skim REQUIREMENTS, SUGGESTIONS, and NOTES sections of
       this file before reporting problems. Thanks.

    1. Type `./configure' at the system prompt. On some systems you
       may have to type `sh ./configure'.

    2. Type `make World'. This should build all the DODS software.
       This runs configure in many of the src/ subdirectories and
       builds the DODS software in the correct order. The configure
       scripts should be able to determine the setup of your computer
       and provide for a clean build. However, if your setup is
       unusual or you want to use a specific compiler or other build
       tool, there are a number of environment variables that the
       configure scripts recognize: 

       - HDF_PATH, MATLAB_ROOT, IDL_ROOT, DSP_ROOT: the location of
         third-party software that is used by DODS client or server
         software rather than that in DODS/src/packages which is used
         by the DODS core
       - CPPFLAGS, CC, CFLAGS, CXX, CXXFLAGS, FC, FFLAGS, LDFLAGS, LIBS:
         specifies compilation settings. (Unless you will be working
         with the Fortran jackets for the netCDF library, you probably
         won't need to set any of these; if so, see the DODS FAQ page
         http://www.unidata.ucar.edu/packages/dods/home/faq/
         Set CC and CXX if you don't want to use gcc/g++ or the
         correct version isn't found on your path.) 
       - MAKE, PERL, TAR, LEX, YACC: set these if one of these tools
         is not found on your path (or the wrong version is found).

    3. Type `make check' (optional) to build and run the test
       software. You must have the GNU automated testing software
       DejaGNU to run `make check.' 

    4. Type `make install' to install the DODS software in the DODS
       bin/, etc/, lib/, and include/ directories. I.e., if you
       unpacked the source distribution files in /usr/local, the
       software will be installed in
       /usr/local/DODS/{bin|etc|lib|include}

    5. If you run into problems during the build process, you may need
       to build the DODS components individually. The web page
       mentioned above has some detailed information on the component
       builds as do the README and INSTALL files contained in the src/
       directories. If building the individual components, it is
       important to do so in the correct order. The README files in
       the src/ directories should be refered to for the most
       up-to-date information on these dependencies. However, here is
       the general order is packages, dap, tools/asciival,
       tools/www-interface, dsp-dods, ff-dods, hdf-dods, jg-dods, 
       nc3-dods, clients/idl-cmdln, clients/ml-cmdln, clients/ncview.

  Some further installation may be necessary depending on the DODS
  components you will be using.

    1. To install the DODS server: cd to <DODS_ROOT>/etc then run
       'installServers'. For more details on installing a DODS server
       see our DODS Server Installation Guide at

       http://www.unidata.ucar.edu/packages/dods/user/install-html/

    2. To use DODS clients: 

    3. To link with DODS client libraries:
       - For the netCDF client library, see
         http://www.unidata.ucar.edu/packages/dods/home/faq/#ncLink
       - For the JGOFS client library, see
         http://www.unidata.ucar.edu/packages/dods/home/faq/#jgLink
       - For the DODS DAP, see
         http://www.unidata.ucar.edu/packages/dods/home/faq/#dapLink

3. Requirements
---------------

  o You should have gcc/g++ 2.95.x or greater. You'll also need to get the
    stdc++ library that matches the compiler (whatever version). NB: gcc
    2.8.x and earlier *won't* build DODS. We're working on modifying the
    software so that it will build with a variety of compilers. It's close,
    but there are one or two outstanding problems.

  O We now ship the C++ source files generated using bison and flex so these
    programs are no longer required to build the source code. However, to do
    a complete build from the sources after running the `grammar-clean'
    target, you'll need bison 1.25 and flex 2.5.4.

  o You may need GNU Make.

4. Suggestions
--------------

5. Notes
--------

  o If the build fails because make reports that it does not know how to make
    a particular file, try runing `make depend' to rebuild the Makefile's
    dependencies.

  o If you are building on a new platform (one for which we don't supply
    binaries), please run the tests and tell us about any failures. To do
    this you'll need to get the GNU test system called DejaGNU. It is very
    simple to install so don't be shy! If the tests run, try building a
    binary tarball using the `binary-tar' target of the Makefile. This will
    provide a set of binaries others can use and will be greatly appreciated.

  o If you are developing code that uses DODS, get autoconf and CVS (both
    from GNU). We maintain a CVS-managed source tree that people outside the
    group may access.

  o When you unpack the DODS-dap-<version>.tar.gz tar file, it will build a
    directory tree rooted in the directory where you do the unpacking. The
    top of that tree is called `DODS' and you should see that directory once
    tar is done unpacking. In the rest of this file I'll refer to the root of
    that tree as $DODS_ROOT. For example, if you unpacked the tar file in
    /export/jimg then $DODS_ROOT would be /export/jimg/DODS.

  o By default DODS installs into its own tree. That is, it does *not*
    install programs in to /usr/local/bin, libraries into /usr/local/lib,
    et cetera.  Instead, programs are installed into $DODS_ROOT/bin, libraries
    into $DODS_ROOT/lib, etc.

  o Older versions of Linux have an xdr.h include file that won't compile
    properly with g++. The error shows up when building software that calls
    xdr_destroy and the compiler complains that it's being called with too
    many arguments. If this happens to you, take the xdr.h.linux file and
    put it in $DODS_ROOT/include and rename it to xdr.h. In that include
    directory, only DODS software will be able to see the changed file (so
    you can be sure that other software that uses the original xdr.h will
    still build). Note that the changes are very minor and there should be
    no problem installing xdr.h in /usr/include/rpc if that's what you want
    to do.

  o DEBUGGING AIDS

    - The DODS API includes the following debugging aids that may be of help
      to you in developing new DODS applications.

    - DBG: simple program instrumentation -- see the file debug.h in
      $DODS_ROOT/include for more information

    - DBG2: more elaborate program instrumentation -- by convention this is
      used for output that is half a page or more, while DEBUG is used for
      single line output.

    - dbnew: include -ldbnew and -lefence when linking. libdbnew.a contains
      overloaded versions of new, new[] delete and delete[]. It also contains
      code to `walk the malloc chain' and simple checks for out-of-bounds
      errors.

    - efence: a freely available bounds checker for dynamically allocated
      memory. When used with dbnew, efence must be set to 8-byte alignment.
      efence will find all over- or under-writes of dynamically allocated
      memory, but only works on some machines.

    - To build with program instrumentation use `--enable-debug=<level>'
      where <level> is 1 or 2.

    - By default, both debug and dbnew are *not* enabled. Thus, if you want
      to build a straight version of the libraries and test code, use
      `./configure'. If you want the extra features, use:

      ./configure --enable-dbnew --enable-debug=2
