[GRASS-dev] Grass SVN in Android, display issue

Hi all,

I am looking for ways to display wxGUI of GRASS (trunk version) in Android.

The problem is that Android is not bound to X server, and that Linux images are directing their display to localhost:0 instead of X:0

So what happens is that you can view Ubuntu Unity in a VNC client bound to localhost:0
However when starting GRASS GIS, the wxGUI is sent to X:0, which of course does not go anywhere near the VNC port.

Could you tell me where to go to redirect the wxGUI display to localhost:0 explicitely?

Thank you
Yann

Chemin, Yann (IWMI) wrote:

I am looking for ways to display wxGUI of GRASS (trunk version) in
Android.

The problem is that Android is not bound to X server, and that Linux
images are directing their display to localhost:0 instead of X:0

So what happens is that you can view Ubuntu Unity in a VNC client
bound to localhost:0

However when starting GRASS GIS, the wxGUI is sent to X:0, which of
course does not go anywhere near the VNC port.

Could you tell me where to go to redirect the wxGUI display to
localhost:0 explicitely?

X toolkits connect to the display specified by the DISPLAY environment
variable.

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

On Mon, Sep 17, 2012 at 5:47 AM, Chemin, Yann (IWMI) <Y.Chemin@cgiar.org> wrote:

Hi all,

I am looking for ways to display wxGUI of GRASS (trunk version) in Android.

Just curious: did you compile GRASS 7 on Android?

I just tried with a cross compiled
(arm-gp2x-linux-gcc-c++-4.1.2-13.fc17.x86_64),
using Marco Bernasocchi build scripts from QGIS
and got quite a bit compiled.

A few issues are in the library part:

ls.c: In function 'G_ls_format':
ls.c:173: error: storage size of 'size' isn't known
make[3]: *** [OBJ.arm-unknown-linux-androideabi/ls.o] Error 1
make[3]: Leaving directory `/home/neteler/grass70/lib/gis'

--> use #ifdef __ANDROID__ ?

Then:

cd OBJ.arm-unknown-linux-androideabi &&
GISRC=/home/neteler/grass70/dist.arm-unknown-linux-androideabi/demolocation/.grassrc70
GISBASE=/home/neteler/grass70/dist.arm-unknown-linux-androideabi
PATH="/home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin:/home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin:$PATH"
PYTHONPATH="/home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/python:/home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/python:$PYTHONPATH"
LD_LIBRARY_PATH="/home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin:/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib:/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib:"
LC_ALL=C ./test
/bin/sh: ./test: cannot execute binary file
make[5]: *** [OBJ.arm-unknown-linux-androideabi/test.tmp] Error 126
make[5]: Leaving directory `/home/neteler/grass70/lib/vector/diglib'

Some Makefile issues:

rm -f /home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/VERSIONNUMBER
/usr/bin/install -c prompt.py
/home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/prompt.py
make[3]: *** No rule to make target
`/home/neteler/grass70/dist.arm-unknown-linux-androideabi/docs/html/help_loc_struct.png',
needed by `default'. Stop.
make[3]: *** Waiting for unfinished jobs....
chmod +r /home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/VERSIONNUMBER
chmod +r /home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/license
make[3]: Leaving directory `/home/neteler/grass70/lib/init'

test -d OBJ.arm-unknown-linux-androideabi || mkdir -p
OBJ.arm-unknown-linux-androideabi
make[4]: *** No rule to make target
`/home/neteler/grass70/dist.arm-unknown-linux-androideabi/docs/html/grass-dbf.html',
needed by `db_html'. Stop.
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/home/neteler/grass70/db/drivers/dbf'

make[4]: *** No rule to make target
`/home/neteler/grass70/dist.arm-unknown-linux-androideabi/docs/html/grass-ogr.html',
needed by `db_html'. Stop.
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/home/neteler/grass70/db/drivers/ogr'

Eventually I didn't get the link to PROJ4 right, so subsequent compilation
of modules depending on that naturally fails. But I didn't spend time on
this.

Not sure how to solve above issues:

Markus

PS: Maybe it is useless to run GRASS on Android but maybe not.. :slight_smile:

Hi Markus,

Rooted the Android 4.0.3, installed an Ubuntu arm img, apt-get update, apt-get install grass-dev, apt-get install <additional GRASS dep>, svn co trunk , conf, make, make install, (compiled required stuff within the img Linux CLI), got stuck with GUI, but eventually all went well as androidVNC has a Send Key button (ctrl+shift+t calls the terminal in Ubuntu, then it is as usual: grass70 is responding well).

On Archos 80 g9 Turbo (dual-core) I thought make -j2 would do it, bad idea, /tmp gets flooded and just refuses files with a no space left warning.

Would like to indulge in your version of things, let us speak a bit off ML. However, there will be a problem: GUI.
wxPython is not even close to alpha release on Android. So it will be a problem down the road.

Why GRASS GIS on Android? For fun first, for work later. Did learn few things on the way, that was fun. I needed a half Kg programming machine for on-the-road GRASS/GDAL stuff with OpenMP, thought that if GRASS would compile its trunk in one way or another in that dual-core Android, then I would be keeping the device and ditch nettop/micro-laptop etc...

Cheers,
Yann

________________________________________
From: neteler.osgeo@gmail.com [neteler.osgeo@gmail.com] on behalf of Markus Neteler [neteler@osgeo.org]
Sent: Tuesday, September 18, 2012 2:25 AM
To: Chemin, Yann (IWMI)
Cc: GRASS developers list
Subject: Re: [GRASS-dev] Grass SVN in Android, display issue

On Mon, Sep 17, 2012 at 5:47 AM, Chemin, Yann (IWMI) <Y.Chemin@cgiar.org> wrote:

Hi all,

I am looking for ways to display wxGUI of GRASS (trunk version) in Android.

Just curious: did you compile GRASS 7 on Android?

I just tried with a cross compiled
(arm-gp2x-linux-gcc-c++-4.1.2-13.fc17.x86_64),
using Marco Bernasocchi build scripts from QGIS
and got quite a bit compiled.

A few issues are in the library part:

ls.c: In function 'G_ls_format':
ls.c:173: error: storage size of 'size' isn't known
make[3]: *** [OBJ.arm-unknown-linux-androideabi/ls.o] Error 1
make[3]: Leaving directory `/home/neteler/grass70/lib/gis'

--> use #ifdef __ANDROID__ ?

Then:

cd OBJ.arm-unknown-linux-androideabi &&
GISRC=/home/neteler/grass70/dist.arm-unknown-linux-androideabi/demolocation/.grassrc70
GISBASE=/home/neteler/grass70/dist.arm-unknown-linux-androideabi
PATH="/home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin:/home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin:$PATH"
PYTHONPATH="/home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/python:/home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/python:$PYTHONPATH"
LD_LIBRARY_PATH="/home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin:/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib:/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib:"
LC_ALL=C ./test
/bin/sh: ./test: cannot execute binary file
make[5]: *** [OBJ.arm-unknown-linux-androideabi/test.tmp] Error 126
make[5]: Leaving directory `/home/neteler/grass70/lib/vector/diglib'

Some Makefile issues:

rm -f /home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/VERSIONNUMBER
/usr/bin/install -c prompt.py
/home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/prompt.py
make[3]: *** No rule to make target
`/home/neteler/grass70/dist.arm-unknown-linux-androideabi/docs/html/help_loc_struct.png',
needed by `default'. Stop.
make[3]: *** Waiting for unfinished jobs....
chmod +r /home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/VERSIONNUMBER
chmod +r /home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/license
make[3]: Leaving directory `/home/neteler/grass70/lib/init'

test -d OBJ.arm-unknown-linux-androideabi || mkdir -p
OBJ.arm-unknown-linux-androideabi
make[4]: *** No rule to make target
`/home/neteler/grass70/dist.arm-unknown-linux-androideabi/docs/html/grass-dbf.html',
needed by `db_html'. Stop.
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/home/neteler/grass70/db/drivers/dbf'

make[4]: *** No rule to make target
`/home/neteler/grass70/dist.arm-unknown-linux-androideabi/docs/html/grass-ogr.html',
needed by `db_html'. Stop.
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/home/neteler/grass70/db/drivers/ogr'

Eventually I didn't get the link to PROJ4 right, so subsequent compilation
of modules depending on that naturally fails. But I didn't spend time on
this.

Not sure how to solve above issues:

Markus

PS: Maybe it is useless to run GRASS on Android but maybe not.. :slight_smile:

Markus N wrote:

PS: Maybe it is useless to run GRASS on Android but maybe not.. :slight_smile:

on-site field data entry tool & swiss army knife.

best,
Hamish

+1 to Hamish needs

Question is do we want to have a dev environment in Android, or just a GIS tool running without CLI ?

________________________________________
From: Hamish [hamish_b@yahoo.com]
Sent: Tuesday, September 18, 2012 10:59 AM
To: Chemin, Yann (IWMI); Markus Neteler
Cc: GRASS developers list
Subject: Re: [GRASS-dev] Grass SVN in Android, display issue

Markus N wrote:

PS: Maybe it is useless to run GRASS on Android but maybe not.. :slight_smile:

on-site field data entry tool & swiss army knife.

best,
Hamish

>Markus N wrote:
>> PS: Maybe it is useless to run GRASS on Android but maybe not.. :)
Hamish B. Wrote:
>on-site field data entry tool & swiss army knife.
Highly Agree! I can see this being very useful.

Doug

Doug Newcomb
USFWS
Raleigh, NC
919-856-4520 ext. 14 doug_newcomb@fws.gov

The opinions I express are my own and are not representative of the official policy of the U.S.Fish and Wildlife Service or Dept. of the Interior. Life is too short for undocumented, proprietary data formats.

Markus Neteler wrote:

A few issues are in the library part:

ls.c: In function 'G_ls_format':
ls.c:173: error: storage size of 'size' isn't known
make[3]: *** [OBJ.arm-unknown-linux-androideabi/ls.o] Error 1
make[3]: Leaving directory `/home/neteler/grass70/lib/gis'

--> use #ifdef __ANDROID__ ?

If the platform defines TIOCGWINSZ, you'd think that it would define
"struct winsize" somewhere; although it's anyone's guess as to where
(on Linux, it's in <sys/ioctl.h>).

There really needs to be a configure check; failing that, the code
should just be removed.

/bin/sh: ./test: cannot execute binary file
make[5]: *** [OBJ.arm-unknown-linux-androideabi/test.tmp] Error 126
make[5]: Leaving directory `/home/neteler/grass70/lib/vector/diglib'

This should be fixed by r53200.

Some Makefile issues:

rm -f /home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/VERSIONNUMBER
/usr/bin/install -c prompt.py
/home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/prompt.py
make[3]: *** No rule to make target
`/home/neteler/grass70/dist.arm-unknown-linux-androideabi/docs/html/help_loc_struct.png',
needed by `default'. Stop.

Try r53206.

make[4]: *** No rule to make target
`/home/neteler/grass70/dist.arm-unknown-linux-androideabi/docs/html/grass-dbf.html',
needed by `db_html'. Stop.
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/home/neteler/grass70/db/drivers/dbf'

This might be fixed by r53206.

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

On Tue, Sep 18, 2012 at 3:39 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Markus Neteler wrote:

ls.c: In function 'G_ls_format':

...

If the platform defines TIOCGWINSZ, you'd think that it would define
"struct winsize" somewhere; although it's anyone's guess as to where
(on Linux, it's in <sys/ioctl.h>).

I see it here:

[neteler@north necessitas]$ find . -type f | xargs grep TIOCGWINSZ
...
./android-ndk-r7b/platforms/android-14/arch-arm/usr/include/asm/ioctls.h:#define
TIOCGWINSZ 0x5413
./android-9-standalonetoolchain/sysroot/usr/include/asm/ioctls.h:#define
TIOCGWINSZ 0x5413

and
...
./android-ndk-r7b/platforms/android-14/arch-arm/usr/include/asm/termios.h:struct
winsize {

I have (hopefully) fixed the includes in r53207, now libgis compiles.

Your other fixes are well received by the cross compiler, thanks.

The next and last library issue after the irrelevant "form" library is:

clean_temp.c:35: error: conflicting types for '__errno'
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../sysroot/usr/include/errno.h:48:
note: previous declaration of '__errno' was here
lock.c:29: error: conflicting types for '__errno'
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../sysroot/usr/include/errno.h:48:
note: previous declaration of '__errno' was here
make[3]: *** [OBJ.arm-unknown-linux-androideabi/clean_temp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [OBJ.arm-unknown-linux-androideabi/lock.o] Error 1

In android-9-standalonetoolchain/bin/../sysroot/usr/include/errno.h,
there is (white space compressed by me):
/* internal function that should *only* be called from system calls */
/* use errno = xxxx instead in C code */
extern int __set_errno(int error);
/* internal function returning the address of the thread-specific errno */
extern volatile int* __errno(void);
/* a macro expanding to the errno l-value */
#define errno (*__errno())

Then a series of modules are not compiled due to this issue:

arm-linux-androideabi-gcc
-I/home/neteler/grass70/android/out/armeabi/include -DANDROID=ON
-Wno-psabi -O2 -mthumb
-I/home/neteler/grass70/android/out/armeabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass64/android/out/armeabi/include
-DPACKAGE=\""grassmods"\"
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include -o
OBJ.arm-unknown-linux-androideabi/area.o -c area.c
: && arm-linux-androideabi-gcc
-L/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib
-L/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib
-Wl,--fix-cortex-a8 -Wl,--export-dynamic
-L/home/neteler/grass70/android/out/armeabi/lib
-L/home/neteler/software/necessitas/android-9-standalonetoolchain/lib/
-Wl,-rpath-link,/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib
-o /home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin/d.vect.chart
OBJ.arm-unknown-linux-androideabi/pie.o
OBJ.arm-unknown-linux-androideabi/plot.o
OBJ.arm-unknown-linux-androideabi/main.o
OBJ.arm-unknown-linux-androideabi/bar.o -lgrass_display.7.0.svn
-lgrass_vector.7.0.svn -lgrass_dbmiclient.7.0.svn
-lgrass_dbmibase.7.0.svn -lgrass_gis.7.0.svn -lm -lm
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld:
warning: libgdal.so, needed by
/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib/libgrass_vector.7.0.svn.so,
not found (try using -rpath or -rpath-link)
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld:
warning: libproj.so.0, needed by
/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib/libgrass_gproj.7.0.svn.so,
not found (try using -rpath or -rpath-link)
/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib/libgrass_vector.7.0.svn.so:
undefined reference to `OGRGetDriverByName'
/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib/libgrass_vector.7.0.svn.so:
undefined reference to `OGR_G_AddPoint'
/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib/libgrass_vector.7.0.svn.so:
undefined reference to `OGR_G_AddGeometry'
/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib/libgrass_gproj.7.0.svn.so:
undefined reference to `OSRIsProjected'
...
/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib/libgrass_gproj.7.0.svn.so:
undefined reference to `pj_strerrno'
/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib/libgrass_gproj.7.0.svn.so:
undefined reference to `pj_init'
...

This affects a series of d.*, g.*, i.* and also v.* modules.
All r3.* are not compiled due to the remaining XDR issue (maybe
irrelevant for now).

All r.* are compiled successfully.

Markus

Markus Neteler wrote:

I have (hopefully) fixed the includes in r53207, now libgis compiles.

You probably shouldn't be including either of those headers directly.
I suspect that the "correct" fix is just:

  #ifdef HAVE_TERMIOS_H
  #include <termios.h>
  #endif

The next and last library issue after the irrelevant "form" library is:

clean_temp.c:35: error: conflicting types for '__errno'
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../sysroot/usr/include/errno.h:48:
note: previous declaration of '__errno' was here
lock.c:29: error: conflicting types for '__errno'
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../sysroot/usr/include/errno.h:48:
note: previous declaration of '__errno' was here

Try r53215.

Then a series of modules are not compiled due to this issue:

/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld:
warning: libgdal.so, needed by
/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib/libgrass_vector.7.0.svn.so,
not found (try using -rpath or -rpath-link)

You probably need to use e.g.:

  LDFLAGS=-Wl,-rpath-link,/path/to/lib ./configure ...

where /path/to/lib is the directory containing the Android version of
libgdal.so.

For a native build, this isn't normally an issue, as the libraries
will be in ld.so.cache or $LD_LIBRARY_PATH (otherwise the programs
won't run).

Having configure add the necessary flags is complicated, as there
needs to be a flag (or set of flags) for each directory, but the flags
are platform-specific.

All r3.* are not compiled due to the remaining XDR issue (maybe
irrelevant for now).

r53219 has moved the XDR functions from lib/raster to lib/gis.
lib/raster3d should be converted to use these.

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

On Tue, Sep 18, 2012 at 11:08 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Markus Neteler wrote:

I have (hopefully) fixed the includes in r53207, now libgis compiles.

You probably shouldn't be including either of those headers directly.
I suspect that the "correct" fix is just:

        #ifdef HAVE_TERMIOS_H
        #include <termios.h>
        #endif

Right, so done in r53220. Compiles on Android as well.

...

clean_temp.c:35: error: conflicting types for '__errno'
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../sysroot/usr/include/errno.h:48:
note: previous declaration of '__errno' was here
lock.c:29: error: conflicting types for '__errno'
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../sysroot/usr/include/errno.h:48:
note: previous declaration of '__errno' was here

Try r53215.

This compiles now.

Then a series of modules are not compiled due to this issue:

/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld:
warning: libgdal.so, needed by
/home/neteler/grass70/dist.arm-unknown-linux-androideabi/lib/libgrass_vector.7.0.svn.so,
not found (try using -rpath or -rpath-link)

You probably need to use e.g.:

        LDFLAGS=-Wl,-rpath-link,/path/to/lib ./configure ...

where /path/to/lib is the directory containing the Android version of
libgdal.so.

Very nice, this helps.
...

All r3.* are not compiled due to the remaining XDR issue (maybe
irrelevant for now).

r53219 has moved the XDR functions from lib/raster to lib/gis.
lib/raster3d should be converted to use these.

OK - a todo.
This also affects several g.* modules and v.colors, v.surf.bspline and
some more
vector modules which link the G3D library, no surprise of course.

BTW: After the configure, I always have to manually comment this line:
include/Make/Platform.make
#XDRLIB = @XDRLIB@

... the I can compile (more).

Further issues:

* lib/form/ (just for the record) - the same in ximgview:

make[3]: Entering directory `/home/neteler/grass70/lib/form'
arm-linux-androideabi-gcc
-I/home/neteler/grass70/android/out/armeabi/include -DANDROID=ON
-Wno-psabi -O2 -mthumb -fPIC
-I/home/neteler/grass70/android/out/armeabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/usr/include -DPACKAGE=\""grasslibs"\"
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include -o
OBJ.arm-unknown-linux-androideabi/generate.o -c generate.c
In file included from /usr/include/features.h:386,
                 from /usr/include/stdlib.h:25,
                 from generate.c:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
make[3]: *** [OBJ.arm-unknown-linux-androideabi/generate.o] Error 1
make[3]: Leaving directory `/home/neteler/grass70/lib/form'

* r.mapcalc
/bin/sh: /home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin/r.mapcalc:
cannot execute binary file

* v.extract

arm-linux-androideabi-gcc
-I/home/neteler/grass70/android/out/armeabi/include -DANDROID=ON
-Wno-psabi -O2 -mthumb
-I/home/neteler/grass70/android/out/armeabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass64/android/out/armeabi/include
-DPACKAGE=\""grassmods"\"
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include -o
OBJ.arm-unknown-linux-androideabi/main.o -c main.c
main.c:27:20: error: search.h: No such file or directory
make[3]: *** [OBJ.arm-unknown-linux-androideabi/main.o] Error 1
make[3]: Leaving directory `/home/neteler/grass70/vector/v.extract'

* v.kcv
OBJ.arm-unknown-linux-androideabi/utils.o: In function `myrand':
utils.c:(.text+0x2): undefined reference to `rand'
collect2: ld returned 1 exit status
make[3]: *** [/home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin/v.kcv

So, a high percentage of the GRASS modules do compile now (186
compiled, 34 fail, most
of them due to the G3D lib XDR issue).

Markus

Markus Neteler wrote:

> r53219 has moved the XDR functions from lib/raster to lib/gis.
> lib/raster3d should be converted to use these.

OK - a todo.
This also affects several g.* modules and v.colors, v.surf.bspline and
some more
vector modules which link the G3D library, no surprise of course.

That will include g.region, which is fairly essential. Also,
g.{copy,rename,remove,list}, as lib/manage had a gratuitous dependency
on the raster3d library (fixed in r53230).

BTW: After the configure, I always have to manually comment this line:
include/Make/Platform.make
#XDRLIB = @XDRLIB@

... the I can compile (more).

Currently, the configure script shouldn't abort if it can't find the
XDR functions. If you remove the AC_MSG_ERROR, you need to add XDRLIB=
so that it's always defined.

Further issues:

* lib/form/ (just for the record) - the same in ximgview:

In file included from /usr/include/features.h:386,
                 from /usr/include/stdlib.h:25,
                 from generate.c:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory

The error originates with <stdlib.h> on the first line of the file, so
the only thing which can affect it is the compiler switches. lib/form
adds $(XCFLAGS) $(TCLINCDIR) $(TKINCDIR) while ximgview adds
$(XCFLAGS) $(XMINC). $(XCFLAGS) is a likely candidate; that isn't
something we can easily fix.

* r.mapcalc
/bin/sh: /home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin/r.mapcalc:
cannot execute binary file

This should be fixed by r53231.

* v.extract

main.c:27:20: error: search.h: No such file or directory

Fixed in r53232. <search.h> wasn't being used for anything (bsearch()
is C89, and is declared in <stdlib.h>).

* v.kcv
OBJ.arm-unknown-linux-androideabi/utils.o: In function `myrand':
utils.c:(.text+0x2): undefined reference to `rand'

v.kcv/utils.c included a local prototype for rand() rather than
including <stdlib.h>. That won't work if rand() is a macro. This
should be fixed by r53234.

More generally: local prototypes should never be used. For library
functions, the library's headers should be used. Functions which are
defined in a module should be declared in a header which is included
by the source file which defines the function plus any source files
which reference it.

So, a high percentage of the GRASS modules do compile now (186
compiled, 34 fail, most of them due to the G3D lib XDR issue).

I'll look into the G3D XDR issue.

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

Glynn Clements wrote:

Currently, the configure script shouldn't abort if it can't find the
XDR functions. If you remove the AC_MSG_ERROR, you need to add XDRLIB=
so that it's always defined.

That should have said "... should abort if ...".

> So, a high percentage of the GRASS modules do compile now (186
> compiled, 34 fail, most of them due to the G3D lib XDR issue).

I'll look into the G3D XDR issue.

Can someone test the attached patch? Not necessarily on Android; the
first priority is ensuring that it doesn't break anything on existing
platforms.

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

(attachments)

raster3d.diff (18.3 KB)

On Wed, Sep 19, 2012 at 3:19 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:
...

So, a high percentage of the GRASS modules do compile now (186
compiled, 34 fail, most of them due to the G3D lib XDR issue).

Wonderful, all patches solve the previously indicated problems.
Remaining are lib/form/ (who cares..) and this one:

/home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin/g.mkfontcap
-s > /home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/fontcap
/bin/sh: /home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin/g.mkfontcap:
cannot execute binary file

The rest is G3D - XDR related.

I'll look into the G3D XDR issue.

Thanks for this (and the subsequent patch which is to be tested).

Markus

On Wed, Sep 19, 2012 at 4:22 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:
...

I'll look into the G3D XDR issue.

Can someone test the attached patch? Not necessarily on Android; the
first priority is ensuring that it doesn't break anything on existing
platforms.

I have applied it locally and used the slovakia3D data set:
http://www.grassbook.org/data_menu2nd.php
-> Slovakia 3D precipitation data

Reading the data is not an issue, I tried with wxNVIZ.
I didn't test writing yet.

Markus

Markus Neteler wrote:

/home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin/g.mkfontcap
-s > /home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/fontcap
/bin/sh: /home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin/g.mkfontcap:
cannot execute binary file

This should be fixed by r53237.

You'll need to run g.mkfontcap on the target system to build the
fontcap file. But ideally that should be done even when not
cross-compiling; in general, there's no reason to assume that the
target system has the same fonts as the build system.

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

On Thu, Sep 20, 2012 at 9:08 AM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Markus Neteler wrote:

/home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin/g.mkfontcap
-s > /home/neteler/grass70/dist.arm-unknown-linux-androideabi/etc/fontcap
/bin/sh: /home/neteler/grass70/dist.arm-unknown-linux-androideabi/bin/g.mkfontcap:
cannot execute binary file

This should be fixed by r53237.

Thanks again.

All GRASS 7 now compiles with the Android cross-compiler (after taking out
XDR from configure[.in]) except for these two:

make[4]: Entering directory `/home/neteler/grass70/raster/r.terraflow'
test -d OBJ.arm-unknown-linux-androideabi || mkdir -p
OBJ.arm-unknown-linux-androideabi
arm-linux-androideabi-g++
-I/home/neteler/grass70/android/out/armeabi/include -DANDROID=ON
-Wno-psabi -O2 -mthumb -std=gnu++0x
-I/home/neteler/grass70/android/out/armeabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-DUSER=\"neteler\" -DNODATA_FIX -DELEV_FLOAT -Wno-sign-compare
-DPACKAGE=\""grassmods"\"
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include -o
OBJ.arm-unknown-linux-androideabi/stats.o -c stats.cpp
arm-linux-androideabi-g++
-I/home/neteler/grass70/android/out/armeabi/include -DANDROID=ON
-Wno-psabi -O2 -mthumb -std=gnu++0x
-I/home/neteler/grass70/android/out/armeabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-DUSER=\"neteler\" -DNODATA_FIX -DELEV_FLOAT -Wno-sign-compare
-DPACKAGE=\""grassmods"\"
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include -o
OBJ.arm-unknown-linux-androideabi/weightWindow.o -c weightWindow.cpp
arm-linux-androideabi-g++
-I/home/neteler/grass70/android/out/armeabi/include -DANDROID=ON
-Wno-psabi -O2 -mthumb -std=gnu++0x
-I/home/neteler/grass70/android/out/armeabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-DUSER=\"neteler\" -DNODATA_FIX -DELEV_FLOAT -Wno-sign-compare
-DPACKAGE=\""grassmods"\"
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include -o
OBJ.arm-unknown-linux-androideabi/direction.o -c direction.cpp
direction.cpp: In function 'direction_type encodeDirectionMFD(const
genericWindow<float>&, dimension_type, dimension_type, dimension_type,
dimension_type)':
direction.cpp:56: error: reference to 'is_void' is ambiguous
nodata.h:40: error: candidates are: int is_void(elevation_type)
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/tr1_impl/type_traits:96:
error: template<class _Tp> struct std::is_void
direction.cpp:56: error: reference to 'is_void' is ambiguous
nodata.h:40: error: candidates are: int is_void(elevation_type)
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/tr1_impl/type_traits:96:
error: template<class _Tp> struct std::is_void
direction.cpp:57: error: reference to 'is_void' is ambiguous
nodata.h:40: error: candidates are: int is_void(elevation_type)
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/tr1_impl/type_traits:96:
error: template<class _Tp> struct std::is_void
direction.cpp:57: error: reference to 'is_void' is ambiguous
nodata.h:40: error: candidates are: int is_void(elevation_type)
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/tr1_impl/type_traits:96:
error: template<class _Tp> struct std::is_void
direction.cpp:59: error: reference to 'is_void' is ambiguous
nodata.h:40: error: candidates are: int is_void(elevation_type)
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/tr1_impl/type_traits:96:
error: template<class _Tp> struct std::is_void
direction.cpp:59: error: reference to 'is_void' is ambiguous
nodata.h:40: error: candidates are: int is_void(elevation_type)
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/tr1_impl/type_traits:96:
error: template<class _Tp> struct std::is_void
direction.cpp:60: error: reference to 'is_void' is ambiguous
nodata.h:40: error: candidates are: int is_void(elevation_type)
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/tr1_impl/type_traits:96:
error: template<class _Tp> struct std::is_void
direction.cpp:60: error: reference to 'is_void' is ambiguous
nodata.h:40: error: candidates are: int is_void(elevation_type)
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/tr1_impl/type_traits:96:
error: template<class _Tp> struct std::is_void
make[4]: *** [OBJ.arm-unknown-linux-androideabi/direction.o] Error 1
make[4]: Leaving directory `/home/neteler/grass70/raster/r.terraflow'

and

make[4]: Entering directory `/home/neteler/grass70/raster/r.viewshed'
test -d OBJ.arm-unknown-linux-androideabi || mkdir -p
OBJ.arm-unknown-linux-androideabi
arm-linux-androideabi-g++
-I/home/neteler/grass70/android/out/armeabi/include -DANDROID=ON
-Wno-psabi -O2 -mthumb -std=gnu++0x
-I/home/neteler/grass70/android/out/armeabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-DUSER=\"neteler\" -Wno-sign-compare -DPACKAGE=\""grassmods"\"
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include -o
OBJ.arm-unknown-linux-androideabi/grid.o -c grid.cpp
arm-linux-androideabi-g++
-I/home/neteler/grass70/android/out/armeabi/include -DANDROID=ON
-Wno-psabi -O2 -mthumb -std=gnu++0x
-I/home/neteler/grass70/android/out/armeabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-DUSER=\"neteler\" -Wno-sign-compare -DPACKAGE=\""grassmods"\"
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include -o
OBJ.arm-unknown-linux-androideabi/viewshed.o -c viewshed.cpp
viewshed.cpp: In function 'MemoryVisibilityGrid*
viewshed_in_memory(char*, GridHeader*, Viewpoint*, ViewOptions)':
viewshed.cpp:385: warning: case label value is less than minimum value for type
viewshed.cpp: In function 'IOVisibilityGrid* viewshed_external(char*,
GridHeader*, Viewpoint*, ViewOptions)':
viewshed.cpp:637: warning: case label value is less than minimum value for type
arm-linux-androideabi-g++
-I/home/neteler/grass70/android/out/armeabi/include -DANDROID=ON
-Wno-psabi -O2 -mthumb -std=gnu++0x
-I/home/neteler/grass70/android/out/armeabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-DUSER=\"neteler\" -Wno-sign-compare -DPACKAGE=\""grassmods"\"
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include -o
OBJ.arm-unknown-linux-androideabi/grass.o -c grass.cpp
arm-linux-androideabi-g++
-I/home/neteler/grass70/android/out/armeabi/include -DANDROID=ON
-Wno-psabi -O2 -mthumb -std=gnu++0x
-I/home/neteler/grass70/android/out/armeabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-DUSER=\"neteler\" -Wno-sign-compare -DPACKAGE=\""grassmods"\"
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include
-I/home/neteler/grass70/dist.arm-unknown-linux-androideabi/include -o
OBJ.arm-unknown-linux-androideabi/statusstructure.o -c
statusstructure.cpp
statusstructure.cpp: In function 'double
find_max_gradient_in_status_struct(StatusList*, double, double,
double)':
statusstructure.cpp:295: error: reference to 'is_empty' is ambiguous
statusstructure.h:92: error: candidates are: int is_empty(StatusList*)
rbbst.h:99: error: candidates are: int is_empty(RBTree*)
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/tr1_impl/type_traits:326:
error: template<class _Tp> struct std::is_empty
statusstructure.cpp:295: error: reference to 'is_empty' is ambiguous
statusstructure.h:92: error: candidates are: int is_empty(StatusList*)
rbbst.h:99: error: candidates are: int is_empty(RBTree*)
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/tr1_impl/type_traits:326:
error: template<class _Tp> struct std::is_empty
statusstructure.cpp: In function 'int is_empty(StatusList*)':
statusstructure.cpp:307: error: reference to 'is_empty' is ambiguous
statusstructure.cpp:304: error: candidates are: int is_empty(StatusList*)
rbbst.h:99: error: candidates are: int is_empty(RBTree*)
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/tr1_impl/type_traits:326:
error: template<class _Tp> struct std::is_empty
statusstructure.cpp:307: error: reference to 'is_empty' is ambiguous
statusstructure.cpp:304: error: candidates are: int is_empty(StatusList*)
rbbst.h:99: error: candidates are: int is_empty(RBTree*)
/home/neteler/software/necessitas/android-9-standalonetoolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/include/c++/4.4.3/tr1_impl/type_traits:326:
error: template<class _Tp> struct std::is_empty
make[4]: *** [OBJ.arm-unknown-linux-androideabi/statusstructure.o] Error 1

Markus

Tested in Ubuntu 12.04 64 bit
SVN compiles well all the way
________________________________________
From: grass-dev-bounces@lists.osgeo.org [grass-dev-bounces@lists.osgeo.org] on behalf of Glynn Clements [glynn@gclements.plus.com]
Sent: Wednesday, September 19, 2012 7:52 PM
To: GRASS developers list
Subject: Re: [GRASS-dev] Grass SVN in Android, display issue

Glynn Clements wrote:

Currently, the configure script shouldn't abort if it can't find the
XDR functions. If you remove the AC_MSG_ERROR, you need to add XDRLIB=
so that it's always defined.

That should have said "... should abort if ...".

> So, a high percentage of the GRASS modules do compile now (186
> compiled, 34 fail, most of them due to the G3D lib XDR issue).

I'll look into the G3D XDR issue.

Can someone test the attached patch? Not necessarily on Android; the
first priority is ensuring that it doesn't break anything on existing
platforms.

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

Markus Neteler wrote:

All GRASS 7 now compiles with the Android cross-compiler (after taking out
XDR from configure[.in]) except for these two:

make[4]: Entering directory `/home/neteler/grass70/raster/r.terraflow'

arm-linux-androideabi-g++ ... -std=gnu++0x ...

NOTE ---------------------------^^^^^^^^^^^^

direction.cpp: In function 'direction_type encodeDirectionMFD(const
genericWindow<float>&, dimension_type, dimension_type, dimension_type,
dimension_type)':
direction.cpp:56: error: reference to 'is_void' is ambiguous

C++ Technical Report 1 (aka TR1) added the <type_traits> header, which
includes a struct template named "std::tr1::is_void". C++11 (formerly
known as C++0x) moved these features from the "std::tr1" namespace to
the "std" namespace.

Nine of the r.terraflow headers have "using namespace std", which
imports the entire "std" namespace into the current namespace. So
"is_void" is now already in use by the library.

This is why "using namespace std" is a bad idea. A C++ implementation
is allowed to add whatever it wishes to the "std" namespace, so using
"using namespace std" in application code means that every single
top-level name is a potential conflict with something from "std".

The other reason why this is a bad idea is that once you've imported
the entire "std" namespace into the current namespace, there is no way
to "un-import" a specific symbol. So either is_void() will need to be
renamed, or someone will have to fix the code to eliminate the "using
namespace std" (which, from experience, is likely to be a lot of
work).

Removing the "-std=gnu++0x" flag may work in the short term (or it may
not), but in the longer term I expect C++ compilers to make C++11 the
default dialect. Eventually, you may find that libraries start
requiring C++11 (using C++ templates means that a lot of code has to
go into header files, so if a library wants to use C++11 features, its
headers will require C++11, which means any program using those
headers has to be compiled as C++11).

make[4]: Entering directory `/home/neteler/grass70/raster/r.viewshed'

statusstructure.cpp: In function 'double
find_max_gradient_in_status_struct(StatusList*, double, double, double)':
statusstructure.cpp:295: error: reference to 'is_empty' is ambiguous

Ditto; In C++11, <type_traits> also defines std::is_empty.

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

Chemin, Yann (IWMI) wrote:

Tested in Ubuntu 12.04 64 bit
SVN compiles well all the way

I know that it compiles. The question is whether it works, i.e. can
read and write the existing 3D grid format correctly.

Markus has confirmed that reading works (although we need to test all
of int, float, double), but we also need to check that grids written
with the new code can be read (using both the old and new code).

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