[GRASS-user] d.histogram in 6.3?

Glynn Clements glynn at gclements.plus.com
Wed Oct 10 00:22:23 EDT 2007


"Carlos \"Guâno\" Grohmann" wrote:

> Interesting, I use both version on my machine for a while and never
> had any problem. 6.2 is from ubuntu packages and 6.3 from cvs.
> 
> 
> > Check your $PATH and $LD_LIBRARY_PATH settings; also, try running "ldd
> > $GISBASE/bin/d.histogram".
> 
> GRASS 6.3.cvs (kingston):~ > $PATH
> bash: /usr/local/grass-6.3.cvs/bin:/usr/local/grass-6.3.cvs/scripts:/usr/local/gmt42/GMT4.2.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:
> No such file or directory
> 
> GRASS 6.3.cvs (kingston):~ > $LD_LIBRARY_PATH
> bash: /usr/local/grass-6.3.cvs/lib:/usr/lib: No such file or directory
> 
> 
> GRASS 6.3.cvs (kingston):~ > ldd $GISBASE/bin/d.histogram
>         linux-gate.so.1 =>  (0xffffe000)
>         libgrass_display.so => /usr/local/grass-6.3.cvs/lib/libgrass_display.so (0xb7fd2000)
>         libgrass_gis.so => /usr/local/grass-6.3.cvs/lib/libgrass_gis.so (0xb7f82000)
>         libgrass_datetime.so => /usr/local/grass-6.3.cvs/lib/libgrass_datetime.so (0xb7f79000)
>         libz.so.1 => /usr/lib/libz.so.1 (0xb7f64000)
>         libgrass_raster.so => /usr/local/grass-6.3.cvs/lib/libgrass_raster.so (0xb7f5a000)
>         libgrass_pngdriver.so => /usr/local/grass-6.3.cvs/lib/libgrass_pngdriver.so (0xb7f53000)
>         libgrass_driver.so => /usr/local/grass-6.3.cvs/lib/libgrass_driver.so (0xb7f47000)
>         libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7ed6000)
>         libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb7eb3000)
>         libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7e75000)
>         libgrass_psdriver.so => /usr/local/grass-6.3.cvs/lib/libgrass_psdriver.so (0xb7e71000)
>         libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d27000)
>         /lib/ld-linux.so.2 (0xb7fde000)
> GRASS 6.3.cvs (kingston):~ >
> 
> 
> Seems to me they all point to 6.3?

Which suggests that d.histogram and libgis were compiled with
different versions of gis.h.

Either the code was updated from CVS and only partially re-compiled,
or some parts of GRASS are compiling against an installed version of
<grass/gis.h> rather than the copy in the source tree. Check the make
output to see which -I switches are being used for compiling
lib/gis/parser.c and display/d.histogram/main.c.

d.histogram has:

	bg_opt = G_define_standard_option(G_OPT_C_BG);

But it's behaviour (the "ERROR: [|]: No such color" message) is what
would occur if it had:

	bg_opt = G_define_standard_option(G_OPT_F_SEP);

(the default value for that option is "|").

If you run "d.histogram help", you will see something like:

	Usage:
	 d.histogram [-nqC] map=name ... [fs=character]
	
	 ...
	Parameters:
	 ...
	       fs   Field separator
	            default: |


in spite of the fact that d.histogram isn't supposed to have a fs=
option.

The cause is that different versions of gis.h will have different
values for G_OPT_C_BG. E.g. if d.histogram was compiled with revision
1.51 of gis.h and libgis with revision 1.52, then d.histogram will
have G_OPT_C_BG == 29 while libgis will have G_OPT_F_SEP == 29.

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




More information about the grass-user mailing list