
	$Id: INSTALL 16473 2007-05-14 22:03:25Z jimg $

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

BUILDING THE SOFTWARE
BUILD REQUIREMENTS
NOTES
CONFIGURATION AND TESTING

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

BUILDING THE SOFTWARE

  To build the WCS Gateway Module software, follow these steps:

  0. Please skim BUILD REQUIREMENTS and NOTES sections of this file before
     reporting problems. Also, this software _requires_ other software
     components be built and installed and that its configuration file be
     edited. Make sure you read over the CONFIGURATION AND TESTING section!
     Thanks.

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

  2. Type `make' to build the software

  3. Type `make install' to install the BES software. The package installs
     in /usr/local/ by default; use --prefix to change that.
     This will also add the new wcsg.conf file to the $prefix/etc/bes/modules
     directory. The BES configuration file bes.conf will automatically
     load any module configuration files in that directory. The wcsg.conf
     file contains wcs_gateway_module specific configurations for use with the
     BES Framework.

  4 Type `make check' to run the tests. You must run 'make install'
    first in order to run these tests as a test module for the BES is
    installed. You must have autotest (part of autoconf) to run `make
    check.' Also, for these tests to run successfully, you will need
    an Internet connection as WCS requests are made.

Building from Our SVN Repository

  If you are building from a SVN checkout, run 'autoreconf --verbose' before
  './configure; make; make install'. If you try to run autoconf, etc., by
  hand and wind up with build files that don't work, use 'autoreconf --force
  --verbose' and then './configure; make; make install'.

AFTER INSTALLING

  o See the CONFIGURATION section once you have finished building the BES.

BUILD REQUIREMENTS

  o To build from a fresh SVN checkout, you'll need automake 1.11,
    autoconf 2.63 and libtool 2.2.6. Earlier versions may work, but
    may cause problems, particularly with the 'distcheck' target for
    make. Given those requirements, use 'autoreconf --force --verbose'
    and then build as described above.

  o The library uses OPeNDAP's Back-End Server (BES). You will need version
    3.8.0 or greater to build this software. See
    http://www.opendap.org/download/.

  o To serve data returned by making wcs requests you will need the netcdf
    and hdf4 modules from OpeNDAP, at least versions 3.9 and 3.8
    respectively.  See http://www.opendap.org/download/.

  o You should have gcc/g++ 3.3.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 the software. We're working on modifying
    the software so that it will build with a variety of compilers. As of
    01/22/03 we have built the code using Microsoft's Visual C++ 6.0 and GNU
    gcc/++ 3.2.1, 3.3, 3.4 and 4.0, ..., 4.4

NOTES

  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.

  o If you are developing code that uses the WCS Module, get autoconf and
    SVN. We maintain a SVN-managed source tree that people outside the group
    may access. See http://scm.opendap.org:8090/trac/

  o The gnulib software is used to provide replacement functions when
    autoconf detects that is necessary. To update the gnulib, check it out
    from CVS and run '$gnulib_home/gnulib-tool --lgpl --import' in this
    directory. Macros in configure.ac supply gnulib-tool with all the
    information it needs. Only developers working on libdap should ever have
    to do this.

  o To build a rpm file for a source or binary distribution, use 'make
    rpm'

  o DEBUGGING AIDS

    - Debugging is built in to the BES and does not require any special
      debug flags during compile time. To activate debugging in the BES,
      simpy use the -d "cerr|<filename>,wcs" option to besctl.
      You can either specify cerr or a file name with the -d option. If you
      specify cerr then debug output will go to standard error. If you
      specify a file name, then debug output will go to that file. You can
      not specify cout, as standard output is redirected to the socket.

    - You can also check the BES log file, where the location is specified
      in the BES configuration file. There might be some useful information
      in that file.

    - In the past we used efence and dbnew to help debug dynamic memory
      programming errors. We are now using valgrind and suggest you do the
      same. On some Linux platforms you should export MALLOC_CHECK_=0 in the
      shell before running valgrind. This is true for the unit tests and may
      be true for other code. You'll also notice that the Makefile contains
      CXX and C compile-time flags for debugging. These will greatly simplify
      using valgrind and/or a debugger. To use these, don't hack up the
      Makefile.am. Instead export CXXFLAGS with the values you want and then
      run configure. For example:

	  export CXXFLAGS="-g3 -O0 -Wall -fno-defer-pop"; ./configure

CONFIGURATION AND TESTING

  o CONFIGURATION

    - The configuration file is located in the BES installation directory
      under etc/bes/modules and is called wcsg.conf. This file will need to be
      edited, and is fairly well documented. So, if you installed in
      /usr/local, then this file will be located in
      /usr/local/etc/bes/modules/wcsg.conf.

  o TESTING

    - Once you have built the software and installed it you can run 'make
      check' to make sure that the software is working properly. DEJAGNU is
      required for the tests to work successfully, as well as an Internet
      connection.

