Hi list,
As I'm new to programming and still learning some aspects of programming for Grass are complicated and strange. Luckily I got some help from a freind how is a far better programmer then I am. After 3 days we figured it out. This not documented well, regard the following
//
On Sunday 18 January 2004 18:02, Christopher Fonnesbeck wrote:
/> Try using: /
/> /
/> g.gisenv set=DEBUG=9 /
/> /
/> for debug level 9, for example. /
Currently the maximum debug level used is 5, AFAIK.
This is right but the environment variable GRASS_DEBUG_FILE should be put in .bashrc or .bash_profile and not in .grassrc57. This is a bit confusing and we figured it out by looking at the debug code and the fact that a day later it all went wrong again. The first day we first tried to do it by putting it all in .bash_profile. Environment variable handling in Grass is very very complicated!!!!!!!!!
/> > Hello list, /
/> > /
/> > How can we set debug level and debug file in grass57? We tried the /
/> > environment variables GRASS_DEBUG_LEVEL=9, DEBUG=filename1 /
/> > GRASS_DEBUG_FILE=filename2, v.digit did not report any debug info to /
/> > filename. /
/> > /
/> > How can we compile just 1 module again in grass57? Executing make in /
/> > module dir, compiled just the object files, but not the executable. /
Which module, standard module or your own? Just to run make in the module
directory should be enough if Makefile is written correctly.
Radim
//
A standard module. As I'm learning, I do this mostly by looking at old code and trying to get the idea by playing around. Suppose I should look at the makefile somewhat better.
Greetings Sjors
Sjors wrote:
As I'm new to programming and still learning some aspects of programming
for Grass are complicated and strange. Luckily I got some help from a
freind how is a far better programmer then I am. After 3 days we figured
it out. This not documented well, regard the following
//
> On Sunday 18 January 2004 18:02, Christopher Fonnesbeck wrote:
> /> Try using: /
> /> /
> /> g.gisenv set=DEBUG=9 /
> /> /
> /> for debug level 9, for example. /
>
> Currently the maximum debug level used is 5, AFAIK.
>
This is right but the environment variable GRASS_DEBUG_FILE should be
put in .bashrc or .bash_profile and not in .grassrc57. This is a bit
confusing and we figured it out by looking at the debug code and the
fact that a day later it all went wrong again. The first day we first
tried to do it by putting it all in .bash_profile. Environment variable
handling in Grass is very very complicated!!!!!!!!!
The handling of environment variables in Grass is no different to in
any other program.
However, the issue is complicated by the fact that GRASS uses "GRASS
variables" as well as environment variables. Not only that, but much
of the documentation and some function and program names appear to
confuse the two.
GRASS variables are stored in the file referenced by $GISRC (which
defaults to ~/.grassrc5 for 5.0/5.3 and ~/.grassrc57 for 5.7), and can
be read or written using the g.gisenv program (and, at the C level,
through G_getenv(), G_setenv() etc).
Environment variables are an OS feature. Each process inherits a list
of environment variables from its parent. GRASS modules will inherit
any environment variables which are set in the shell started by the
"grass5" or "grass57" scripts, which in turn will inherit any
environment variables which are set in the shell from which the
grass5/grass57 scripts are run.
Shells invariably have a command to set environment variables (e.g.
"export" for Bourne shells, "setenv" for C shells); they also read
shell commands from a file at startup (the question of exactly *which*
file can be quite involved; consult your shell's manual page for
details).
--
Glynn Clements <glynn.clements@virgin.net>