[GRASS-user] r.example
Nikos Alexandris
nik at nikosalexandris.net
Fri Jun 7 04:33:16 PDT 2013
Pedro Mendonça wrote:
[..]
> But how can I run the program? It gives an error:
> pedro at PedroHost:~/Desktop/grass-6.4.3RC3/dist.i686-pc-linux-gnu/bin$
> ./r.example ./r.example: error while loading shared libraries:
> libgrass_gis.6.4.3RC3.so: cannot open shared object file: No such file or
> directory
You have to run it through a grass session of course,
--%<---
# compiling (in grass_trunk)
nik at vertiKal:/geo/osgeo/src/grass_trunk/doc/raster/r.example$ make
MODULE_TOPDIR=/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-gnu
test -d OBJ.x86_64-unknown-linux-gnu || mkdir -p OBJ.x86_64-unknown-linux-gnu
gcc -ggdb -march=native -Wall -Werror-implicit-function-declaration -
I/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-gnu/include -
I/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-gnu/include -
D_FILE_OFFSET_BITS=64 -DPACKAGE=\""grassmods"\" -
I/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-gnu/include -
I/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-gnu/include -o
OBJ.x86_64-unknown-linux-gnu/main.o -c main.c
: && gcc -L/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-gnu/lib -
L/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-gnu/lib -Wl,--export-
dynamic -Wl,-rpath-link,/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/lib -o /geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/bin/r.example OBJ.x86_64-unknown-linux-gnu/main.o -lgrass_gis.7.0.svn -
lgrass_raster.7.0.svn -lm
if [ "/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-gnu/bin/r.example"
!= "" ] ; then GISRC=/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/demolocation/.grassrc70 GISBASE=/geo/osgeo/src/grass_trunk/dist.x86_64-
unknown-linux-gnu PATH="/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/bin:/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-gnu/bin:$PATH"
PYTHONPATH="/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/etc/python:/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/etc/python:$PYTHONPATH"
LD_LIBRARY_PATH="/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/bin:/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/lib:/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/lib:/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/lib:/usr/local/lib" LC_ALL=C /geo/osgeo/src/grass_trunk/dist.x86_64-
unknown-linux-gnu/bin/r.example --html-description < /dev/null | grep -v
'</body>\|</html>' > r.example.tmp.html ; fi
VERSION_NUMBER=7.0.svn VERSION_DATE=2013 \
python /geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/tools/mkhtml.py r.example > /geo/osgeo/src/grass_trunk/dist.x86_64-
unknown-linux-gnu/docs/html/r.example.html
VERSION_NUMBER=7.0.svn /geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/tools/g.html2man.py /geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/docs/html/r.example.html /geo/osgeo/src/grass_trunk/dist.x86_64-unknown-
linux-gnu/docs/man/man1/r.example.1
/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/docs/html/r.example.html:58:0: Error (IndexError('pop from empty list',)):
</em>
make: *** [/geo/osgeo/src/grass_trunk/dist.x86_64-unknown-linux-
gnu/docs/man/man1/r.example.1] Error 1
rm r.example.tmp.html
# although it gives an error, it runs fine here
# create test location wgs84, enter
grass70 -c EPSG:4326 /geo/grassdb/testing/wgs84
...
..
.
# test
GRASS 7.0.svn (wgs84):/geo/osgeo/src/grass_trunk/doc/raster/r.example >
r.example --help
Description:
My first raster module
Keywords:
raster, keyword2, keyword3
Usage:
r.example input=name output=name [--overwrite] [--verbose] [--quiet]
Flags:
--o Allow output files to overwrite existing files
--v Verbose module output
--q Quiet module output
Parameters:
input Name of input raster map
output Name for output raster map
--->%--
Nikos
More information about the grass-user
mailing list