<html> <head> <title>Gri: installing Gri</title> </head> <body bgcolor="#FFFFFF" text="#000000" link="#0000EE" vlink="#551A8B" alink="FF0000"> <!-- newfile uncompiled-unix.html "Gri: installing Gri" "Installing Gri" --> <!-- @node Uncompiled Unix, Msdos-install, Precompiled Unix, Unix-install --> <a name="UncompiledUnix" ></a> <img src="./resources/top_banner.gif" usemap="#navigate_top" border="0"> <table summary="top banner" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="150" valign="top"> <font size=-1> <br> Chapters: </br> <a href="Introduction.html">1: Introduction</a><br> <a href="SimpleExample.html">2: Simple example</a><br> <a href="InvokingGri.html">3: Invocation</a><br> <a href="GettingMoreControl.html">4: Finer Control</a><br> <a href="X-Y.html">5: X-Y Plots</a><br> <a href="ContourPlots.html">6: Contour Plots</a><br> <a href="Images.html">7: Image Plots</a><br> <a href="Examples.html">8: Examples</a><br> <a href="Commands.html">9: Gri Commands</a><br> <a href="Programming.html">10: Programming</a><br> <a href="Environment.html">11: Environment</a><br> <a href="Emacs.html">12: Emacs Mode</a><br> <a href="History.html">13: History</a><br> <a href="Installation.html">14: Installation</a><br> <a href="Bugs.html">15: Gri Bugs</a><br> <a href="TestSuite.html">16: Test Suite</a><br> <a href="Acknowledgments.html">17: Acknowledgments</a><br> <a href="License.html">18: License</a><br> <br> Indices:</br> <a href="ConceptIndex.html"><i>Concepts</i></a><br> <a href="CommandIndex.html"><i>Commands</i></a><br> <a href="BuiltinIndex.html"><i>Variables</i></a><br> </font> <td width="500" valign="top"> <map name="navigate_top"> <area alt="index.html#Top" shape="rect" coords="5,2,218,24" href="index.html#Top"> <area alt="Unix-install.html#Unix-install" shape="rect" coords="516,2,532,24" href="Unix-install.html#Unix-install"> <area alt="Gri: installing Gri" shape="rect" coords="557,2,573,24" href="precompiled-unix.html"> <area alt="Gri: installing Gri" shape="rect" coords="581,2,599,24" href="msdos-install.html"> </map> <map name="navigate_bottom"> <area alt="index.html#Top" shape="rect" coords="5,2,218,24" href="index.html#Top"> <area alt="Gri: installing Gri" shape="rect" coords="581,2,599,24" href="msdos-install.html"></map> <h2>14.3: Compilation on Unix computers</h2> The following steps indicate how to compile Gri on unix computers. The procedure is quite standard. <p> <dl> <dt> <i>Requirements</i> <dd>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! <p> 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. <p> On Debian GNU/Linux systems, the required packages are listed as Build-Depends in the `<font color="#82140F"><samp>control</samp></font>' file found in the `<font color="#82140F"><samp>debian</samp></font>' directory, to which you must add the package `<font color="#82140F"><samp>build-essential</samp></font>'. <p> <dt> <i>Unpack the source</i> <dd>Type <p> <TABLE SUMMARY="Example" BORDER="0" BGCOLOR="#efefef" WIDTH="100%"> <TR> <TD> <PRE> <font color="#82140F"> gunzip gri-2.8.0.tgz tar xvf gri-2.8.0.tar </font></PRE> </TD> </TR> </TABLE> <p> <p> (or similar commands) to uncompress and untar the contents. This will yield a new directory named `<font color="#82140F"><samp>gri-2.8.0</samp></font>' which contains many files. <p> <dt> <i>Move to the Gri directory</i> <dd><p> <TABLE SUMMARY="Example" BORDER="0" BGCOLOR="#efefef" WIDTH="100%"> <TR> <TD> <PRE> <font color="#82140F"> cd gri-2.8.0 </font></PRE> </TD> </TR> </TABLE> <p> <dt> <i>Configure your compiler</i> <dd>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 `<font color="#82140F"><samp>/usr/local</samp></font>', type <p> <TABLE SUMMARY="Example" BORDER="0" BGCOLOR="#efefef" WIDTH="100%"> <TR> <TD> <PRE> <font color="#82140F"> ./configure </font></PRE> </TD> </TR> </TABLE> <p> <p> at this time. If you'd rather the files go into another location, run the `<font color="#82140F"><code>configure</code></font>' script differently, e.g. to get the Gri files to reside within the `<font color="#82140F"><samp>/opt</samp></font>' directory, type: <p> <TABLE SUMMARY="Example" BORDER="0" BGCOLOR="#efefef" WIDTH="100%"> <TR> <TD> <PRE> <font color="#82140F"> ./configure --prefix=/opt </font></PRE> </TD> </TR> </TABLE> <p> <p> 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. <p> <p> As an example, typing `<font color="#82140F"><code>./configure</code></font>' without a `<font color="#82140F"><code>--prefix</code></font>' option yields the directory tree (`<font color="#82140F"><code>...</code></font>' indicates several files not displayed in this list, for brevity). In this example, the most up-to-date version is 2.8.0, but a previous version 2.6.4 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.) <p> <TABLE SUMMARY="Example" BORDER="0" BGCOLOR="#efefef" WIDTH="100%"> <TR> <TD> <PRE> <font color="#82140F"> /usr/local |-- bin | |-- gri -> gri-2.8.0 | |-- gri-2.8.0 | |-- gri-2.6.4 | |-- 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 |-- ... </font></PRE> </TD> </TR> </TABLE> <p> <b>Trouble-shooting 1</b>: If the permission of the `<font color="#82140F"><samp>configure</samp></font>' file is wrong, you'll get an error like `<font color="#82140F"><code>Permission denied</code></font>'; if so, try typing `<font color="#82140F"><code>sh ./configure</code></font>' 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 `<font color="#82140F"><samp>Makefile.generic</samp></font>' into `<font color="#82140F"><samp>Makefile</samp></font>', and try the following steps, perhaps editing the `<font color="#82140F"><samp>Makefile</samp></font>' if you run into errors. <p> <p> <b>Trouble-shooting 2</b>: 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 `<font color="#82140F"><code>-frepo</code></font>' 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 `<font color="#82140F"><code>-frepo</code></font>' flag. On many machines (e.g. Solaris) you should answer `<font color="#82140F"><code>n</code></font>' to this question. The prompt will explain. Also, note that you can avoid the prompt by running configure as either of the two below: <p> <TABLE SUMMARY="Example" BORDER="0" BGCOLOR="#efefef" WIDTH="100%"> <TR> <TD> <PRE> <font color="#82140F"> ./configure --enable-frepo ./configure --disable-frepo </font></PRE> </TD> </TR> </TABLE> <p> (Such switches will be ignored unless you're using the GNU compiler.) <p> <b>Trouble-shooting 3</b>: 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 `<font color="#82140F"><code>LD_LIBRARY_PATH</code></font>'. For example, on my machine the `<font color="#82140F"><code>netcdf</code></font>' library is not installed in `<font color="#82140F"><samp>/usr/lib</samp></font>', as the `<font color="#82140F"><code>configure</code></font>' script assumes, but rather in `<font color="#82140F"><samp>/usr/local/share/netcdf/lib</samp></font>'. Therefore I have the following line in one of my startup files: <p> <TABLE SUMMARY="Example" BORDER="0" BGCOLOR="#efefef" WIDTH="100%"> <TR> <TD> <PRE> <font color="#82140F"> export LD_LIBRARY_PATH=/usr/lib:/usr/local/share/netcdf/lib </font></PRE> </TD> </TR> </TABLE> <p> <dt> <i>Compiling Gri</i> <dd>Now compile Gri by typing <p> <TABLE SUMMARY="Example" BORDER="0" BGCOLOR="#efefef" WIDTH="100%"> <TR> <TD> <PRE> <font color="#82140F"> make </font></PRE> </TD> </TR> </TABLE> <p> <dt> <i>Testing Gri</i> <dd>Type <p> <TABLE SUMMARY="Example" BORDER="0" BGCOLOR="#efefef" WIDTH="100%"> <TR> <TD> <PRE> <font color="#82140F"> make test </font></PRE> </TD> </TR> </TABLE> <p> <p> 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. <p> <dt> <i>Installing Gri</i> <dd>Assuming compilation succeeds, install `<font color="#82140F"><samp>gri</samp></font>' and the ancillary file `<font color="#82140F"><samp>gri.cmd</samp></font>', by typing <p> <TABLE SUMMARY="Example" BORDER="0" BGCOLOR="#efefef" WIDTH="100%"> <TR> <TD> <PRE> <font color="#82140F"> make install </font></PRE> </TD> </TR> </TABLE> <p> If you wish to see where files where be installed, first try a dry run typing <p> <TABLE SUMMARY="Example" BORDER="0" BGCOLOR="#efefef" WIDTH="100%"> <TR> <TD> <PRE> <font color="#82140F"> make -n install </font></PRE> </TD> </TR> </TABLE> <p> <dt> <i>Cleaning up</i> <dd>Once these things are done, you may type <p> <TABLE SUMMARY="Example" BORDER="0" BGCOLOR="#efefef" WIDTH="100%"> <TR> <TD> <PRE> <font color="#82140F"> make clean cd doc ; make clean </font></PRE> </TD> </TR> </TABLE> <p> <p> 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? </dl> </table> <img src="./resources/bottom_banner.gif" usemap="#navigate_bottom" border="0"> </body> </html>