|
|
(17 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| ===Getting the RHESSys source code=== | | ===Getting the RHESSys source code=== |
| The source for RHESSys and various tools for use with RHESSys is hosted on [http://sourceforge.net/projects/rhessys/ sourceforge] and | | The source for RHESSys and various tools for use with RHESSys is hosted on [http://sourceforge.net/projects/rhessys/ sourceforge] and |
− | accessible via anonymous subversion access. For the latest stable release, check out (the -r XXX will download the latest RHESSys version deemed stable)<br> | + | accessible via anonymous subversion access. |
| + | |
| + | The latest stable release can be checked out with the following terminal window command: <br> |
| | | |
| '''<pre>$> svn co -r 318 https://rhessys.svn.sourceforge.net/svnroot/rhessys/trunk/</pre>''' | | '''<pre>$> svn co -r 318 https://rhessys.svn.sourceforge.net/svnroot/rhessys/trunk/</pre>''' |
| | | |
| + | (the -r ### will download the latest RHESSys version deemed stable) |
| | | |
− | For the latest development version, check out (this will download the most recent RHESSys version that was checked in and may still be undergoing bug fixes)
| + | |
| + | The latest development version can be checked out with the following terminal window command: |
| | | |
| '''<pre>$> svn co https://rhessys.svn.sourceforge.net/svnroot/rhessys/trunk/</pre>''' | | '''<pre>$> svn co https://rhessys.svn.sourceforge.net/svnroot/rhessys/trunk/</pre>''' |
| | | |
− | When the download completes, a message will print to the screen "Checked out revision XXX". Take note of this revision number. A directory called 'trunk' will have been downloaded containing all the RHESSys code directories/files. It may be useful to append the revision number to the directory trunk, i.e. trunkXXX. Also, after compiling RHESSys, if the revision number is not already contained in the executable name, it may be useful to include it, i.e. rhessys5.15.rXXX
| + | (this will download the most recent RHESSys version that was checked in and may still be undergoing bug fixes) |
− | | |
− | | |
− | Below are instructions for installing the GRASS 6.4 binary, RHESSys, and R on Mac OS X. (There may be differences on Linux or a virtual machine, but hopefully the procedures will be the same/similar, or users of these other platforms can find the installation information to aid them. At this time we don not provide support for PC users, not all RHESSys/GRASS interface programs are PC compatible). In order to install certain RHESSys programs (g2w and CF), GRASS libraries and header files must first be installed, therefore, you must first install GRASS.
| |
− | | |
− | ===Installing GRASS GIS===
| |
− | Frameworks of various Unix image format and GIS libraries are the base requirements for GRASS on Mac OS X. GRASS requires that the frameworks packages be installed prior to installation of GRASS.
| |
− | | |
− | You can download the frameworks packages for Mac OS X at:
| |
− | http://www.kyngchaos.com/software/frameworks
| |
− | | |
− | After installing the frameworks packages, install the GRASS 6.4 binary.
| |
− | You can download GRASS 6.4 for Mac OS X at:
| |
− | http://www.kyngchaos.com/software/grass
| |
− | | |
− | You can download GRASS for other platforms at:
| |
− | http://grass.fbk.eu/download/software.php
| |
− | (unknown if these downloads include the frameworks packages.)
| |
− | You may want to look here for additional assistance:
| |
− | http://grass.fbk.eu/grass64/source/REQUIREMENTS.html
| |
− | | |
− | | |
− | | |
− | ===Locating GRASS GISBASE===
| |
− | ====OS X====
| |
− | Some RHESSys programs will look for certain GRASS libraries and headers. You must set some environmental variables by pointing the GISBASE to where the libraries and headers are installed. On Mac OS X this should be /Applications/GRASS-6.4.app/Contents/MacOS (assuming you downloaded version 6.4; if you download a different version, then edit the command for the version you installed).
| |
− | | |
− | If you are running GRASS from the application folder, your GISBASE will be
| |
− | /Applications/<GRASS application name>/Contents/MacOS.
| |
− | For example, if your GRASS application is named GRASS-6.4, you would
| |
− | type the command (Open a terminal window, and at the terminal window command prompt, type) :
| |
− | | |
− | <pre>
| |
− | $> export GISBASE=/Applications/GRASS-6.4.app/Contents/MacOS
| |
− | </pre>
| |
− | | |
− | If you are working on a platform other than Mac OS X, then point the GISBASE to wherever the GRASS libraries and headers are located.
| |
− | | |
− | ===Building RHESSys===
| |
− | | |
− | The RHESSys source tree contains three separate tools: RHESSys, CF (create flowpaths), and g2w (GrassToWorld). Note that default values
| |
− | are specified in the makefiles. This means if you choose to override them you must specify the
| |
− | <code>-e</code> option when running <code>make</code>.
| |
− | | |
− | As a convenience there is a makefile at the trunk of the source tree that will build and install all RHESSys programs in a global install (this will require root access to the machine - see further down for instructions on how to install locally). Before running that file, make sure that you have set all necessary environment variables as listed below.
| |
− | ====rhessys====
| |
− | | |
− | =====Dependencies=====
| |
− | *None
| |
− | | |
− | =====Build Instructions=====
| |
− | from the RHESSys/trunk directory containing the makefile
| |
− | | |
− | <code>$> make; make install</code>
| |
− | | |
− | =====Environmental Variables=====
| |
− | {| {{table}}
| |
− | | |
− | | align="center" style="background:#f0f0f0;"|Name
| |
− | | align="center" style="background:#f0f0f0;"|Description
| |
− | | align="center" style="background:#f0f0f0;"|Default
| |
− | |-
| |
− | | RHESSYS_BIN
| |
− | | The path of the RHESSys installation location
| |
− | | /usr/local/bin
| |
− | |-
| |
− | |PGM
| |
− | |Name of the RHESSys binary prodouced
| |
− | |rhessys<version>
| |
− | |-
| |
− | |CC
| |
− | |C Compiler to use
| |
− | |gcc
| |
− | |}
| |
− | | |
− | | |
− | ====cf====
| |
− | | |
− | =====Dependencies=====
| |
− | * GRASS version 6.x
| |
− | | |
− | =====Build Instructions=====
| |
− | <code>$> make; make install</code>
| |
− | | |
− | =====Environmental Variables=====
| |
− | {| {{table}}
| |
− | | |
− | | align="center" style="background:#f0f0f0;"|Name
| |
− | | align="center" style="background:#f0f0f0;"|Description
| |
− | | align="center" style="background:#f0f0f0;"|Default
| |
− | |-
| |
− | | RHESSYS_BIN
| |
− | | The path of the RHESSys installation location
| |
− | | /usr/local/bin
| |
− | |-
| |
− | | PGM
| |
− | | Name of the create flowpaths executable
| |
− | | cf
| |
− | |-
| |
− | |GISBASE
| |
− | |Base GRASS install
| |
− | |none, this variable must be set
| |
− | |-
| |
− | |CC
| |
− | |C Compiler to use
| |
− | |gcc
| |
− | |}
| |
− | | |
− | | |
− | ====g2w====
| |
− | | |
− | =====Dependencies=====
| |
− | * GRASS version 6.x
| |
− | | |
− | =====Build Instructions=====
| |
− | <code>$> make; make install</code>
| |
− | | |
− | =====Environmental Variables=====
| |
− | {| {{table}}
| |
− | | |
− | | align="center" style="background:#f0f0f0;"|Name
| |
− | | align="center" style="background:#f0f0f0;"|Description
| |
− | | align="center" style="background:#f0f0f0;"|Default
| |
− | |-
| |
− | | RHESSYS_BIN
| |
− | | The path of the RHESSys installation location
| |
− | | /usr/local/bin
| |
− | |-
| |
− | | PGM
| |
− | | Name of the grass2world executable
| |
− | | g2w
| |
− | |-
| |
− | |GISBASE
| |
− | |Base GRASS install
| |
− | |none, this variable must be set
| |
− | |-
| |
− | |CC
| |
− | |C Compiler to use
| |
− | |gcc
| |
− | |}
| |
− | | |
− | | |
− | ===Local Installation of RHESSys===
| |
− | These are instructions for installing RHESSys programs locally on a machine. If you wish to install globally (i.e. executables residing in /usr/local/bin directory), you will need to do so as root. Open a terminal window and navigate to the directory where you will store the RHESSys files (i.e. you may want to make a RHESSys directory on the hard drive). For example, create a RHESSys directory on the hard drive, create a subdirectory within the RHESSys directory called bin.
| |
− | | |
− | 1. Download the RHESSys files from the Sourceforge website.
| |
− | Do this in a terminal window (and within the directory you want to store the files, i.e. the newly created RHESSys directory on the hard drive) by typing the following at the terminal window command prompt:
| |
− | > svn co https://rhessys.svn.sourceforge.net/svnroot/rhessys/trunk/
| |
− | | |
− | This will download a directory called ‘trunk’ that contains the latest version of RHESSys (rhessys5.X.X), the files for Grass2World (g2w), Create Flowpaths (CF), Lairead, and a directory called util. It is worth noting the number of the revision checked out. You may want to use this as a label to distinguish from future revisions.
| |
− | | |
− | 2. Go into each of the trunk directories to compile the programs individually. (If you are choosing to attempt a global installation, you may be able to use the makefile within the main trunk directory). Move into (change directories - cd), each directory, and type make at the terminal window command prompt:
| |
− | | |
− | > cd trunk/rhessys
| |
− | | |
− | > make
| |
− | | |
− | This will create an executable called rhessys5.15.rXXX
| |
− | | |
− | Go into each of the following directories and type make at the terminal window command prompt:
| |
− | | |
− | trunk/g2w/grass2world (creates the executable g2w)
| |
− | | |
− | trunk/g2w/AverageTables_Unix (creates the executable rat)
| |
− | | |
− | trunk/cf (creates the executable cf9.1)
| |
− | | |
− | trunk/lairead (creates the executable lairead)
| |
| | | |
| | | |
− | 3. For organizational purposes, I suggest that you create a new directory to store the executables. I suggest creating a new directory within the RHESSys directory, i.e. /RHESSys/bin. Move all of the executables from the trunk directories into this new ‘bin’ directory (rhessys5.X.X, g2w, rat, cf9.1, lairead). However you choose to organize the files, make sure that the executables g2w and rat are in the same directory, side by side.
| + | When the download completes, a message will print to the screen "Checked out revision ###". Take note of this revision number. A directory called 'trunk' will download (to the directory you are in) containing all the RHESSys code directories/files. It may be useful to append the revision number to the directory called trunk, i.e. trunk###, in the event you do not want future downloads to overwrite the code for this particular version. Also, after compiling RHESSys, if the revision number is not already contained in the executable name, it may be useful to include it, i.e. rhessys5.15.r### (recommended). |
| | | |
− | 4. As this is a ‘local’ install, each user needs to set some environmental variables that are read and executed when the bash shell (terminal window) is invoked. This is a text file (.bash_profile) that will include instructions on where the system can find these new executables when you call them. Create a .bash_profile (that is dot bash_profile) text file in your user home directory (i.e. /users/your_user_name). In this file, include a pointer to the directory containing the executables by including the full path to the directory. For example, if you have organized per my suggestion and put the executables in a directory /RHESSys/bin, then include in the .bash_profile:
| + | While RHESSys itself is a stand alone C program that can be compiled and run on it's own, in order to install/compile certain RHESSys programs (g2w to create a worldfile (required to run RHESSys) and CF to create a flowtable), GRASS GIS libraries and header files must first be installed. Therefore, before compiling g2w and CF, you must first install GRASS GIS. (see [[Installing RHESSys and associated programs]]) |
| | | |
− | export PATH=.:$RHESSYSENV/bin:$PATH:/RHESSys/bin
| + | Trunk contents: |
− | export RHESSYS_BIN=/RHESSys/bin
| |
| | | |
− | once you have created/edited the .bash_profile text file, execute it with the source command:
| + | makefile - to be used for global installation, must be signed in as root to use. each subdirectory (as follows) contains an independent makefile to compile each program individually, can be used for local installation. |
− | > source .bash_profile
| + | |
− | (To test, at the terminal window command prompt, type the RHESSys executable name (i.e. rhessys5.15.r325). If you get the following error: | + | rhessys - RHESSys code files |
− | FATAL ERROR: Cannot open world file
| |
− | then the program is successfully being called by the commands included in the .bash_profile text file, but errors as no input information has been provided.)
| |
| | | |
− | ===R Statistical Program===
| + | The following are RHESSys/GRASS interface programs and require GRASS first be installed before they can be compiled: |
− | R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and Mac OS X.
| |
− | You can download R at http://www.r-project.org/
| |
| | | |
− | Choose the preferred CRAN mirror, download and install.
| + | g2w - Grass to World and Average Tables code |
− | You will need to add a particular R package that handles dates and times. To add this package, start R, under the menu item Packages & Data - open package installer, click get list - select a CRAN mirror, search for chron, when it comes up in the list, highlight chron and click install selected. To load the library into the current R workspace, at the R window prompt, type:
| |
− | > library(chron)
| |
| | | |
− | It is useful to create an initialization file that will automatically load any frequently used R packages each time you start a new R session (RHESSys R package coming soon!). Create a .Rprofile (that is dot Rprofile) text file in your user home directory (i.e. /users/your_user_name), and include the command to load a package:
| + | cf - Create Flowpaths code |
| | | |
− | load(chron)
| + | create_in_files - non standard functionality programs used for more specific applications: cst - used with in stream routing; lairead - used to initialize vegetation from spatial data inputs |
| | | |
− | Each time you start R, it will then automatically load the chron package. Later, once the RHESSys package is ready, you can include the command to automatically load it as well.
| + | util - Useful utilities and tools. Contains some RHESSys/GRASS interface programs (cxy - used to create x/y maps). |
Getting the RHESSys source code
The source for RHESSys and various tools for use with RHESSys is hosted on sourceforge and
accessible via anonymous subversion access.
The latest stable release can be checked out with the following terminal window command:
$> svn co -r 318 https://rhessys.svn.sourceforge.net/svnroot/rhessys/trunk/
(the -r ### will download the latest RHESSys version deemed stable)
The latest development version can be checked out with the following terminal window command:
$> svn co https://rhessys.svn.sourceforge.net/svnroot/rhessys/trunk/
(this will download the most recent RHESSys version that was checked in and may still be undergoing bug fixes)
When the download completes, a message will print to the screen "Checked out revision ###". Take note of this revision number. A directory called 'trunk' will download (to the directory you are in) containing all the RHESSys code directories/files. It may be useful to append the revision number to the directory called trunk, i.e. trunk###, in the event you do not want future downloads to overwrite the code for this particular version. Also, after compiling RHESSys, if the revision number is not already contained in the executable name, it may be useful to include it, i.e. rhessys5.15.r### (recommended).
While RHESSys itself is a stand alone C program that can be compiled and run on it's own, in order to install/compile certain RHESSys programs (g2w to create a worldfile (required to run RHESSys) and CF to create a flowtable), GRASS GIS libraries and header files must first be installed. Therefore, before compiling g2w and CF, you must first install GRASS GIS. (see Installing RHESSys and associated programs)
Trunk contents:
makefile - to be used for global installation, must be signed in as root to use. each subdirectory (as follows) contains an independent makefile to compile each program individually, can be used for local installation.
rhessys - RHESSys code files
The following are RHESSys/GRASS interface programs and require GRASS first be installed before they can be compiled:
g2w - Grass to World and Average Tables code
cf - Create Flowpaths code
create_in_files - non standard functionality programs used for more specific applications: cst - used with in stream routing; lairead - used to initialize vegetation from spatial data inputs
util - Useful utilities and tools. Contains some RHESSys/GRASS interface programs (cxy - used to create x/y maps).