[GRASS5] grass directory structure and locations

Glynn Clements glynn at gclements.plus.com
Tue Aug 16 14:40:48 EDT 2005

Dennis Veatch wrote:

> Hopefully I am on the right mail list, if not then please point me elsewhere.
> A little background on my distro. Running a source based distro called 
> Lunar-Linux ( http://www.lunar-linux.org/ ) and I am creating some install 
> modules for grass, postgis and qgis. They all install fine but I have noticed 
> one thing.
> One of the abilities of Lunar-Linux is to perform integrity checks on 
> installed items. These checks consist of discovering missing binary 
> executable, libraries and header files, modified binaries and libraries, 
> misowned symlinks to files and broken executable and libraries. 
> When I run these checks gqis fails sanity checks because the grass libs seem 
> to be in a non-standard location. At least that is how it appears to me. In 
> my limited experience an apps libs usually go in /usr/lib or /lib. 
> And I see that the grass install essentially creates it's own tree under /usr. 
> One thing I have not done yet is to add /usr/grass to ld.so.conf. Which I'm 
> sure would take of the failed sanity checks. But I am curious as to why grass 
> does not use the "normal" directory locations of Unix/UNIX/Linux.


The whole of GRASS goes into its own directory, with the exception of
the "grass61" (or similar) script used to start GRASS, which goes into
a standard location.

Nothing in GRASS (again, except for the startup script) hardcodes the
installation path, but uses the environment variable GISBASE (which is
set in the startup script). The startup process sets PATH,
LD_LIBRARY_PATH etc to include the appropriate subdirectories of the
GRASS installation tree.

If you want to move or rename the GRASS installation directory, you
only need to update the startup script accordingly. Also, as Stephan
mentioned, if you want to uninstall GRASS, you only need to delete the
GRASS directory and the startup script. If it installed into system
directories, uninstalling would be difficult.

The GRASS build system installs everything into a local directory
within the source tree, from where you can run the newly-compiled
version without having to install it. Running "make install" simply
copies the entire directory to the installed location and installs a
copy of the startup script which references the installed location.

All in all, this makes it easy to keep multiple versions of GRASS
around and to try new versions without any chance of affecting an
existing installation.

BTW, the default location is under /usr/local; you have to explicitly
use --prefix=/usr to get it installed under /usr. Given that it
doesn't install into the standard locations but to its own directory
hierarchy, I prefer "--prefix=/opt --bindir=/usr/local/bin" so that
GRASS goes into /opt/grass-<version>. /opt is the historical location
for packages which use their own self-contained hierarchy.

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list