Gri: installing Gri

  Chapters: 1: Introduction 2: Simple example 3: Invocation 4: Finer Control 5: X-Y Plots 6: Contour Plots 7: Image Plots 8: Examples 9: Gri Commands 10: Programming 11: Environment 12: Emacs Mode 13: History 14: Installation 15: Gri Bugs 16: Test Suite 17: Gri in Press 18: Acknowledgments 19: License Indices: Concepts Commands Variables | ## 14.3: Compilation on Unix computers The following steps indicate how to compile Gri on unix computers. The procedure is quite standard. Requirements You'll need a C++ compiler that is modern enough to handle 'templates' (i.e. almost any compiler from 1998 onward). Don't worry -- if your compiler isn't new enough, you'll see that in a minute or two! You'll need TeX and texinfo to make the info files, and optionally the netCDF library (if you wish gri to be able to read netCDF binary data files). To make the HTML manual, you'll need imagemagick, info, gs and its fonts. On Debian GNU/Linux systems, the required packages are listed as Build-Depends in the ``control`' file found in the ``debian`' directory, to which you must add the package ``build-essential`'. Unpack the source Type
      gunzip gri-2.12.23.tgz
      tar xvf gri-2.12.23.tar
  (or similar commands) to uncompress and untar the contents. This will yield a new directory named ``gri-2.12.23`' which contains many files. Move to the Gri directory
      cd gri-2.12.23
  Configure your compiler Next you must "configure" the Gri source files. During this step, a series of tests will be made about your operating system and your compiler. Most of these tests need no interaction from you, but there is one overall choice that you may wish to make: the place on your filesystem where Gri (and many associated library and documentation files) will reside. To get the default installation, with files residing within the directory ``/usr/local`', type
      ./configure
  at this time. If you'd rather the files go into another location, run the ``configure`' script differently, e.g. to get the Gri files to reside within the ``/opt`' directory, type:
      ./configure --prefix=/opt
  In response, you'll see the results of several tests of the properties of your operating system, your C++ compiler, etc. Normally you can ignore these results. As an example, typing ``./configure`' without a ``--prefix`' option yields the directory tree (``...`' indicates several files not displayed in this list, for brevity). In this example, the most up-to-date version is 2.12.23, but a previous version 2.12.22 has also been retained. (Note that only one copy of the documentation is retained; this is all that's needed, since old versions are documented there as well as new versions.)
      /usr/local
      |-- bin
      |   |-- gri -> gri-2.12.23
      |   |-- gri-2.12.23
      |   |-- gri-2.12.22
      |   |-- gri_merge
      |   `-- gri_unpage
      |-- info
      |   |-- ...
      `-- share
          `-- gri
              |-- 2.6.0
              |   |-- gri.cmd
              |   |-- license.txt
              |   |-- logo.dat
              |   `-- startup.msg
              |-- 2.4.0
              |   |-- gri.cmd
              |   |-- license.txt
              |   |-- logo.dat
              |   `-- startup.msg
              `-- doc
                  |-- examples
                  |   |-- ...
                  `-- html
                      |-- ...
                      |-- resources
                      |   |-- ...
                      `-- screenshots
                          |-- ...
  Trouble-shooting 1: If the permission of the ``configure`' file is wrong, you'll get an error like ``Permission denied`'; if so, try typing ``sh ./configure`' to run it in the Bourne shell. If that fails, you are going to have to do some old-fashioned work! Start by copying the generic Makefile called ``Makefile.generic`' into ``Makefile`', and try the following steps, perhaps editing the ``Makefile`' if you run into errors. Trouble-shooting 2: Gri uses a C++ feature called 'templates'. Unfortunately, templates are handled in different ways by different compilers. At least as of Spring 1997, the GNU compiler, vsn 2.7.x (used by many Gri folks) has problems with templates. Therefore the configure script will check to see if you are using the GNU c++ compiler, and if you are it will check whether the ("template repository") compiler flag ``-frepo`' is known on your machine. If it is not, an alternative method of templates will be used. But if it is, you'll be asked, for confirmation, whether you wish to use the ``-frepo`' flag. On many machines (e.g. Solaris) you should answer ``n`' to this question. The prompt will explain. Also, note that you can avoid the prompt by running configure as either of the two below:
      ./configure --enable-frepo
      ./configure --disable-frepo
  (Such switches will be ignored unless you're using the GNU compiler.) Trouble-shooting 3: If optional system libraries like the netCDF library, if it exists, are installed in nonstandard places, you might have to change the unix environment variable ``LD_LIBRARY_PATH`'. For example, on my machine the ``netcdf`' library is not installed in ``/usr/lib`', as the ``configure`' script assumes, but rather in ``/usr/local/share/netcdf/lib`'. Therefore I have the following line in one of my startup files:
      export LD_LIBRARY_PATH=/usr/lib:/usr/local/share/netcdf/lib
  Compiling Gri Now compile Gri by typing
      make
  Testing Gri Type
      make check
  to do some tests on the version of Gri that you just compiled. If no errors are reported, you may go to the next step. Installing Gri Assuming compilation succeeds, install ``gri`' and the ancillary file ``gri.cmd`', by typing
      make install
  If you wish to see where files where be installed, first try a dry run typing
      make -n install
  Cleaning up Once these things are done, you may type
      make clean
      cd doc ; make clean
to clean up some files. Of course, you could just erase the whole source, but the source is probably worth a penny of hard-drive space, isn't it?