[GRASS-dev] errors compiling nviz in GRASS 7

First, Markus’ fix made GRASS 7 configure properly too.

But when I went to compile it, I hit errors with nviz. Some of these are the new code, but ./lib/niviz won’t compile either. I don’t know if this is a minor compilation glitch or a bug. I’ve included the output below.

For the record, I’m on a Mac OS X 10.5. If this is bug-worthy, I’ll go ahead and put it in Trac too.

Michael


C. Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

================================

Started compilation: Sun Jul 6 12:59:02 MST 2008

Errors in:
/Users/cmbarton/grass_dev/grass7_src/lib/nviz
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/vdigit
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/nviz
/Users/cmbarton/grass_dev/grass7_src/visualization/nviz2/cmd

In case of errors please change into the directory with error and run ‘make’.
If you get multiple errors, you need to deal with them in the order they
appear in the error log. If you get an error building a library, you will
also get errors from anything which uses the library.

Finished compilation: Sun Jul 6 13:06:30 MST 2008
make: *** [default] Error 1

=========================

cmb-MBP-2:grass7_src cmbarton$ cd /Users/cmbarton/grass_dev/grass7_src/lib/nviz
cmb-MBP-2:nviz cmbarton$
cmb-MBP-2:nviz cmbarton$ make
gcc -I/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include -arch i386 -Os -fno-common -DPACKAGE="“grasslibs”" -I/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Library/Frameworks/GDAL.framework/Versions/1.5/Headers -DPACKAGE="“grasslibs”" -I/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include -o OBJ.i386-apple-darwin9.4.0/change_view.o -c change_view.c
In file included from /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/nviz.h:5,
from change_view.c:20:
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/gstypes.h:13:19: error: GL/gl.h: No such file or directory
In file included from /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/gstypes.h:336,
from /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/nviz.h:5,
from change_view.c:20:
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/ogsf_proto.h:198: warning: parameter names (without types) in function declaration
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/ogsf_proto.h:199: error: syntax error before ‘GLuint’
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/ogsf_proto.h:455: error: syntax error before ‘gsd_set_font’
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/ogsf_proto.h:455: warning: data definition has no type or storage class
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/ogsf_proto.h:458: error: syntax error before ‘float’
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/ogsf_proto.h:472: error: syntax error before ‘GLuint’
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/ogsf_proto.h:492: error: syntax error before ‘GLuint’
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/ogsf_proto.h:496: error: syntax error before ‘GLuint’
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/ogsf_proto.h:554: error: syntax error before ‘int’
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/ogsf_proto.h:746: error: syntax error before ‘gsd_put_legend’
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/ogsf_proto.h:746: error: syntax error before ‘GLuint’
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/ogsf_proto.h:746: warning: data definition has no type or storage class
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/ogsf_proto.h:747: warning: parameter names (without types) in function declaration
In file included from change_view.c:20:
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/nviz.h:24:22: error: GL/glx.h: No such file or directory
In file included from change_view.c:20:
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/nviz.h:113: error: syntax error before ‘GLXContext’
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/nviz.h:113: warning: no semicolon at end of struct or union
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/nviz.h:115: error: syntax error before ‘windowId’
/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/nviz.h:115: warning: data definition has no type or storage class
make: *** [OBJ.i386-apple-darwin9.4.0/change_view.o] Error 1
cmb-MBP-2:nviz cmbarton$

===================================

cmb-MBP-2:cmd cmbarton$ cd /Users/cmbarton/grass_dev/grass7_src/gui/wxpython/nviz
cmb-MBP-2:nviz cmbarton$ make
c++ -I/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include -arch i386 -Os -fno-common -I/Library/Frameworks/GDAL.framework/Versions/1.5/Headers -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/usr/local/lib/wxPython-unicode-2.8.8.0/lib/wx/include/mac-unicode-debug-2.8 -I/usr/local/lib/wxPython-unicode-2.8.8.0/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ -I/usr/X11/include -DPACKAGE="“grasslibs”" -I/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include -o OBJ.i386-apple-darwin9.4.0/change_view.o -c change_view.cpp
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:245: error: declaration does not declare anything
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Headers/CMICCProfile.h:389: error: expected unqualified-id before numeric constant
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Headers/CMICCProfile.h:390: error: expected unqualified-id before numeric constant
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Headers/CMICCProfile.h:391: error: expected unqualified-id before numeric constant
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Headers/CMICCProfile.h:397: error: expected unqualified-id before numeric constant
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Headers/CMICCProfile.h:398: error: expected unqualified-id before numeric constant
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Headers/CMICCProfile.h:399: error: expected unqualified-id before numeric constant
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:273: error: using typedef-name ‘Cursor’ after ‘struct’
/usr/X11/include/X11/X.h:108: error: ‘Cursor’ has a previous declaration here
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:278: error: using typedef-name ‘Cursor’ after ‘struct’
/usr/X11/include/X11/X.h:108: error: ‘Cursor’ has a previous declaration here
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:278: error: invalid type in declaration before ‘;’ token
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:278: error: conflicting declaration ‘typedef int Cursor’
/usr/X11/include/X11/X.h:108: error: ‘Cursor’ has a previous declaration as ‘typedef XID Cursor’
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Headers/CMICCProfile.h:389: error: expected unqualified-id before numeric constant
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Headers/CMICCProfile.h:390: error: expected unqualified-id before numeric constant
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Headers/CMICCProfile.h:391: error: expected unqualified-id before numeric constant
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Headers/CMICCProfile.h:397: error: expected unqualified-id before numeric constant
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Headers/CMICCProfile.h:398: error: expected unqualified-id before numeric constant
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ColorSync.framework/Headers/CMICCProfile.h:399: error: expected unqualified-id before numeric constant
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:273: error: using typedef-name ‘Cursor’ after ‘struct’
/usr/X11/include/X11/X.h:108: error: ‘Cursor’ has a previous declaration here
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:278: error: using typedef-name ‘Cursor’ after ‘struct’
/usr/X11/include/X11/X.h:108: error: ‘Cursor’ has a previous declaration here
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:278: error: invalid type in declaration before ‘;’ token
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:278: error: conflicting declaration ‘typedef int Cursor’
/usr/X11/include/X11/X.h:108: error: ‘Cursor’ has a previous declaration as ‘typedef XID Cursor’
lipo: can’t figure out the architecture type of: /var/folders/AK/AKpYwDw1EoWI+fFF02nvRk+++TI/-Tmp-//cc8d1b5h.out
make: *** [OBJ.i386-apple-darwin9.4.0/change_view.o] Error 1

==================================

cd /Users/cmbarton/grass_dev/grass7_src/visualization/nviz2/cmd
cmb-MBP-2:cmd cmbarton$ make
make: *** No rule to make target /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib/libgrass_nviz.dylib', needed by /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/bin/nviz_cmd’. Stop.
cmb-MBP-2:cmd cmbarton$

Michael,

On Sun, Jul 6, 2008 at 10:16 PM, Michael Barton <michael.barton@asu.edu> wrote:

First, Markus' fix made GRASS 7 configure properly too.

(for the record): it was actually Glynn's fix.

But when I went to compile it, I hit errors with nviz.
I'm on a Mac OS X 10.5. If this is bug-worthy, I'll go ahead
and put it in Trac too.

No need I think.
...

Errors in:
/Users/cmbarton/grass_dev/grass7_src/lib/nviz
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/vdigit
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/nviz
/Users/cmbarton/grass_dev/grass7_src/visualization/nviz2/cmd
--

...

cmb-MBP-2:grass7_src cmbarton$ cd /Users/cmbarton/grass_dev/grass7_src/lib/nviz

...
Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/gstypes.h:13:19:

error: GL/gl.h: No such file or directory

Do you lack some devel package? On My Mandriva box, it is in
rpm -qf /usr/include/GL/gl.h
lib64mesagl1-devel-7.0.1-10mdv2008.0

...

cmb-MBP-2:cmd cmbarton$ cd /Users/cmbarton/grass_dev/grass7_src/gui/wxpython/nviz

... /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:245:

error: declaration does not declare anything

...
/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:278:

error: conflicting declaration 'typedef int Cursor'
/usr/X11/include/X11/X.h:108: error: 'Cursor' has a previous declaration as
'typedef XID Cursor'
lipo: can't figure out the architecture type of:
/var/folders/AK/AKpYwDw1EoWI+fFF02nvRk+++TI/-Tmp-//cc8d1b5h.out
make: *** [OBJ.i386-apple-darwin9.4.0/change_view.o] Error 1

Looks like a Mac specific error to me.

==================================
cd /Users/cmbarton/grass_dev/grass7_src/visualization/nviz2/cmd
cmb-MBP-2:cmd cmbarton$ make
make: *** No rule to make target
`/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib/libgrass_nviz.dylib',
needed by
`/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/bin/nviz_cmd'.
Stop.
cmb-MBP-2:cmd cmbarton$

No idea here.

Markus

Hi,

2008/7/6 Michael Barton <michael.barton@asu.edu>:

First, Markus' fix made GRASS 7 configure properly too.

that's Glynn's fix:-)

[...]

Errors in:
/Users/cmbarton/grass_dev/grass7_src/lib/nviz

[...]

/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/gstypes.h:13:19:
error: GL/gl.h: No such file or directory

I have updated Makefile in lib/nviz based on lib/ogsf/Makefile, maybe
it can help, I can compile on my Linux box without problems.

http://trac.osgeo.org/grass/changeset/32032/grass/trunk/lib/nviz/Makefile

Martin

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

On Jul 6, 2008, at 3:23 PM, Markus Neteler wrote:

Errors in:
/Users/cmbarton/grass_dev/grass7_src/lib/nviz
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/vdigit
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/nviz
/Users/cmbarton/grass_dev/grass7_src/visualization/nviz2/cmd
--

...

cmb-MBP-2:grass7_src cmbarton$ cd /Users/cmbarton/grass_dev/grass7_src/lib/nviz

...
Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/gstypes.h:13:19:

error: GL/gl.h: No such file or directory

Do you lack some devel package? On My Mandriva box, it is in
rpm -qf /usr/include/GL/gl.h
lib64mesagl1-devel-7.0.1-10mdv2008.0

OR the GL include path is missing?

error: conflicting declaration 'typedef int Cursor'
/usr/X11/include/X11/X.h:108: error: 'Cursor' has a previous declaration as
'typedef XID Cursor'
lipo: can't figure out the architecture type of:
/var/folders/AK/AKpYwDw1EoWI+fFF02nvRk+++TI/-Tmp-//cc8d1b5h.out
make: *** [OBJ.i386-apple-darwin9.4.0/change_view.o] Error 1

Looks like a Mac specific error to me.

Yeah, I vaguely recall seeing a workaround for errors like this - something to do with Cursor being used in Carbon I think. Maybe the workaround is in TclTk?

I haven't attempted trunk yet. I'll give it a spin today and see if I think of anything.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable. There is another theory which states that this has already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro

On Jul 6, 2008, at 3:36 PM, William Kyngesburye wrote:

On Jul 6, 2008, at 3:23 PM, Markus Neteler wrote:

Errors in:
/Users/cmbarton/grass_dev/grass7_src/lib/nviz
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/vdigit
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/nviz
/Users/cmbarton/grass_dev/grass7_src/visualization/nviz2/cmd
--

...

cmb-MBP-2:grass7_src cmbarton$ cd /Users/cmbarton/grass_dev/grass7_src/lib/nviz

Just noticing that nviz gets its own library now, probably so that there can be a tcltk nviz and wxpython nviz without duplicating the core nviz features. Now here's something that gets tricky with OSX.

TclTk in OSX has never really worked all that well for NVIZ in the "Aqua" OpenGL configuration. Only the X11 configuration has worked reliably for NVIZ. So most people will be configuring for X11.

So, assuming that you configure for X11 OpenGL/TclTk, the NVIZ library will be made for X11 OpenGL. But wxPython OpenGL will be "Aqua" no matter what. I don't know if this is the source of the current errors, but it will certainly be a problem later.

Either the GUI will have to be an either/or choice (or just ignore TclTk GUI), or we need to make sure NVIZ TclTk works in the OSX Aqua configuration so they can be configured together.

For the immediate problems, I'd say configure with Aqua and disable TclTk NVIZ compilation.

--with-opengl=aqua --without-tcltk --without-x

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

First Pogril: Why is life like sticking your head in a bucket filled with hyena offal?
Second Pogril: I don't know. Why IS life like sticking your head in a bucket filled with hyena offal?
First Pogril: I don't know either. Wretched, isn't it?

-HitchHiker's Guide to the Galaxy

Hi,

2008/7/6 William Kyngesburye <woklist@kyngchaos.com>:
[...]

Just noticing that nviz gets its own library now, probably so that there can
be a tcltk nviz and wxpython nviz without duplicating the core nviz
features. Now here's something that gets tricky with OSX.

experimental nvizlib is used by new nviz_cmd (visualization/nviz2/cmd)
module and wxGUI Nviz extension (gui/wxpython/nviz), no relation to
TCL/TK Nviz.

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

I'm sure that OpenGL is on my machine somewhere, but can't find it at the moment. Once I do, I can check for gl.h and report it's path back to you all.

Michael
____________________
C. Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

On Jul 6, 2008, at 1:36 PM, William Kyngesburye wrote:

On Jul 6, 2008, at 3:23 PM, Markus Neteler wrote:

Errors in:
/Users/cmbarton/grass_dev/grass7_src/lib/nviz
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/vdigit
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/nviz
/Users/cmbarton/grass_dev/grass7_src/visualization/nviz2/cmd
--

...

cmb-MBP-2:grass7_src cmbarton$ cd /Users/cmbarton/grass_dev/grass7_src/lib/nviz

...
Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/gstypes.h:13:19:

error: GL/gl.h: No such file or directory

Do you lack some devel package? On My Mandriva box, it is in
rpm -qf /usr/include/GL/gl.h
lib64mesagl1-devel-7.0.1-10mdv2008.0

OR the GL include path is missing?

error: conflicting declaration 'typedef int Cursor'
/usr/X11/include/X11/X.h:108: error: 'Cursor' has a previous declaration as
'typedef XID Cursor'
lipo: can't figure out the architecture type of:
/var/folders/AK/AKpYwDw1EoWI+fFF02nvRk+++TI/-Tmp-//cc8d1b5h.out
make: *** [OBJ.i386-apple-darwin9.4.0/change_view.o] Error 1

Looks like a Mac specific error to me.

Yeah, I vaguely recall seeing a workaround for errors like this - something to do with Cursor being used in Carbon I think. Maybe the workaround is in TclTk?

I haven't attempted trunk yet. I'll give it a spin today and see if I think of anything.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable. There is another theory which states that this has already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro

I found it and this may be the issue. This refers back to an issue that William raised with Martin over compiling for Mac. The OpenGL that GRASS uses is located in /usr/X11/include/GL/gl.h.

That is, it uses the X11 version of GL for NVIZ. If the new lib is building for wxPython, then it needs an Aqua version of GL. I think that this exists, but still don't know where it is.

Once we find it, however, we somehow need to have GRASS compile the old NVIZ (i.e., in TclTk) with the X11 GL and the new wxPython NVIZ to use the native Aqua version. This may make compiling on Mac somewhat more complicated.

Michael
____________________
C. Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

On Jul 6, 2008, at 1:36 PM, William Kyngesburye wrote:

On Jul 6, 2008, at 3:23 PM, Markus Neteler wrote:

Errors in:
/Users/cmbarton/grass_dev/grass7_src/lib/nviz
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/vdigit
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/nviz
/Users/cmbarton/grass_dev/grass7_src/visualization/nviz2/cmd
--

...

cmb-MBP-2:grass7_src cmbarton$ cd /Users/cmbarton/grass_dev/grass7_src/lib/nviz

...
Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/gstypes.h:13:19:

error: GL/gl.h: No such file or directory

Do you lack some devel package? On My Mandriva box, it is in
rpm -qf /usr/include/GL/gl.h
lib64mesagl1-devel-7.0.1-10mdv2008.0

OR the GL include path is missing?

error: conflicting declaration 'typedef int Cursor'
/usr/X11/include/X11/X.h:108: error: 'Cursor' has a previous declaration as
'typedef XID Cursor'
lipo: can't figure out the architecture type of:
/var/folders/AK/AKpYwDw1EoWI+fFF02nvRk+++TI/-Tmp-//cc8d1b5h.out
make: *** [OBJ.i386-apple-darwin9.4.0/change_view.o] Error 1

Looks like a Mac specific error to me.

Yeah, I vaguely recall seeing a workaround for errors like this - something to do with Cursor being used in Carbon I think. Maybe the workaround is in TclTk?

I haven't attempted trunk yet. I'll give it a spin today and see if I think of anything.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable. There is another theory which states that this has already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro

Here is the location of the native OGL (called AGL on Mac).

/System/Library/Frameworks/AGL.framework/Versions/A/Headers/gl.h

Michael
____________________
C. Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

On Jul 6, 2008, at 1:36 PM, William Kyngesburye wrote:

On Jul 6, 2008, at 3:23 PM, Markus Neteler wrote:

Errors in:
/Users/cmbarton/grass_dev/grass7_src/lib/nviz
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/vdigit
/Users/cmbarton/grass_dev/grass7_src/gui/wxpython/nviz
/Users/cmbarton/grass_dev/grass7_src/visualization/nviz2/cmd
--

...

cmb-MBP-2:grass7_src cmbarton$ cd /Users/cmbarton/grass_dev/grass7_src/lib/nviz

...
Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/include/grass/gstypes.h:13:19:

error: GL/gl.h: No such file or directory

Do you lack some devel package? On My Mandriva box, it is in
rpm -qf /usr/include/GL/gl.h
lib64mesagl1-devel-7.0.1-10mdv2008.0

OR the GL include path is missing?

error: conflicting declaration 'typedef int Cursor'
/usr/X11/include/X11/X.h:108: error: 'Cursor' has a previous declaration as
'typedef XID Cursor'
lipo: can't figure out the architecture type of:
/var/folders/AK/AKpYwDw1EoWI+fFF02nvRk+++TI/-Tmp-//cc8d1b5h.out
make: *** [OBJ.i386-apple-darwin9.4.0/change_view.o] Error 1

Looks like a Mac specific error to me.

Yeah, I vaguely recall seeing a workaround for errors like this - something to do with Cursor being used in Carbon I think. Maybe the workaround is in TclTk?

I haven't attempted trunk yet. I'll give it a spin today and see if I think of anything.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable. There is another theory which states that this has already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro

On Jul 6, 2008, at 6:58 PM, Michael Barton wrote:

Here is the location of the native OGL (called AGL on Mac).

/System/Library/Frameworks/AGL.framework/Versions/A/Headers/gl.h

Which is a symlink to /System/Library/Frameworks/OpenGL.frameworks/Headers/gl.h. Which is what you get when you configure with --with-opengl=aqua.

Which spits out a bunch cpp errors in the Carbon includes, from the AGL include. More than I can wrap my brain around at the moment, but it looks like we need to work on this.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable. There is another theory which states that this has already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro

Michael Barton wrote:

I found it and this may be the issue. This refers back to an issue
that William raised with Martin over compiling for Mac. The OpenGL
that GRASS uses is located in /usr/X11/include/GL/gl.h.

That is, it uses the X11 version of GL for NVIZ. If the new lib is
building for wxPython, then it needs an Aqua version of GL. I think
that this exists, but still don't know where it is.

Once we find it, however, we somehow need to have GRASS compile the
old NVIZ (i.e., in TclTk) with the X11 GL and the new wxPython NVIZ to
use the native Aqua version. This may make compiling on Mac somewhat
more complicated.

Both depend upon lib/ogsf, which (I suspect) can only be compiled for
one particular version of OpenGL.

If you want to continue using NVIZ on the Mac, I strongly suggest that
you figure out how to get NVIZ working with the native OpenGL and
Tcl/Tk.

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

Martin Landa wrote:

I have updated Makefile in lib/nviz based on lib/ogsf/Makefile, maybe
it can help, I can compile on my Linux box without problems.

Note that lib/nviz/render.c contains unconditional references to glX
functions, so it won't compile with non-X11 versions of OpenGL.

To make it work on all platforms, each section of code which uses glX
functions will need equivalent agl and wgl versions. The commment at
the top of that file indicates that it was based upon Togl, which
should have all of the relevant code.

Also, the Mac version of OpenGL needs <OpenGL/gl.h> rather than
<GL/gl.h>, e.g.:

#include <grass/config.h>

#if defined(OPENGL_X11) || defined(OPENGL_WINDOWS)
#include <GL/gl.h>
#endif
#ifdef OPENGL_AQUA
#include <OpenGL/gl.h>
#endif

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

Thanks for these important points Glynn.

Michael
______________________________
Michael Barton, Professor
Professor of Anthropology
Director of Graduate Studies
School of Human Diversity & Social Change
Center for Social Dynamics & Complexity
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

On Jul 7, 2008, at 11:15 AM, Glynn Clements wrote:

Martin Landa wrote:

I have updated Makefile in lib/nviz based on lib/ogsf/Makefile, maybe
it can help, I can compile on my Linux box without problems.

Note that lib/nviz/render.c contains unconditional references to glX
functions, so it won't compile with non-X11 versions of OpenGL.

To make it work on all platforms, each section of code which uses glX
functions will need equivalent agl and wgl versions. The commment at
the top of that file indicates that it was based upon Togl, which
should have all of the relevant code.

Also, the Mac version of OpenGL needs <OpenGL/gl.h> rather than
<GL/gl.h>, e.g.:

#include <grass/config.h>

#if defined(OPENGL_X11) || defined(OPENGL_WINDOWS)
#include <GL/gl.h>
#endif
#ifdef OPENGL_AQUA
#include <OpenGL/gl.h>
#endif

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

Hi,

2008/7/7 Glynn Clements <glynn@gclements.plus.com>:

Note that lib/nviz/render.c contains unconditional references to glX
functions, so it won't compile with non-X11 versions of OpenGL.

To make it work on all platforms, each section of code which uses glX
functions will need equivalent agl and wgl versions. The commment at
the top of that file indicates that it was based upon Togl, which
should have all of the relevant code.

Also, the Mac version of OpenGL needs <OpenGL/gl.h> rather than
<GL/gl.h>, e.g.:

#include <grass/config.h>

#if defined(OPENGL_X11) || defined(OPENGL_WINDOWS)
#include <GL/gl.h>
#endif
#ifdef OPENGL_AQUA
#include <OpenGL/gl.h>
#endif

thanks for notes, I have updated render.c [1], nothing for wgl since
include/Make/Platform.make doesn't seems to have OPENGL_WGL (todo).

I am not sure about Xlib-based functions (XFreePixmap, XOpenDisplay,
XCreatePixmap)...

Martin

[1] http://trac.osgeo.org/grass/changeset/32043

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

Hi,

2008/7/8 Martin Landa <landa.martin@gmail.com>:

thanks for notes, I have updated render.c [1], nothing for wgl since
include/Make/Platform.make doesn't seems to have OPENGL_WGL (todo).

sorry, there is OPENGL_WINDOWS, my mistake.

Martin

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

Martin Landa wrote:

I am not sure about Xlib-based functions (XFreePixmap, XOpenDisplay,
XCreatePixmap)...

For a GUI application, you wouldn't normally be calling these; you
would let the toolkit handle it. In particular, you would need to use
the same Display* used by the GUI; getting a new Display* from
XOpenDisplay() may not work, even if it refers to the same display.

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

Hi,

2008/7/9 Glynn Clements <glynn@gclements.plus.com>:

I am not sure about Xlib-based functions (XFreePixmap, XOpenDisplay,
XCreatePixmap)...

For a GUI application, you wouldn't normally be calling these; you
would let the toolkit handle it. In particular, you would need to use
the same Display* used by the GUI; getting a new Display* from
XOpenDisplay() may not work, even if it refers to the same display.

right, it is just used by CLI module (visualization/nviz2/cmd) for
off-screen rendering.

Martin

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

On Jul 6, 2008, at 9:05 PM, William Kyngesburye wrote:

On Jul 6, 2008, at 6:58 PM, Michael Barton wrote:

Here is the location of the native OGL (called AGL on Mac).

/System/Library/Frameworks/AGL.framework/Versions/A/Headers/gl.h

Which is a symlink to /System/Library/Frameworks/OpenGL.frameworks/Headers/gl.h. Which is what you get when you configure with --with-opengl=aqua.

Which spits out a bunch cpp errors in the Carbon includes, from the AGL include. More than I can wrap my brain around at the moment, but it looks like we need to work on this.

Learned a new trick today (probably standard stuff for the programming gurus) - I added -E to the compile flags and found that an unexpected macro was substituted for a buried Carbon struct:

typedef struct CMFixedXYZColor {
   Fixed X;
   Fixed Y;
   Fixed Z;
} CMFixedXYZColor;

which came out as:

typedef struct CMFixedXYZColor {
   Fixed 0;
   Fixed 1;
   Fixed 2;
} CMFixedXYZColor;

It appears X, Y and Z (all caps, that is) are defined in gstypes.h in GRASS. I was able to fix the problem by moving the lines in nviz.h:

#include <grass/gsurf.h>
#include <grass/gstypes.h>

to *after* the GL includes.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Earth: "Mostly harmless"

- revised entry in the HitchHiker's Guide to the Galaxy

Which I would have found if I had updated my SVN today... Sorry, I wasn't paying attention, and it moved too fast :wink:

On Jul 9, 2008, at 9:39 PM, William Kyngesburye wrote:

It appears X, Y and Z (all caps, that is) are defined in gstypes.h in GRASS. I was able to fix the problem by moving the lines in nviz.h:

#include <grass/gsurf.h>
#include <grass/gstypes.h>

to *after* the GL includes.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

[Trillian] What are you supposed to do WITH a maniacally depressed robot?

[Marvin] You think you have problems? What are you supposed to do if you ARE a maniacally depressed robot? No, don't try and answer, I'm 50,000 times more intelligent than you and even I don't know the answer...

- HitchHiker's Guide to the Galaxy

On Jul 9, 2008, at 9:44 PM, William Kyngesburye wrote:

Which I would have found if I had updated my SVN today... Sorry, I wasn't paying attention, and it moved too fast :wink:

On Jul 9, 2008, at 9:39 PM, William Kyngesburye wrote:

It appears X, Y and Z (all caps, that is) are defined in gstypes.h in GRASS. I was able to fix the problem by moving the lines in nviz.h:

#include <grass/gsurf.h>
#include <grass/gstypes.h>

to *after* the GL includes.

But, there is this in gui/wxpython/nviz/nviz.h:

#include <grass/gis.h>
#include <grass/gsurf.h>
#include <grass/gstypes.h>
#include <grass/nviz.h>

Since <grass/nviz.h> already includes gsurf.h and gstypes.h, perhaps those should be removed to let <grass/nviz.h> handle the proper include order?

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Oh, look, I seem to have fallen down a deep, dark hole. Now what does that remind me of? Ah, yes - life."

- Marvin