[GRASS-user] g.extension not working

Hi all,

Just got 6.5svn compiled in Ubuntu 9.04 and I'm now trying to install
r.stream.order using g.extension. When I give the command

g.extension extension=r.stream.order prefix=${GISBASE}

I get:
[: 196: /home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu:
unexpected operator
[: 219: add: unexpected operator

And then the files are checked out from svn but compilation fails with
the messages bellow. Any hints? Do I need to checkout other extensions
first?

Thanks
Daniel

Fetching <r.stream.order> from GRASS-Addons SVN (be patient)...
A r.stream.order/orders.png
A r.stream.order/main.c
A r.stream.order/description.html
A r.stream.order/global.h
A r.stream.order/io.c
A r.stream.order/order.c
A r.stream.order/Makefile
Checked out revision 43156.
Compiling <r.stream.order>...
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Module.make:25:
warning: overriding commands for target `install'
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'
test -d OBJ.i686-pc-linux-gnu || mkdir -p OBJ.i686-pc-linux-gnu
gcc -I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include
-g -Wall -Werror-implicit-function-declaration -fno-common
-I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\"
-I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/io.o -c io.c
io.c: In function ‘create_base_maps’:
io.c:57: warning: format not a string literal and no format arguments
io.c: In function ‘write_maps’:
io.c:172: warning: format not a string literal and no format arguments
gcc -I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include
-g -Wall -Werror-implicit-function-declaration -fno-common
-I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\"
-I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/main.o -c main.c
main.c: In function ‘main’:
main.c:142: warning: format not a string literal and no format arguments
gcc -I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include
-g -Wall -Werror-implicit-function-declaration -fno-common
-I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\"
-I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/order.o -c order.c
order.c: In function ‘trib_nums’:
order.c:24: warning: format not a string literal and no format arguments
order.c:26: warning: format not a string literal and no format arguments
order.c: In function ‘find_nodes’:
order.c:68: warning: format not a string literal and no format arguments
order.c:97: warning: format not a string literal and no format arguments
order.c:108: warning: format not a string literal and no format arguments
order.c:123: warning: format not a string literal and no format arguments
order.c: In function ‘do_cum_length’:
order.c:164: warning: format not a string literal and no format arguments
order.c: In function ‘strahler’:
order.c:259: warning: format not a string literal and no format arguments
order.c: In function ‘shreeve’:
order.c:313: warning: format not a string literal and no format arguments
order.c: In function ‘horton’:
order.c:364: warning: format not a string literal and no format arguments
order.c: In function ‘hack’:
order.c:447: warning: format not a string literal and no format arguments
gcc -L/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/lib
-Wl,--no-undefined -Wl,--export-dynamic
-Wl,-rpath-link,/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/lib
-L/usr/lib -o
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin/r.stream.order
OBJ.i686-pc-linux-gnu/io.o OBJ.i686-pc-linux-gnu/main.o
OBJ.i686-pc-linux-gnu/order.o -lgrass_vect -lgrass_dbmibase
-lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient
-lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis
-lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis
-lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime
-lz -lgrass_linkm -lgrass_rtree -lgrass_dig2 -lgrass_gis
-lgrass_datetime -lz -lgrass_rtree -lgrass_dgl -lgrass_rtree
-lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis
-lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz
-lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -L/usr/lib
-lgdal1.7.0 -L/usr/lib -lgeos -lgeos_c -lgrass_dbmiclient
-lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis
-lgrass_datetime -lz -lgrass_dbmibase -lgrass_gis
-lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lm
-lz
OBJ.i686-pc-linux-gnu/main.o: In function `main':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/main.c:54:
multiple definition of `springs'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:5:
first defined here
OBJ.i686-pc-linux-gnu/main.o: In function `main':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/main.c:54:
multiple definition of `outlets'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:5:
first defined here
OBJ.i686-pc-linux-gnu/main.o: In function `main':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/main.c:55:
multiple definition of `springs_num'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:5:
first defined here
OBJ.i686-pc-linux-gnu/main.o: In function `main':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/main.c:55:
multiple definition of `outlets_num'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:6:
first defined here
OBJ.i686-pc-linux-gnu/main.o: In function `main':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/main.c:55:
multiple definition of `stream_num'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:10:
first defined here
OBJ.i686-pc-linux-gnu/order.o: In function `trib_nums':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/order.c:7:
multiple definition of `springs'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:5:
first defined here
OBJ.i686-pc-linux-gnu/order.o: In function `trib_nums':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/order.c:7:
multiple definition of `outlets'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:5:
first defined here
OBJ.i686-pc-linux-gnu/order.o: In function `trib_nums':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/order.c:8:
multiple definition of `springs_num'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:5:
first defined here
OBJ.i686-pc-linux-gnu/order.o: In function `trib_nums':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/order.c:8:
multiple definition of `outlets_num'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:6:
first defined here
OBJ.i686-pc-linux-gnu/order.o: In function `trib_nums':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/order.c:8:
multiple definition of `stream_num'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:10:
first defined here
collect2: ld returned 1 exit status
make: *** [/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin/r.stream.order]
Error 1
ERROR: Compilation failed, sorry. Please check above error messages.
GRASS 6.5.svn (br_wgs84):~ >

On Wed, Aug 18, 2010 at 2:28 PM, Daniel Victoria
<daniel.victoria@gmail.com> wrote:

Hi all,

Just got 6.5svn compiled in Ubuntu 9.04 and I'm now trying to install
r.stream.order using g.extension. When I give the command

g.extension extension=r.stream.order prefix=${GISBASE}

(it should work without the prefix parameter)

I get:
[: 196: /home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu:
unexpected operator
[: 219: add: unexpected operator

I tried but do not get this error (which apparently doesn't harm, the
problem below is unrelated).

And then the files are checked out from svn but compilation fails with
the messages bellow. Any hints? Do I need to checkout other extensions
first?

No, it is a declaration bug in r.stream.order.

Thanks
Daniel

Fetching <r.stream.order> from GRASS-Addons SVN (be patient)...
A r.stream.order/orders.png
A r.stream.order/main.c
A r.stream.order/description.html
A r.stream.order/global.h
A r.stream.order/io.c
A r.stream.order/order.c
A r.stream.order/Makefile
Checked out revision 43156.
Compiling <r.stream.order>...
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Module.make:25:
warning: overriding commands for target `install'
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'
test -d OBJ.i686-pc-linux-gnu || mkdir -p OBJ.i686-pc-linux-gnu
gcc -I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include
-g -Wall -Werror-implicit-function-declaration -fno-common
-I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\"
-I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/io.o -c io.c
io.c: In function ‘create_base_maps’:
io.c:57: warning: format not a string literal and no format arguments
io.c: In function ‘write_maps’:
io.c:172: warning: format not a string literal and no format arguments
gcc -I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include
-g -Wall -Werror-implicit-function-declaration -fno-common
-I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\"
-I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/main.o -c main.c
main.c: In function ‘main’:
main.c:142: warning: format not a string literal and no format arguments
gcc -I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include
-g -Wall -Werror-implicit-function-declaration -fno-common
-I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\"
-I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/order.o -c order.c
order.c: In function ‘trib_nums’:
order.c:24: warning: format not a string literal and no format arguments
order.c:26: warning: format not a string literal and no format arguments
order.c: In function ‘find_nodes’:
order.c:68: warning: format not a string literal and no format arguments
order.c:97: warning: format not a string literal and no format arguments
order.c:108: warning: format not a string literal and no format arguments
order.c:123: warning: format not a string literal and no format arguments
order.c: In function ‘do_cum_length’:
order.c:164: warning: format not a string literal and no format arguments
order.c: In function ‘strahler’:
order.c:259: warning: format not a string literal and no format arguments
order.c: In function ‘shreeve’:
order.c:313: warning: format not a string literal and no format arguments
order.c: In function ‘horton’:
order.c:364: warning: format not a string literal and no format arguments
order.c: In function ‘hack’:
order.c:447: warning: format not a string literal and no format arguments
gcc -L/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/lib
-Wl,--no-undefined -Wl,--export-dynamic
-Wl,-rpath-link,/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/lib
-L/usr/lib -o
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin/r.stream.order
OBJ.i686-pc-linux-gnu/io.o OBJ.i686-pc-linux-gnu/main.o
OBJ.i686-pc-linux-gnu/order.o -lgrass_vect -lgrass_dbmibase
-lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient
-lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis
-lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis
-lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime
-lz -lgrass_linkm -lgrass_rtree -lgrass_dig2 -lgrass_gis
-lgrass_datetime -lz -lgrass_rtree -lgrass_dgl -lgrass_rtree
-lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis
-lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz
-lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -L/usr/lib
-lgdal1.7.0 -L/usr/lib -lgeos -lgeos_c -lgrass_dbmiclient
-lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis
-lgrass_datetime -lz -lgrass_dbmibase -lgrass_gis
-lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lm
-lz
OBJ.i686-pc-linux-gnu/main.o: In function `main':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/main.c:54:
multiple definition of `springs'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:5:
first defined here

these need to be defined "extern" I think.
@Jarek - could you please fix this?

OBJ.i686-pc-linux-gnu/main.o: In function `main':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/main.c:54:
multiple definition of `outlets'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:5:
first defined here

... many more ...

collect2: ld returned 1 exit status
make: *** [/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin/r.stream.order]
Error 1
ERROR: Compilation failed, sorry. Please check above error messages.
GRASS 6.5.svn (br_wgs84):~ >

Once the declarations are fixed in r.stream.order it should work.
A trick for you: declare less -W parameters when configuring GRASS and
the compiler may work around the problem. Still it should be fixed in SVN.

Markus

Compiling a fresh svn checkout got rid of the [: 196 problem in
g.extension but I still can't compile r.stream.order.

Also, I don't know which -W parameters I should remove from the
configure script. I'm using a configure script written by Markus
Neteler :slight_smile: in 2007 - Anne Ghisla kindly sent me a copy

Cheers
Daniel

On Wed, Aug 18, 2010 at 10:14 AM, Markus Neteler <neteler@osgeo.org> wrote:

On Wed, Aug 18, 2010 at 2:28 PM, Daniel Victoria
<daniel.victoria@gmail.com> wrote:

Hi all,

Just got 6.5svn compiled in Ubuntu 9.04 and I'm now trying to install
r.stream.order using g.extension. When I give the command

g.extension extension=r.stream.order prefix=${GISBASE}

(it should work without the prefix parameter)

I get:
[: 196: /home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu:
unexpected operator
[: 219: add: unexpected operator

I tried but do not get this error (which apparently doesn't harm, the
problem below is unrelated).

And then the files are checked out from svn but compilation fails with
the messages bellow. Any hints? Do I need to checkout other extensions
first?

No, it is a declaration bug in r.stream.order.

Thanks
Daniel

Fetching <r.stream.order> from GRASS-Addons SVN (be patient)...
A r.stream.order/orders.png
A r.stream.order/main.c
A r.stream.order/description.html
A r.stream.order/global.h
A r.stream.order/io.c
A r.stream.order/order.c
A r.stream.order/Makefile
Checked out revision 43156.
Compiling <r.stream.order>...
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Module.make:25:
warning: overriding commands for target `install'
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'
test -d OBJ.i686-pc-linux-gnu || mkdir -p OBJ.i686-pc-linux-gnu
gcc -I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include
-g -Wall -Werror-implicit-function-declaration -fno-common
-I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\"
-I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/io.o -c io.c
io.c: In function ‘create_base_maps’:
io.c:57: warning: format not a string literal and no format arguments
io.c: In function ‘write_maps’:
io.c:172: warning: format not a string literal and no format arguments
gcc -I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include
-g -Wall -Werror-implicit-function-declaration -fno-common
-I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\"
-I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/main.o -c main.c
main.c: In function ‘main’:
main.c:142: warning: format not a string literal and no format arguments
gcc -I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include
-g -Wall -Werror-implicit-function-declaration -fno-common
-I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\"
-I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/order.o -c order.c
order.c: In function ‘trib_nums’:
order.c:24: warning: format not a string literal and no format arguments
order.c:26: warning: format not a string literal and no format arguments
order.c: In function ‘find_nodes’:
order.c:68: warning: format not a string literal and no format arguments
order.c:97: warning: format not a string literal and no format arguments
order.c:108: warning: format not a string literal and no format arguments
order.c:123: warning: format not a string literal and no format arguments
order.c: In function ‘do_cum_length’:
order.c:164: warning: format not a string literal and no format arguments
order.c: In function ‘strahler’:
order.c:259: warning: format not a string literal and no format arguments
order.c: In function ‘shreeve’:
order.c:313: warning: format not a string literal and no format arguments
order.c: In function ‘horton’:
order.c:364: warning: format not a string literal and no format arguments
order.c: In function ‘hack’:
order.c:447: warning: format not a string literal and no format arguments
gcc -L/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/lib
-Wl,--no-undefined -Wl,--export-dynamic
-Wl,-rpath-link,/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/lib
-L/usr/lib -o
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin/r.stream.order
OBJ.i686-pc-linux-gnu/io.o OBJ.i686-pc-linux-gnu/main.o
OBJ.i686-pc-linux-gnu/order.o -lgrass_vect -lgrass_dbmibase
-lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient
-lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis
-lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis
-lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime
-lz -lgrass_linkm -lgrass_rtree -lgrass_dig2 -lgrass_gis
-lgrass_datetime -lz -lgrass_rtree -lgrass_dgl -lgrass_rtree
-lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis
-lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz
-lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -L/usr/lib
-lgdal1.7.0 -L/usr/lib -lgeos -lgeos_c -lgrass_dbmiclient
-lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis
-lgrass_datetime -lz -lgrass_dbmibase -lgrass_gis
-lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lm
-lz
OBJ.i686-pc-linux-gnu/main.o: In function `main':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/main.c:54:
multiple definition of `springs'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:5:
first defined here

these need to be defined "extern" I think.
@Jarek - could you please fix this?

OBJ.i686-pc-linux-gnu/main.o: In function `main':
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/main.c:54:
multiple definition of `outlets'
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:5:
first defined here

... many more ...

collect2: ld returned 1 exit status
make: *** [/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin/r.stream.order]
Error 1
ERROR: Compilation failed, sorry. Please check above error messages.
GRASS 6.5.svn (br_wgs84):~ >

Once the declarations are fixed in r.stream.order it should work.
A trick for you: declare less -W parameters when configuring GRASS and
the compiler may work around the problem. Still it should be fixed in SVN.

Markus

Daniel wrote:

Compiling a fresh svn checkout got rid of the [: 196 problem in
g.extension

I guess that is thanks to the removal of a bash-ism in the shell script
(a == b instead of a = b). some distros (Ubuntu) now use /bin/dash for
/bin/sh instead of /bin/bash, so these things only show up on those
non-bash distros.

but I still can't compile r.stream.order.

...

>> OBJ.i686-pc-linux-gnu/main.o: In function `main':
>>
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/main.c:54:
>> multiple definition of `springs'
>>
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:5:
>> first defined here

Markus:

> these need to be defined "extern" I think.
> @Jarek - could you please fix this?
>
>> OBJ.i686-pc-linux-gnu/main.o: In function `main':
>>
/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/main.c:54:
>> multiple definition of `outlets'
>>
OBJ.i686-pc-linux-gnu/io.o:/home/daniel/grassdata/br_wgs84/jip/.tmp/xadrez/2602.0/r.stream.order/io.c:5:
>> first defined here
>
> ... many more ...
>
>> collect2: ld returned 1 exit status
>> make: ***

?,
Hamish

On Wed, Aug 18, 2010 at 3:14 PM, Markus Neteler <neteler@osgeo.org> wrote:

On Wed, Aug 18, 2010 at 2:28 PM, Daniel Victoria
<daniel.victoria@gmail.com> wrote:

Hi all,

Just got 6.5svn compiled in Ubuntu 9.04 and I'm now trying to install
r.stream.order using g.extension. When I give the command

g.extension extension=r.stream.order prefix=${GISBASE}

(it should work without the prefix parameter)

I get:
[: 196: /home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu:
unexpected operator
[: 219: add: unexpected operator

I tried but do not get this error (which apparently doesn't harm, the
problem below is unrelated).

And then the files are checked out from svn but compilation fails with
the messages bellow. Any hints? Do I need to checkout other extensions
first?

No, it is a declaration bug in r.stream.order.

Jarek has fixed it in SVN. Now g.extension should work.

Cheers
Markus

Ok, g.extension works and downloads svn addons but r.stream.extract
compilation fails. I removed all -W flags from grass configure script
and I'm running version 6.5svn checked out today. Bellow is the
r.stream.order compilation log error.

Thanks
Daniel

------------------------------------------
GRASS 6.5.svn (br_wgs84):~ > g.extension r.stream.order
Fetching <r.stream.order> from GRASS-Addons SVN (be patient)...
A r.stream.order/orders.png
A r.stream.order/main.c
A r.stream.order/description.html
A r.stream.order/global.h
A r.stream.order/io.c
A r.stream.order/order.c
A r.stream.order/Makefile
Checked out revision 43367.
Compiling <r.stream.order>...
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Module.make:25:
warning: overriding commands for target `install'
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'
test -d OBJ.i686-pc-linux-gnu || mkdir -p OBJ.i686-pc-linux-gnu
gcc -I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include
  -I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\"
-I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/io.o -c io.c
io.c: In function ‘create_base_maps’:
io.c:57: warning: format not a string literal and no format arguments
io.c: In function ‘write_maps’:
io.c:172: warning: format not a string literal and no format arguments
gcc -I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include
  -I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\"
-I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/main.o -c main.c
main.c: In function ‘main’:
main.c:142: warning: format not a string literal and no format arguments
gcc -I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include
  -I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\"
-I/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include -o
OBJ.i686-pc-linux-gnu/order.o -c order.c
order.c: In function ‘trib_nums’:
order.c:24: warning: format not a string literal and no format arguments
order.c:26: warning: format not a string literal and no format arguments
order.c: In function ‘find_nodes’:
order.c:68: warning: format not a string literal and no format arguments
order.c:97: warning: format not a string literal and no format arguments
order.c:108: warning: format not a string literal and no format arguments
order.c:123: warning: format not a string literal and no format arguments
order.c: In function ‘do_cum_length’:
order.c:164: warning: format not a string literal and no format arguments
order.c: In function ‘strahler’:
order.c:259: warning: format not a string literal and no format arguments
order.c: In function ‘shreeve’:
order.c:313: warning: format not a string literal and no format arguments
order.c: In function ‘horton’:
order.c:364: warning: format not a string literal and no format arguments
order.c: In function ‘hack’:
order.c:447: warning: format not a string literal and no format arguments
gcc -L/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/lib
-Wl,--export-dynamic
-Wl,-rpath-link,/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/lib
-L/usr/lib -o
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin/r.stream.order
OBJ.i686-pc-linux-gnu/io.o OBJ.i686-pc-linux-gnu/main.o
OBJ.i686-pc-linux-gnu/order.o -lgrass_vect -lgrass_dbmibase
-lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient
-lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis
-lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis
-lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime
-lz -lgrass_linkm -lgrass_rtree -lgrass_dig2 -lgrass_gis
-lgrass_datetime -lz -lgrass_rtree -lgrass_dgl -lgrass_rtree
-lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis
-lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz
-lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -L/usr/lib
-lgdal1.7.0 -L/usr/lib -lgeos -lgeos_c -lgrass_dbmiclient
-lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis
-lgrass_datetime -lz -lgrass_dbmibase -lgrass_gis
-lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lm
-lz
make htmlcmd
make[1]: Entering directory
`/home/daniel/grassdata/br_wgs84/PERMANENT/.tmp/xadrez/21034.0/r.stream.order'
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Module.make:25:
warning: overriding commands for target `install'
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'
make /home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/docs/html/r.stream.order.html
HTMLSRC=/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin/r.stream.order
make[2]: Entering directory
`/home/daniel/grassdata/br_wgs84/PERMANENT/.tmp/xadrez/21034.0/r.stream.order'
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Module.make:25:
warning: overriding commands for target `install'
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'
if [ "/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin/r.stream.order"
!= "" ] ; then GISRC=/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/demolocation/.grassrc65
GISBASE=/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu
PATH="/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin:$PATH"
LD_LIBRARY_PATH="/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin:/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/lib:/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/lib"
LC_ALL=C /home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin/r.stream.order
--html-description < /dev/null | grep -v '</body>\|</html>' >
r.stream.order.tmp.html ; true ; fi
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/tools/mkhtml.sh
r.stream.order ; mkdir -p
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/docs/html ;
/usr/bin/install -c -m 644 r.stream.order.tmp.html
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/docs/html/r.stream.order.html
; for file in *.png *.jpg ; do head -n 1 $file | grep '^#!' >
/dev/null ; if [ $? -ne 0 ] ; then /usr/bin/install -c -m 644 $file
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/docs/html ; fi
done 2> /dev/null ; true
make[2]: Leaving directory
`/home/daniel/grassdata/br_wgs84/PERMANENT/.tmp/xadrez/21034.0/r.stream.order'
make[1]: Leaving directory
`/home/daniel/grassdata/br_wgs84/PERMANENT/.tmp/xadrez/21034.0/r.stream.order'
make mancmd
make[1]: Entering directory
`/home/daniel/grassdata/br_wgs84/PERMANENT/.tmp/xadrez/21034.0/r.stream.order'
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Module.make:25:
warning: overriding commands for target `install'
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'
make /home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/man/man1/r.stream.order.1
MANSRC=/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/docs/html/r.stream.order.html
make[2]: Entering directory
`/home/daniel/grassdata/br_wgs84/PERMANENT/.tmp/xadrez/21034.0/r.stream.order'
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Module.make:25:
warning: overriding commands for target `install'
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'
mkdir -p /home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/man/man1
GRASS_PERL=/usr/bin/perl VERSION_NUMBER=6.5.svn sh
/home/daniel/grass/grass6_devel/tools/g.html2man/g.html2man
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/docs/html/r.stream.order.html
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/man/man1/r.stream.order.1
1
Converting: /home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/docs/html/r.stream.order.html
to /home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/man/man1/r.stream.order.1
make[2]: Leaving directory
`/home/daniel/grassdata/br_wgs84/PERMANENT/.tmp/xadrez/21034.0/r.stream.order'
make[1]: Leaving directory
`/home/daniel/grassdata/br_wgs84/PERMANENT/.tmp/xadrez/21034.0/r.stream.order'
Installing r.stream.order...
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Module.make:25:
warning: overriding commands for target `install'
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/include/Make/Rules.make:90:
warning: ignoring old commands for target `install'
/usr/bin/install -c
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin/r.stream.order
/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin/
/usr/bin/install: cannot stat
`/home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu/bin/r.stream.order':
No such file or directory
make: *** [install] Error 1
ERROR: Installation failed, sorry. Please check above error messages.

On Thu, Aug 26, 2010 at 11:21 AM, Markus Neteler <neteler@osgeo.org> wrote:

On Wed, Aug 18, 2010 at 3:14 PM, Markus Neteler <neteler@osgeo.org> wrote:

On Wed, Aug 18, 2010 at 2:28 PM, Daniel Victoria
<daniel.victoria@gmail.com> wrote:

Hi all,

Just got 6.5svn compiled in Ubuntu 9.04 and I'm now trying to install
r.stream.order using g.extension. When I give the command

g.extension extension=r.stream.order prefix=${GISBASE}

(it should work without the prefix parameter)

I get:
[: 196: /home/daniel/grass/grass6_devel/dist.i686-pc-linux-gnu:
unexpected operator
[: 219: add: unexpected operator

I tried but do not get this error (which apparently doesn't harm, the
problem below is unrelated).

And then the files are checked out from svn but compilation fails with
the messages bellow. Any hints? Do I need to checkout other extensions
first?

No, it is a declaration bug in r.stream.order.

Jarek has fixed it in SVN. Now g.extension should work.

Cheers
Markus

Daniel wrote:

Ok, g.extension works and downloads svn addons

great! thanks for the confirmation.

but r.stream.extract compilation fails.

...

Bellow is the r.stream.order compilation log error.

...

make[1]: Leaving directory

ok, so actually it built ok, but fails during installation:

Installing r.stream.order...

...

/usr/bin/install: cannot stat

aka the "install" program is not installed.

No idea what provides that on your linux distro, on Debian and Ubuntu
it comes in the "coreutils" package.

Hamish

I do have /usr/bin/install installed. I run Ubuntu and coreutils is
the latest version.

One small quirk though. I compiled Grass 6.5svn running make but I did
not install it (make install). I'm running it straigh from the build
directory (start script at ./bin.i686-pc-linux-gnu and binaries at
./dist.i686-pc-linux-gnu). Could that be related?

Thanks
Daniel

On Tue, Aug 31, 2010 at 10:01 PM, Hamish <hamish_b@yahoo.com> wrote:

Daniel wrote:

Ok, g.extension works and downloads svn addons

great! thanks for the confirmation.

but r.stream.extract compilation fails.

...

Bellow is the r.stream.order compilation log error.

...

make[1]: Leaving directory

ok, so actually it built ok, but fails during installation:

Installing r.stream.order...

...

/usr/bin/install: cannot stat

aka the "install" program is not installed.

No idea what provides that on your linux distro, on Debian and Ubuntu
it comes in the "coreutils" package.

Hamish

I just issued "make install" and installed grass65 at
/usr/local/grass-6.5.svn. Now, g.extension tries to install
r.stream.order but complains about permissions. Taking ownership of
the install dir fixes the problem. So, what would be the "correct" way
to use g.extension, run grass as root or take ownership of the install
dir?

Cheers
Daniel

On Wed, Sep 1, 2010 at 2:39 AM, Markus Neteler <neteler@osgeo.org> wrote:

Yes, that's the reason then (same here).
We need to add a condition to skip the install ste in this case.

Markus

On 9/1/10, Daniel Victoria <daniel.victoria@gmail.com> wrote:

I do have /usr/bin/install installed. I run Ubuntu and coreutils is
the latest version.

One small quirk though. I compiled Grass 6.5svn running make but I did
not install it (make install). I'm running it straigh from the build
directory (start script at ./bin.i686-pc-linux-gnu and binaries at
./dist.i686-pc-linux-gnu). Could that be related?

Thanks
Daniel

On Tue, Aug 31, 2010 at 10:01 PM, Hamish <hamish_b@yahoo.com> wrote:

Daniel wrote:

Ok, g.extension works and downloads svn addons

great! thanks for the confirmation.

but r.stream.extract compilation fails.

...

Bellow is the r.stream.order compilation log error.

...

make[1]: Leaving directory

ok, so actually it built ok, but fails during installation:

Installing r.stream.order...

...

/usr/bin/install: cannot stat

aka the "install" program is not installed.

No idea what provides that on your linux distro, on Debian and Ubuntu
it comes in the "coreutils" package.

Hamish

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

Daniel Victoria wrote:

I just issued "make install" and installed grass65 at
/usr/local/grass-6.5.svn. Now, g.extension tries to install
r.stream.order but complains about permissions. Taking ownership of
the install dir fixes the problem. So, what would be the "correct" way
to use g.extension, run grass as root or take ownership of the install
dir?

Maybe you could just ignore the install-related error messages and
check if r.stream.order is available when you are running grass
"straight from the build directory (start script at
./bin.i686-pc-linux-gnu and binaries at ./dist.i686-pc-linux-gnu)"

In this case, i.e. running grass from the build directory, you could
download any addon to the appropriate directory, run make and it
should be available (not sure about manuals though, which are
important...) when running grass from the build directory.

Otherwise, if you installed grass as root (make install as root), you
most probably also have to install addons as root.

HTH,

Markus M

Cheers
Daniel

Markus Neteler wrote:

Yes, that's the reason then (same here).
We need to add a condition to skip the install ste in this case.

Markus

Daniel Victoria wrote:

I do have /usr/bin/install installed. I run Ubuntu and coreutils is
the latest version.

One small quirk though. I compiled Grass 6.5svn running make but I did
not install it (make install). I'm running it straigh from the build
directory (start script at ./bin.i686-pc-linux-gnu and binaries at
./dist.i686-pc-linux-gnu). Could that be related?

Thanks
Daniel

Hamish wrote:

Daniel wrote:

Ok, g.extension works and downloads svn addons

great! thanks for the confirmation.

but r.stream.extract compilation fails.

...

Bellow is the r.stream.order compilation log error.

...

make[1]: Leaving directory

ok, so actually it built ok, but fails during installation:

Installing r.stream.order...

...

/usr/bin/install: cannot stat

aka the "install" program is not installed.

No idea what provides that on your linux distro, on Debian and Ubuntu
it comes in the "coreutils" package.

Hamish

On Wed, Sep 1, 2010 at 8:52 PM, Markus Metz
<markus.metz.giswork@googlemail.com> wrote:

Daniel Victoria wrote:

I just issued "make install" and installed grass65 at
/usr/local/grass-6.5.svn. Now, g.extension tries to install
r.stream.order but complains about permissions. Taking ownership of
the install dir fixes the problem. So, what would be the "correct" way
to use g.extension, run grass as root or take ownership of the install
dir?

Maybe you could just ignore the install-related error messages and
check if r.stream.order is available when you are running grass
"straight from the build directory (start script at
./bin.i686-pc-linux-gnu and binaries at ./dist.i686-pc-linux-gnu)"

In this case, i.e. running grass from the build directory, you could
download any addon to the appropriate directory, run make and it
should be available (not sure about manuals though, which are
important...) when running grass from the build directory.

Otherwise, if you installed grass as root (make install as root), you
most probably also have to install addons as root.

Perhaps we need to add some sudo magic...?

Markus

Markus Neteler:

Markus Metz:

Daniel Victoria wrote:

I just issued "make install" and installed grass65 at
/usr/local/grass-6.5.svn. Now, g.extension tries to install
r.stream.order but complains about permissions. Taking ownership of
the install dir fixes the problem. So, what would be the "correct" way
to use g.extension, run grass as root or take ownership of the install
dir?

Maybe you could just ignore the install-related error messages and
check if r.stream.order is available when you are running grass
"straight from the build directory (start script at
./bin.i686-pc-linux-gnu and binaries at ./dist.i686-pc-linux-gnu)"

In this case, i.e. running grass from the build directory, you could
download any addon to the appropriate directory, run make and it
should be available (not sure about manuals though, which are
important...) when running grass from the build directory.

Otherwise, if you installed grass as root (make install as root), you
most probably also have to install addons as root.

Perhaps we need to add some sudo magic...?

Probably yes. The standard situation might be that a user installs
from a repository grass and grass-devel (or simliar) which usually
requires root privileges. In turm g.extension will require root
priviliges. Right?

Markus M

> Otherwise, if you installed grass as root (make install as root), you
> most probably also have to install addons as root.

Markus Neteler wrote:

Perhaps we need to add some sudo magic...?

will that work with MSys? (does g.extension work at all with standalone
WinGrass?)

addons should really be installed to $GRASS_ADDON_PATH, right? not $GISBASE
(typically that will be read-only if GRASS came from a package; GISBASE is
the default for prefix= currently).

maybe have a test at the start of the script to see if GRASS_ADDON_PATH
exists and if it does use that as the default for prefix= instead of GISBASE? (n.b. $GRASS_ADDON_PATH/ replaces to $GISBASE/bin, not $GISBASE/)

either way, the short term solution seems to be another paragraph in the
help page to explain all this.

Hamish

ps- I suspect 'svn commit' uploaded a bit more than you planned in this one:
  https://trac.osgeo.org/grass/changeset/43379

Hamish wrote:

> > Otherwise, if you installed grass as root (make install as root), you
> > most probably also have to install addons as root.
Markus Neteler wrote:
> Perhaps we need to add some sudo magic...?

will that work with MSys? (does g.extension work at all with standalone
WinGrass?)

addons should really be installed to $GRASS_ADDON_PATH, right? not $GISBASE
(typically that will be read-only if GRASS came from a package; GISBASE is
the default for prefix= currently).

On a system where GRASS itself has been installed from a "package"
(RPM or similar), the installation probably shouldn't be modified
other than via the OS' own administration tools.

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

On Thu, Sep 2, 2010 at 8:44 AM, Hamish <hamish_b@yahoo.com> wrote:
...

ps- I suspect 'svn commit' uploaded a bit more than you planned in this one:
https://trac.osgeo.org/grass/changeset/43379

Yes, but reverted that immediately
https://trac.osgeo.org/grass/changeset/43385

Please double check...

Markus

On Thu, Sep 2, 2010 at 9:08 PM, Glynn Clements <glynn@gclements.plus.com> wrote:

Hamish wrote:...

(does g.extension work at all with standalone WinGrass?)

To my knowledge only the Python version in GRASS 7.

addons should really be installed to $GRASS_ADDON_PATH, right? not $GISBASE
(typically that will be read-only if GRASS came from a package; GISBASE is
the default for prefix= currently).

On a system where GRASS itself has been installed from a "package"
(RPM or similar), the installation probably shouldn't be modified
other than via the OS' own administration tools.

Right - I replace my sudo suggestion with $GRASS_ADDON_PATH magic :slight_smile:

Markus