[GRASS-dev] Scripting programming: directory structure of GRASS

Hi,
I'm writing a script for Grass.
I've a problem with the directory structure of GRASS.

I know where is the place of script: ($GISBASE/scripts).
But my script use some fortran-codes, I compile
this codes with gfortran, and I don't know where's the correct directory
for the executable compiled.

Thank in advanced!

Roberto

Hi,

http://grass.osgeo.org/grass63/manuals/html63_user/variables.html#enviro

GRASS_ADDON_PATH
[grass startup script]
  allows to specify additional paths to local GRASS modules extra to
standard distribution.

so, if you set $GRASS_ADDON_PATH (e.g. in ~/.grass.bashrc) and put your
program there, it should work

jachym

roberto.marzocchi píše v Pá 01. 02. 2008 v 16:30 +0100:

Hi,
I'm writing a script for Grass.
I've a problem with the directory structure of GRASS.

I know where is the place of script: ($GISBASE/scripts).
But my script use some fortran-codes, I compile
this codes with gfortran, and I don't know where's the correct directory
for the executable compiled.

Thank in advanced!

Roberto
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

--
Jachym Cepicky
e-mail: jachym.cepicky@gmail.com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub

roberto.marzocchi wrote:

I'm writing a script for Grass.
I've a problem with the directory structure of GRASS.

I know where is the place of script: ($GISBASE/scripts).
But my script use some fortran-codes, I compile
this codes with gfortran, and I don't know where's the correct directory
for the executable compiled.

If the binary is supposed to be run directly by the user, it should go
into $GISBASE/bin. If it's only supposed to be run from the script, it
should go into $GISBASE/etc, and be inkoked using a full pathname
($GISBASE/etc isn't added to $PATH).

--
Glynn Clements <glynn@gclements.plus.com>

roberto.marzocchi wrote:

I'm writing a script for Grass.
I've a problem with the directory structure of GRASS.

I know where is the place of script: ($GISBASE/scripts).
But my script use some fortran-codes, I compile
this codes with gfortran, and I don't know where's the correct
directory for the executable compiled.

$GRASS_ADDON_PATH is a nice place to put your own scripts. Set and
export it in ~/.grass.bashrc. Using that has a couple of advantages:

- it's a nice clean solution, like /usr/local/ on a UNIX system
- if you upgrade your version of grass you won't wipe out your personal
add-ons along with `rm $GISBASE`.
- a user might not have root access on their machine so can not put
something into the read-only $GISBASE/scripts/ directory.

see 'g.manual variables' for $GRASS_ADDON_PATH
see also $GRASS_ADDON_ETC

Hamish

      ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ