Little GRASS hint: Running GRASS without “make install”
November 7, 2007 – 3:59 pmThe problem
Sometimes, I was just wondering, why there must be two versions of GRASS in my system, when I compile GRASS from source code:
I have source code of GRASS in my /home/jachym/src/grass/grass6/ directory. Every time I download fresh updates and recompile, I have to run make install in order to get GRASS in the system. It copies GRASS to (usually) /usr/local/grass directory with grass6 script in /usr/local/bin.
The installation
- Takes time
- Makes copy of
/home/jachym/src/grass/grass6/dist.i686-pc-linux-gnu/directory, where result ofmakeis stored.
So at the end, you have
- GRASS binaries, manuals, scripts etc. in GRASS source directory, as well as
- in /usr/local/grass
Sollution
How to avoid this?
After running make, there is a script in $GRASS_SOURCE/bin.i686-pc-linux-gnu/ directory called, yes, grass6.
Copy the script in $HOME/bin directory (assumed, the directory exists).
cp bin.i686-pc-linux-gnu/grass6 ~/bin/
And set correct paths in this script to GRASS source directory. In the script, find the line, where GISBASE variable is initialized and set it so something like
GISBASE="/home/jachym/src/grass/grass6/dist.i686-pc-linux-gnu
And that is it. Now, you can run GRASS as
grass63
(Assumed, $HOME/bin directory is defined in your $PATH environment variable).
Every time, you will cvs up the source code and make it, you do not have to run make install anymore. You can delete /usr/local/grass63 directory as well as /usr/local/bin/grass63 file. Fresh installation of GRASS will be always at your service, right after you make it.
P.S. This also explains the directory structure in my system, when you want to setup new wxWidgets GUI for GRASS.