[GRASS-dev] Errors compiling grass6.4.0RC5 on a 64 bit Ubuntu 9.04 PC

Hi all.
I've been trying to compile grass6.4.0RC5 on my 64 bit Ubuntu 9.04 but can't overcome some troubles.

From "error.log":
/home/ferruccio/Scrivania/grass-6.4.0RC5/gui/wxpython/vdigit
/home/ferruccio/Scrivania/grass-6.4.0RC5/gui/wxpython/nviz

My configuration options:
./configure --with-tcltk-includes=/usr/include/tcl8.5/ --with-opengl-includes=/usr/include/GL/ --enable-shared --with-cxx --with-postgres --with-postgres-includes=/usr/include/postgresql/ --with-sqlite --with-odbc --with-python=/usr/bin/python2.5-config --enable-largefile --with-x --with-motif --with-cairo --with-freetype --with-nls --with-freetype-includes=/usr/include/freetype2/ --with-wxwidgets=/usr/bin/wx-config --enable-64bit --with-libs=/usr/lib64 --with-curses --with-proj-libs=/usr/local/lib/ --with-proj-share=/usr/share/proj

"Make" output in vdigit directory:
.../grass-6.4.0RC5/gui/wxpython/vdigit$ make
python setup.py build_ext --swig=/usr/bin/swig --swig-opts=-c++ --build-lib=OBJ.x86_64-unknown-linux-gnu --build-temp=OBJ.x86_64-unknown-linux-gnu
running build_ext
building '_grass6_wxvdigit' extension
swigging grass6_wxvdigit.i to grass6_wxvdigit_wrap.cpp
/usr/bin/swig -python -c++ -o grass6_wxvdigit_wrap.cpp grass6_wxvdigit.i
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPACKAGE="grasslibs" -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -I/home/ferruccio/Scrivania/grass-6.4.0RC5/dist.x86_64-unknown-linux-gnu/include -I/usr/include/gdal -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/python2.6 -c cats.cpp -o OBJ.x86_64-unknown-linux-gnu/cats.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from cats.cpp:19:
driver.h:25:20: error: Python.h: No file or directory
In file included from driver.h:26,
from cats.cpp:19:
pseudodc.h:608: error: ISO C++ forbids declaration of ‘PyObject’ with no type
pseudodc.h:608: error: expected ‘;’ before ‘*’ token
pseudodc.h:611: error: ISO C++ forbids declaration of ‘PyObject’ with no type
pseudodc.h:611: error: expected ‘;’ before ‘*’ token
error: command 'gcc' failed with exit status 1
make: *** [OBJ.x86_64-unknown-linux-gnu/_grass6_wxvdigit.so] Error 1
.../grass-6.4.0RC5/gui/wxpython/vdigit$

"Make" output in nviz directory:
...grass-6.4.0RC5/gui/wxpython/nviz$ make
python setup.py build_ext --swig=/usr/bin/swig --swig-opts=-c++ --build-lib=OBJ.x86_64-unknown-linux-gnu --build-temp=OBJ.x86_64-unknown-linux-gnu
running build_ext
building '_grass6_wxnviz' extension
swigging grass6_wxnviz.i to grass6_wxnviz_wrap.cpp
/usr/bin/swig -python -c++ -o grass6_wxnviz_wrap.cpp grass6_wxnviz.i
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPACKAGE="grasslibs" -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -I/home/ferruccio/Scrivania/grass-6.4.0RC5/dist.x86_64-unknown-linux-gnu/include -I/usr/include/gdal -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/GL/ -I/usr/include/python2.6 -c change_view.cpp -o OBJ.x86_64-unknown-linux-gnu/change_view.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from change_view.cpp:15:
nviz.h:28:20: error: Python.h: Nessun file o directory
In file included from change_view.cpp:15:
nviz.h:46: error: expected `)' before ‘*’ token
error: command 'gcc' failed with exit status 1
make: *** [OBJ.x86_64-unknown-linux-gnu/_grass6_wxnviz.so] Errore 1
.../grass-6.4.0RC5/gui/wxpython/nviz$

wxNviz doesn't work.
Probably it's a trivial issue but can't find nothing useful both in mailing-list archives and in the compilation notes in the wiki.
Any suggestion.
Thank you.
Ferruccio

Hi,

2009/7/31 Ferruccio Sarra <ferruccio.sarra@tiscali.it>:

[...]

In file included from cats.cpp:19:
driver.h:25:20: error: Python.h: No file or directory
In file included from driver.h:26,
from cats.cpp:19:

Python header is missing in your system (or it's not in the include
path). You need to configure GRASS
`--with-python=/path/to/python-config`.

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

Thank you for replying Martin.
I think the path is correct and the report after running the configure script tells it's all right

Configure option:
--with-python=/usr/bin/python2.5-config

Files and directory location:
~/grass-6.4.0RC5$ locate python2.5-config
/usr/bin/python2.5-config
~/grass-6.4.0RC5$

~/grass-6.4.0RC5$ locate Python.h
/usr/include/python2.5/Python.h
/usr/include/python2.6_d/Python.h
/usr/include/wx-2.8/wx/wxPython/wxPython.h
~/grass-6.4.0RC5$

Do I have to move the Python.h somewhere else?
(As you can see, I still don't know nearly anything about compiling issues... suggestions on "how to" and "get started" on this subject are highly appreciated :-))

Martin Landa ha scritto:

Hi,

2009/7/31 Ferruccio Sarra <ferruccio.sarra@tiscali.it>:

[...]

In file included from cats.cpp:19:
driver.h:25:20: error: Python.h: No file or directory
In file included from driver.h:26,
from cats.cpp:19:
    
Python header is missing in your system (or it's not in the include
path). You need to configure GRASS
`--with-python=/path/to/python-config`.

Martin

Ferruccio Sarra wrote:

Thank you for replying Martin.
I think the path is correct and the report after running the configure
script tells it's all right

Configure option:
--with-python=/usr/bin/python2.5-config

1. What does running:

  /usr/bin/python2.5-config --cflags

print?

2. What is the value of PYTHONINC in include/Make/Platform.make?

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

Glynn Clements ha scritto:

1. What does running:

  /usr/bin/python2.5-config --cflags

print?
  

~$ /usr/bin/python2.5-config --cflags
-I/usr/include/python2.5 -I/usr/include/python2.5 -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes
~$

2. What is the value of PYTHONINC in include/Make/Platform.make?
  

PYTHONINC = -I/usr/include/python2.5 -I/usr/include/python2.5

Ferruccio Sarra wrote:

Glynn Clements ha scritto:
> 1. What does running:
>
> /usr/bin/python2.5-config --cflags
>
> print?
>
~$ /usr/bin/python2.5-config --cflags
-I/usr/include/python2.5 -I/usr/include/python2.5 -fno-strict-aliasing
-DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes
~$

> 2. What is the value of PYTHONINC in include/Make/Platform.make?
>
PYTHONINC = -I/usr/include/python2.5 -I/usr/include/python2.5

That looks reasonable. Can you post the errors, *including* the
command which generates the error?

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

Ok Glynn.
After starting grass with no flags, this is the message in the terminal:
GRASS 6.4.0RC5 (UTM33WGS84EPGS):~/grass-6.4.0RC5 >
WARNING: Vector digitizer is not available (No module named grass6_wxvdigit)

If I try "3d view" ["Digitize"] in the Display window pulldown menu, the result is:
Unable to switch to 3D display [vector digitizer] mode.
The Nviz python extension was not found or loaded properly.
Switching back to 2D display mode.
Details: No module named grass6_wxnviz [grass6_wxvdigit]

"nviz" command from terminal works and opens a wx look window asking for input data

"nviz -q" opens a tcltk nviz main widndow

I can find required modules in the downloaded folder where I compiled grass:
~$ locate grass6_wxvdigit
...
/home/ferruccio/grass-6.4.0RC5/gui/wxpython/vdigit/grass6_wxvdigit.i
/home/ferruccio/grass-6.4.0RC5/gui/wxpython/vdigit/grass6_wxvdigit.py
/home/ferruccio/grass-6.4.0RC5/gui/wxpython/vdigit/grass6_wxvdigit_wrap.cpp
...

~$ locate grass6_wxvdigit
...
/home/ferruccio/grass-6.4.0RC5/gui/wxpython/nviz/grass6_wxnviz.i
/home/ferruccio/grass-6.4.0RC5/gui/wxpython/nviz/grass6_wxnviz.py
/home/ferruccio/grass-6.4.0RC5/gui/wxpython/nviz/grass6_wxnviz_wrap.cpp
...

Another issue (don't know if related to the first one) is ... flying mode doesn't seem to work properly and the camera moves forword/back in a loopback.
This happens while working with
grass-6.2.3 from Ubuntu rep
grass-6.4.svn both wx/tcltk
grass-6.4-RC5 both wx/tcltk
grass-6.5.svn both wx/tcltk
installed on an Ubintu 9.04 64bit machine

*doesn't* happen with
grass 6.3.0 from Ununtu rep
installed on an Ubuntu 8.10 32bit machine

Thank you.
Ferruccio

Glynn Clements ha scritto:

Ferruccio Sarra wrote:

Glynn Clements ha scritto:
    

1. What does running:

  /usr/bin/python2.5-config --cflags

print?
  

~$ /usr/bin/python2.5-config --cflags
-I/usr/include/python2.5 -I/usr/include/python2.5 -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes
~$

2. What is the value of PYTHONINC in include/Make/Platform.make?
  

PYTHONINC = -I/usr/include/python2.5 -I/usr/include/python2.5
    
That looks reasonable. Can you post the errors, *including* the
command which generates the error?

Hi,

2009/8/2 Ferruccio Sarra <ferruccio.sarra@tiscali.it>:

[...]

"nviz" command from terminal works and opens a wx look window asking for
input data

It's unrelated -- TCL/TK NVIZ and wxNVIZ are completely different applications.

I can find required modules in the downloaded folder where I compiled grass:
~$ locate grass6_wxvdigit
...
/home/ferruccio/grass-6.4.0RC5/gui/wxpython/vdigit/grass6_wxvdigit.i
/home/ferruccio/grass-6.4.0RC5/gui/wxpython/vdigit/grass6_wxvdigit.py
/home/ferruccio/grass-6.4.0RC5/gui/wxpython/vdigit/grass6_wxvdigit_wrap.cpp
...

Go to gui/wxpython/vdigit and run `make`. Post to ML full log
including gcc commands.

Your Platform.make seems to be OK, I wonder why gcc cannot find
Python.h even PYTHONINC is OK.

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

Hi Martin
This is the make output:

~/grass-6.4.0RC5/gui/wxpython/vdigit$ make
python setup.py build_ext --swig=/usr/bin/swig --swig-opts=-c++ --build-lib=OBJ. --build-temp=OBJ.
running build_ext
building '_grass6_wxvdigit' extension
swigging grass6_wxvdigit.i to grass6_wxvdigit_wrap.cpp
/usr/bin/swig -python -c++ -o grass6_wxvdigit_wrap.cpp grass6_wxvdigit.i
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPACKAGE="grasslibs" -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -I/home/ferruccio/grass-6.4.0RC5/dist./include -I/usr/include/gdal -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -I/usr/include/python2.6 -c cats.cpp -o OBJ./cats.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from cats.cpp:19:
driver.h:25:20: error: Python.h: Nessun file o directory
In file included from driver.h:26,
from cats.cpp:19:
pseudodc.h:608: error: ISO C++ forbids declaration of ‘PyObject’ with no type
pseudodc.h:608: error: expected ‘;’ before ‘*’ token
pseudodc.h:611: error: ISO C++ forbids declaration of ‘PyObject’ with no type
pseudodc.h:611: error: expected ‘;’ before ‘*’ token
error: command 'gcc' failed with exit status 1
make: *** [OBJ./_grass6_wxvdigit.so] Errore 1
~/grass-6.4.0RC5/gui/wxpython/vdigit$

Martin Landa ha scritto:

Hi,

2009/8/2 Ferruccio Sarra <ferruccio.sarra@tiscali.it>:

[...]

"nviz" command from terminal works and opens a wx look window asking for
input data
    
It's unrelated -- TCL/TK NVIZ and wxNVIZ are completely different applications.

I can find required modules in the downloaded folder where I compiled grass:
~$ locate grass6_wxvdigit
...
/home/ferruccio/grass-6.4.0RC5/gui/wxpython/vdigit/grass6_wxvdigit.i
/home/ferruccio/grass-6.4.0RC5/gui/wxpython/vdigit/grass6_wxvdigit.py
/home/ferruccio/grass-6.4.0RC5/gui/wxpython/vdigit/grass6_wxvdigit_wrap.cpp
...
    
Go to gui/wxpython/vdigit and run `make`. Post to ML full log
including gcc commands.

Your Platform.make seems to be OK, I wonder why gcc cannot find
Python.h even PYTHONINC is OK.

Martin

Hi,

2009/8/2 Ferruccio Sarra <ferruccio.sarra@tiscali.it>:

~/grass-6.4.0RC5/gui/wxpython/vdigit$ make
python setup.py build_ext --swig=/usr/bin/swig --swig-opts=-c++
--build-lib=OBJ. --build-temp=OBJ.

'OBJ.' is wrong, $(ARCH) variable seems to be empty (defined in Platform.make).

running build_ext
building '_grass6_wxvdigit' extension
swigging grass6_wxvdigit.i to grass6_wxvdigit_wrap.cpp
/usr/bin/swig -python -c++ -o grass6_wxvdigit_wrap.cpp grass6_wxvdigit.i
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -fPIC -DPACKAGE="grasslibs" -D_FILE_OFFSET_BITS=64
-D_LARGE_FILES -D__WXGTK__ -I/home/ferruccio/grass-6.4.0RC5/dist./include
-I/usr/include/gdal -I/usr/lib/wx/include/gtk2-unicode-release-2.8
-I/usr/include/wx-2.8 -I/usr/include/python2.6 -c cats.cpp -o OBJ./cats.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
In file included from cats.cpp:19:
driver.h:25:20: error: Python.h: Nessun file o directory

I don't see -I/usr/include/python25 even it's defined in PYTHONINC - strange...

How you configure GRASS (./configure ...)?

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

Martin Landa wrote:

> ~/grass-6.4.0RC5/gui/wxpython/vdigit$ make
> python setup.py build_ext --swig=/usr/bin/swig --swig-opts=-c++
> --build-lib=OBJ. --build-temp=OBJ.

'OBJ.' is wrong, $(ARCH) variable seems to be empty (defined in Platform.make).

> running build_ext
> building '_grass6_wxvdigit' extension
> swigging grass6_wxvdigit.i to grass6_wxvdigit_wrap.cpp
> /usr/bin/swig -python -c++ -o grass6_wxvdigit_wrap.cpp grass6_wxvdigit.i
> gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
> -Wstrict-prototypes -fPIC -DPACKAGE="grasslibs" -D_FILE_OFFSET_BITS=64
> -D_LARGE_FILES -D__WXGTK__ -I/home/ferruccio/grass-6.4.0RC5/dist./include
> -I/usr/include/gdal -I/usr/lib/wx/include/gtk2-unicode-release-2.8
> -I/usr/include/wx-2.8 -I/usr/include/python2.6 -c cats.cpp -o OBJ./cats.o
> cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
> Ada/C/ObjC but not for C++
> In file included from cats.cpp:19:
> driver.h:25:20: error: Python.h: Nessun file o directory

I don't see -I/usr/include/python25 even it's defined in PYTHONINC - strange...

vdigit/Makefile uses setup.py, so it ignores the configure options; it
relies upon the distutils package in the installed python.

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

Hi,
thank you both for your quick replying.

Glynn Clements ha scritto:

Martin Landa wrote:

~/grass-6.4.0RC5/gui/wxpython/vdigit$ make
python setup.py build_ext --swig=/usr/bin/swig --swig-opts=-c++
--build-lib=OBJ. --build-temp=OBJ.
      

'OBJ.' is wrong, $(ARCH) variable seems to be empty (defined in Platform.make).
    

Yes ARCH variable in platform.make is empty(!) and I can't imagine why.

    

running build_ext
building '_grass6_wxvdigit' extension
swigging grass6_wxvdigit.i to grass6_wxvdigit_wrap.cpp
/usr/bin/swig -python -c++ -o grass6_wxvdigit_wrap.cpp grass6_wxvdigit.i
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -fPIC -DPACKAGE="grasslibs" -D_FILE_OFFSET_BITS=64
-D_LARGE_FILES -D__WXGTK__ -I/home/ferruccio/grass-6.4.0RC5/dist./include
-I/usr/include/gdal -I/usr/lib/wx/include/gtk2-unicode-release-2.8
-I/usr/include/wx-2.8 -I/usr/include/python2.6 -c cats.cpp -o OBJ./cats.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
In file included from cats.cpp:19:
driver.h:25:20: error: Python.h: Nessun file o directory
      

I don't see -I/usr/include/python25 even it's defined in PYTHONINC - strange...
    
vdigit/Makefile uses setup.py, so it ignores the configure options; it
relies upon the distutils package in the installed python.
  

I found these setup.py ... but don't know which one is responsable for vdigit compilation
~/.../gui/wxpython/vdigit/setup.py
~$ locate 'distutils/setup.py'
/usr/lib/python2.5/site-packages/numpy/distutils/setup.py
/usr/lib/python2.5/site-packages/numpy/distutils/setup.pyc
/usr/lib/python2.6/dist-packages/numpy/distutils/setup.py
/usr/lib/python2.6/dist-packages/numpy/distutils/setup.pyc
/usr/share/pyshared/numpy/distutils/setup.py
~$

I wonder (should I :slight_smile: whether a conflict between different python versions is a possible cause of the wrong include directroy.

1. My configure options:
./configure --with-tcltk-includes=/usr/include/tcl8.5/ --with-opengl-includes=/usr/include/GL/ --enable-shared --with-cxx --with-postgres --with-postgres-includes=/usr/include/postgresql/ --with-sqlite --with-odbc --with-python=/usr/include/python2.5/ --with-python=/usr/bin/python2.5-config --enable-largefile --with-x --with-motif --with-cairo --with-freetype --with-nls --with-freetype-includes=/usr/include/freetype2/ --with-wxwidgets=/usr/bin/wx-config --enable-64bit --with-libs=/usr/lib64 --with-curses --with-proj-libs=/usr/local/lib/ --with-proj-share=/usr/share/proj --with-ffmpeg --with-ffmpeg-includes=/usr/include/ffmpeg

2.
~$ dpkg -l|grep python2.5
ii python2.5 2.5.4-1ubuntu4 An interactive high-level object-oriented la
ii python2.5-dev 2.5.4-1ubuntu4 Header files and a static library for Python
ii python2.5-minimal 2.5.4-1ubuntu4 A minimal subset of the Python language (ver
~$

3.
~$ dpkg -l|grep python2.6
ii libpython2.6 2.6.2-0ubuntu1 Shared Python runtime library (version 2.6)
ii python2.6 2.6.2-0ubuntu1 An interactive high-level object-oriented la
ii python2.6-dbg 2.6.2-0ubuntu1 Debug Build of the Python Interpreter (versi
ii python2.6-minimal 2.6.2-0ubuntu1 A minimal subset of the Python language (ver
~$

4.
~$ python --version
Python 2.6.2