[GRASS-dev] trying to compile wxPython NVIZ

Hi Martin,

Finally getting a bit of time. I am trying to compile GRASS 7 so that I can take a look at the new NVIZ.

I got the following errors again.

/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

I went to /lib/nviz to check out the error. The result is below. It is different from the last time it didn't compile, so I hope that this means that it's getting closer. I'm copying William and Glynn to see if anyone has suggestions for how to get this working on my Mac. I am very much looking forward to trying this out.

Michael

================ compile error =================

cmb-MBP-2:grass7_src cmbarton$ cd ./lib/nviz
cmb-MBP-2:nviz cmbarton$ make
cc -dynamiclib -compatibility_version 7.0 -current_version 7.0 -install_name /Applications/GRASS/GRASS-7.0.app/Contents/MacOS/lib/libgrass_nviz.dylib -o /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib/libgrass_nviz.7.0.svn.dylib -L/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib -arch i386 -Os -arch i386 -Os OBJ.i386-apple-darwin9.4.0/change_view.o OBJ.i386-apple-darwin9.4.0/cplanes_obj.o OBJ.i386-apple-darwin9.4.0/draw.o OBJ.i386-apple-darwin9.4.0/exag.o OBJ.i386-apple-darwin9.4.0/lights.o OBJ.i386-apple-darwin9.4.0/map_obj.o OBJ.i386-apple-darwin9.4.0/nviz.o OBJ.i386-apple-darwin9.4.0/position.o OBJ.i386-apple-darwin9.4.0/render.o -lgrass_gis -lgrass_datetime -lz -lgrass_bitmap -lgrass_linkm -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -L/Library/Frameworks/GDAL.framework/Versions/1.5/unix/lib -lgdal -L/usr/X11/lib -L/usr/X11R6/lib -lGL -L/usr/X11R6/lib -lGLU -L/Library/Frameworks/UnixImageIO.framework/unix/lib -ltiff -lgrass_sites -lgrass_datetime -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree -lgrass_g3d -lgrass_gis -lgrass_datetime -lz && \
  (cd /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib; ln -f -s libgrass_nviz.7.0.svn.dylib /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib/libgrass_nviz.dylib)
Undefined symbols:
   "_GS_get_dims", referenced from:
       _Nviz_set_attr in map_obj.o
   "_GS_global_exag", referenced from:
       _Nviz_update_ranges in change_view.o
       _Nviz_change_exag in change_view.o
   "_GS_get_surf_list", referenced from:
       _Nviz_draw_cplane in cplanes_obj.o
       _Nviz_draw_all_surf in draw.o
       _Nviz_get_exag_height in exag.o
       _Nviz_get_exag in exag.o
       _Nviz_new_map_obj in map_obj.o
       _Nviz_set_focus_map in position.o
   "_GS_draw_surf", referenced from:
       _Nviz_draw_all_surf in draw.o
   "_GV_load_vector", referenced from:
       _Nviz_new_map_obj in map_obj.o
   "_GS_draw_wire", referenced from:
       _Nviz_draw_cplane in cplanes_obj.o
   "_GVL_num_vols", referenced from:
       _Nviz_set_focus_map in position.o
   "_XOpenDisplay", referenced from:
       _Nviz_create_render_window in render.o
   "_GS_Set_ClientData", referenced from:
       _Nviz_new_map_obj in map_obj.o
   "_GV_new_vector", referenced from:
       _Nviz_new_map_obj in map_obj.o
   "_GS_done_draw", referenced from:
       _Nviz_resize_window in change_view.o
       _Nviz_draw_cplane in cplanes_obj.o
       _Nviz_draw_all_vect in draw.o
       _Nviz_draw_all in draw.o
       _Nviz_draw_quick in draw.o
   "_XFreePixmap", referenced from:
       _Nviz_destroy_render_window in render.o
   "_GS_get_exag_guess", referenced from:
       _Nviz_get_exag_height in exag.o
       _Nviz_get_exag in exag.o
   "_XCreatePixmap", referenced from:
       _Nviz_create_render_window in render.o
   "_GS_clear", referenced from:
       _Nviz_draw_cplane in cplanes_obj.o
       _Nviz_draw_all in draw.o
       _Nviz_draw_quick in draw.o
   "_GS_get_longdim", referenced from:
       _Nviz_update_ranges in change_view.o
       _Nviz_get_exag_height in exag.o
   "_GS_set_draw", referenced from:
       _Nviz_resize_window in change_view.o
       _Nviz_draw_cplane in cplanes_obj.o
       _Nviz_draw_all_vect in draw.o
       _Nviz_draw_all in draw.o
       _Nviz_draw_quick in draw.o
   "_GS_unset_cplane", referenced from:
       _Nviz_off_cplane in cplanes_obj.o
   "_GS_set_drawres", referenced from:
       _Nviz_set_attr in map_obj.o
   "_GS_num_surfs", referenced from:
       _Nviz_new_map_obj in map_obj.o
       _Nviz_set_focus_map in position.o
   "_XFree", referenced from:
       _Nviz_create_render_window in render.o
   "_GS_setlight_ambient", referenced from:
       _Nviz_set_light_ambient in lights.o
   "_GS_draw_cplane_fence", referenced from:
       _Nviz_draw_cplane in cplanes_obj.o
       _Nviz_draw_all_surf in draw.o
   "_GS_set_att_const", referenced from:
       _Nviz_set_attr in map_obj.o
   "_GV_select_surf", referenced from:
       _Nviz_new_map_obj in map_obj.o
   "_GV_num_vects", referenced from:
       _Nviz_new_map_obj in map_obj.o
   "_GS_set_viewport", referenced from:
       _Nviz_resize_window in change_view.o
   "_GS_get_from_real", referenced from:
       _Nviz_set_viewpoint_height in change_view.o
   "_GS_get_from", referenced from:
       _Nviz_set_viewpoint_position in change_view.o
   "_GS_moveto", referenced from:
       _Nviz_set_viewpoint_position in change_view.o
   "_GS_new_surface", referenced from:
       _Nviz_new_map_obj in map_obj.o
   "_GVL_set_focus_center_map", referenced from:
       _Nviz_set_focus_map in position.o
   "_GS_new_light", referenced from:
       _Nviz_new_light in lights.o
   "_GV_alldraw_vect", referenced from:
       _Nviz_draw_all_vect in draw.o
   "_GS_set_focus_center_map", referenced from:
       _Nviz_set_focus_map in position.o
   "_GV_set_vectmode", referenced from:
       _Nviz_new_map_obj in map_obj.o
   "_GS_alldraw_wire", referenced from:
       _Nviz_resize_window in change_view.o
       _Nviz_draw_quick in draw.o
   "_GS_setlight_color", referenced from:
       _Nviz_set_light_bright in lights.o
       _Nviz_set_light_color in lights.o
   "_GS_ready_draw", referenced from:
       _Nviz_resize_window in change_view.o
       _Nviz_draw_cplane in cplanes_obj.o
       _Nviz_draw_all_vect in draw.o
       _Nviz_draw_all in draw.o
       _Nviz_draw_quick in draw.o
   "_GS_get_zrange_nz", referenced from:
       _Nviz_update_ranges in change_view.o
       _Nviz_get_exag_height in exag.o
   "_GS_setlight_position", referenced from:
       _Nviz_draw_all_surf in draw.o
       _Nviz_set_light_position in lights.o
   "_GS_unset_att", referenced from:
       _Nviz_unset_attr in map_obj.o
   "_GS_set_drawmode", referenced from:
       _Nviz_set_attr in map_obj.o
   "_GS_set_global_exag", referenced from:
       _Nviz_change_exag in change_view.o
   "_GS_set_fov", referenced from:
       _Nviz_set_viewpoint_persp in change_view.o
   "_GS_set_att_defaults", referenced from:
       _Nviz_set_attr_default in map_obj.o
   "_GVL_get_vol_list", referenced from:
       _Nviz_set_focus_map in position.o
   "_GS_set_nofocus", referenced from:
       _Nviz_set_focus_state in position.o
       _Nviz_set_focus_map in position.o
   "_GV_delete_vector", referenced from:
       _Nviz_new_map_obj in map_obj.o
   "_GS_set_infocus", referenced from:
       _Nviz_set_focus_state in position.o
   "_GS_load_att_map", referenced from:
       _Nviz_set_attr in map_obj.o
   "_GS_get_zextents", referenced from:
       _Nviz_draw_all_surf in draw.o
   "_GS_moveto_real", referenced from:
       _Nviz_set_viewpoint_height in change_view.o
   "_GS_init_view", referenced from:
       _Nviz_init_view in position.o
   "_GS_set_twist", referenced from:
       _Nviz_set_viewpoint_twist in change_view.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib/libgrass_nviz.7.0.svn.dylib] Error 1
cmb-MBP-2:nviz cmbarton$

Michael Barton wrote:

Finally getting a bit of time. I am trying to compile GRASS 7 so that
I can take a look at the new NVIZ.

I got the following errors again.

/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

I went to /lib/nviz to check out the error. The result is below. It is
different from the last time it didn't compile, so I hope that this
means that it's getting closer. I'm copying William and Glynn to see
if anyone has suggestions for how to get this working on my Mac. I am
very much looking forward to trying this out.

lib/nviz/Makefile should have $(OGSFLIB) added to EXTRA_LIBS.

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

Hi,

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

/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

I went to /lib/nviz to check out the error. The result is below. It is
different from the last time it didn't compile, so I hope that this
means that it's getting closer. I'm copying William and Glynn to see
if anyone has suggestions for how to get this working on my Mac. I am
very much looking forward to trying this out.

lib/nviz/Makefile should have $(OGSFLIB) added to EXTRA_LIBS.

done, http://trac.osgeo.org/grass/changeset/32112

Anyway, off-screen rendering is still unsolved on Mac. To try wxGUI
Nviz extension, you should be able to compile nvizlib without rendec.c
(which is not needed for wxGUI).

Martin

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

Martin Landa wrote:

>> /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
>>
>> I went to /lib/nviz to check out the error. The result is below. It is
>> different from the last time it didn't compile, so I hope that this
>> means that it's getting closer. I'm copying William and Glynn to see
>> if anyone has suggestions for how to get this working on my Mac. I am
>> very much looking forward to trying this out.
>
> lib/nviz/Makefile should have $(OGSFLIB) added to EXTRA_LIBS.

done, http://trac.osgeo.org/grass/changeset/32112

Anyway, off-screen rendering is still unsolved on Mac. To try wxGUI
Nviz extension, you should be able to compile nvizlib without rendec.c
(which is not needed for wxGUI).

If you have to explicitly disable render.c, that suggests that
something needs to be conditionalised. The code should at least
compile on all platforms, even if it doesn't work.

If you can't fix the compilation issues yourself, please post the
error messages to the list.

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

Hi,

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

Anyway, off-screen rendering is still unsolved on Mac. To try wxGUI
Nviz extension, you should be able to compile nvizlib without rendec.c
(which is not needed for wxGUI).

If you have to explicitly disable render.c, that suggests that
something needs to be conditionalised. The code should at least
compile on all platforms, even if it doesn't work.

If you can't fix the compilation issues yourself, please post the
error messages to the list.

I just don't have access to Mac to find out how to make off-screen
rendering working on this platform...

Relevant parts:

http://trac.osgeo.org/grass/browser/grass/trunk/lib/nviz/render.c#L106

http://trac.osgeo.org/grass/browser/grass/trunk/lib/nviz/render.c#L150

http://trac.osgeo.org/grass/browser/grass/trunk/lib/nviz/render.c#L188

Martin

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

I can test on my Mac, but can't help with the C code.

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 14, 2008, at 11:00 PM, Martin Landa wrote:

Hi,

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

Anyway, off-screen rendering is still unsolved on Mac. To try wxGUI
Nviz extension, you should be able to compile nvizlib without rendec.c
(which is not needed for wxGUI).

If you have to explicitly disable render.c, that suggests that
something needs to be conditionalised. The code should at least
compile on all platforms, even if it doesn't work.

If you can't fix the compilation issues yourself, please post the
error messages to the list.

I just don't have access to Mac to find out how to make off-screen
rendering working on this platform...

Relevant parts:

render.c in grass/trunk/lib/nviz – GRASS GIS

render.c in grass/trunk/lib/nviz – GRASS GIS

render.c in grass/trunk/lib/nviz – GRASS GIS

Martin

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

Martin Landa wrote:

>> Anyway, off-screen rendering is still unsolved on Mac. To try wxGUI
>> Nviz extension, you should be able to compile nvizlib without rendec.c
>> (which is not needed for wxGUI).
>
> If you have to explicitly disable render.c, that suggests that
> something needs to be conditionalised. The code should at least
> compile on all platforms, even if it doesn't work.
>
> If you can't fix the compilation issues yourself, please post the
> error messages to the list.

I just don't have access to Mac to find out how to make off-screen
rendering working on this platform...

I'm not talking about getting off-screen rendering working; I'm
talking about gettting lib/nviz compile. If it fails to compile, you
can't even test the parts which should work.

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

Glynn Clements wrote:

> >> Anyway, off-screen rendering is still unsolved on Mac. To try wxGUI
> >> Nviz extension, you should be able to compile nvizlib without rendec.c
> >> (which is not needed for wxGUI).
> >
> > If you have to explicitly disable render.c, that suggests that
> > something needs to be conditionalised. The code should at least
> > compile on all platforms, even if it doesn't work.
> >
> > If you can't fix the compilation issues yourself, please post the
> > error messages to the list.
>
> I just don't have access to Mac to find out how to make off-screen
> rendering working on this platform...

I'm not talking about getting off-screen rendering working; I'm
talking about gettting lib/nviz compile. If it fails to compile, you
can't even test the parts which should work.

FWIW, I have made some changes to lib/nviz/render.c to get it to
compile on Windows, which may also help on OSX (there were some
X-specific portions which weren't conditionalised).

It doesn't work on Windows yet (G_malloc() fails), but I don't have a
native version of GDB installed, so I haven't looked into it any
further.

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

Thanks for fixes!, I will try to make it working on Windows later.

M.

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

Glynn Clements wrote:

> >> Anyway, off-screen rendering is still unsolved on Mac. To try wxGUI
> >> Nviz extension, you should be able to compile nvizlib without rendec.c
> >> (which is not needed for wxGUI).
> >
> > If you have to explicitly disable render.c, that suggests that
> > something needs to be conditionalised. The code should at least
> > compile on all platforms, even if it doesn't work.
> >
> > If you can't fix the compilation issues yourself, please post the
> > error messages to the list.
>
> I just don't have access to Mac to find out how to make off-screen
> rendering working on this platform...

I'm not talking about getting off-screen rendering working; I'm
talking about gettting lib/nviz compile. If it fails to compile, you
can't even test the parts which should work.

FWIW, I have made some changes to lib/nviz/render.c to get it to
compile on Windows, which may also help on OSX (there were some
X-specific portions which weren't conditionalised).

It doesn't work on Windows yet (G_malloc() fails), but I don't have a
native version of GDB installed, so I haven't looked into it any
further.

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

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

On Jul 15, 2008, at 2:18 AM, Glynn Clements wrote:

Glynn Clements wrote:

Anyway, off-screen rendering is still unsolved on Mac. To try wxGUI
Nviz extension, you should be able to compile nvizlib without rendec.c
(which is not needed for wxGUI).

If you have to explicitly disable render.c, that suggests that
something needs to be conditionalised. The code should at least
compile on all platforms, even if it doesn't work.

If you can't fix the compilation issues yourself, please post the
error messages to the list.

I just don't have access to Mac to find out how to make off-screen
rendering working on this platform...

I'm not talking about getting off-screen rendering working; I'm
talking about gettting lib/nviz compile. If it fails to compile, you
can't even test the parts which should work.

FWIW, I have made some changes to lib/nviz/render.c to get it to
compile on Windows, which may also help on OSX (there were some
X-specific portions which weren't conditionalised).

It doesn't work on Windows yet (G_malloc() fails), but I don't have a
native version of GDB installed, so I haven't looked into it any
further.

Glynn and Martin,

I tried this out on my Mac. It still doesn't compile, but it gets different errors this time.

Michael

cmb-MBP-2:grass7_src cmbarton$ cd ./lib/nviz
cmb-MBP-2:nviz cmbarton$ make
cc -dynamiclib -compatibility_version 7.0 -current_version 7.0 -install_name /Applications/GRASS/GRASS-7.0.app/Contents/MacOS/lib/libgrass_nviz.dylib -o /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib/libgrass_nviz.7.0.svn.dylib -L/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib -arch i386 -Os -arch i386 -Os OBJ.i386-apple-darwin9.4.0/change_view.o OBJ.i386-apple-darwin9.4.0/cplanes_obj.o OBJ.i386-apple-darwin9.4.0/draw.o OBJ.i386-apple-darwin9.4.0/exag.o OBJ.i386-apple-darwin9.4.0/lights.o OBJ.i386-apple-darwin9.4.0/map_obj.o OBJ.i386-apple-darwin9.4.0/nviz.o OBJ.i386-apple-darwin9.4.0/position.o OBJ.i386-apple-darwin9.4.0/render.o -lgrass_gis -lgrass_datetime -lz -lgrass_bitmap -lgrass_linkm -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -L/Library/Frameworks/GDAL.framework/Versions/1.5/unix/lib -lgdal -L/usr/X11/lib -L/usr/X11R6/lib -lGL -L/usr/X11R6/lib -lGLU -L/Library/Frameworks/UnixImageIO.framework/unix/lib -ltiff -lgrass_sites -lgrass_datetime -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree -lgrass_g3d -lgrass_gis -lgrass_datetime -lz -lgrass_ogsf -lgrass_bitmap -lgrass_linkm -lgrass_g3d -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_sites -lgrass_datetime -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree -lgrass_vect -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_dbmiclient -lgrass_dbmibase -lgrass_gis -lgrass_datetime -lz -lgrass_gis -lgrass_datetime -lz -lgrass_dgl -lgrass_dig2 -lgrass_gis -lgrass_datetime -lz -lgrass_rtree -lgrass_gis -lgrass_datetime -lz -lgrass_linkm -lgrass_rtree && \
  (cd /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib; ln -f -s libgrass_nviz.7.0.svn.dylib /Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib/libgrass_nviz.dylib)
Undefined symbols:
   "_XOpenDisplay", referenced from:
       _Nviz_create_render_window in render.o
   "_XFreePixmap", referenced from:
       _Nviz_destroy_render_window in render.o
   "_XCreatePixmap", referenced from:
       _Nviz_create_render_window in render.o
   "_XFree", referenced from:
       _Nviz_create_render_window in render.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib/libgrass_nviz.7.0.svn.dylib] Error 1

On Jul 15, 2008, at 10:21 PM, Michael Barton wrote:

On Jul 15, 2008, at 2:18 AM, Glynn Clements wrote:

FWIW, I have made some changes to lib/nviz/render.c to get it to
compile on Windows, which may also help on OSX (there were some
X-specific portions which weren't conditionalised).

It doesn't work on Windows yet (G_malloc() fails), but I don't have a
native version of GDB installed, so I haven't looked into it any
further.

Glynn and Martin,

I tried this out on my Mac. It still doesn't compile, but it gets different errors this time.

Michael

cmb-MBP-2:grass7_src cmbarton$ cd ./lib/nviz
cmb-MBP-2:nviz cmbarton$ make
cc -dynamiclib -compatibility_version 7.0 -current_version 7.0 -install_name

L/Library/Frameworks/GDAL.framework/Versions/1.5/unix/lib -lgdal -L/usr/X11/lib -L/usr/X11R6/lib -lGL -L/usr/X11R6/lib -lGLU -

Undefined symbols:
"_XOpenDisplay", referenced from:
     _Nviz_create_render_window in render.o
"_XFreePixmap", referenced from:
     _Nviz_destroy_render_window in render.o
"_XCreatePixmap", referenced from:
     _Nviz_create_render_window in render.o
"_XFree", referenced from:
     _Nviz_create_render_window in render.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib/libgrass_nviz.7.0.svn.dylib] Error 1

As I mentionaed a while back, for the nviz library to operate cleanly with wxpython, which is "Aqua", or AGL-based, you should configure OpenGL for Aqua, not X11. This means you should also disable X11 and TclTk features, or you will get some header confusion for OpenGL. Something like:

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

But, when I do this I get:

gcc -I/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include -Os -fno-common -DPACKAGE=\""grasslibs"\" -I/Library/Frameworks/GDAL.framework/Versions/1.5/Headers -DPACKAGE=\""grasslibs"\" -I/System/Library/Frameworks/OpenGL.framework/Headers -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Users/Shared/unix/ffmpeg-leo/include/ffmpeg -I/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include -o OBJ.i386-apple-darwin9.3.0/change_view.o -c change_view.c
In file included from change_view.c:20:
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:120: error: syntax error before ‘AGLPixelFmtID’
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:120: warning: no semicolon at end of struct or union
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:122: error: syntax error before ‘windowId’
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:122: warning: data definition has no type or storage class
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:129: error: syntax error before ‘}’ token
make[2]: *** [OBJ.i386-apple-darwin9.3.0/change_view.o] Error 1

It seems to be some AGL programming issue.

-----
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 15, 2008, at 10:36 PM, William Kyngesburye wrote:

In file included from change_view.c:20:
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:120: error: syntax error before ‘AGLPixelFmtID’

Hmm, I can't find AGLPixelFmtID *anywhere* in the OSX headers, and there are no hits at Apple. Google only returns a few hits, all mentioning that it's the AGL equivalent of "XVisualInfo" for pixel info.

-----
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

On Jul 15, 2008, at 8:36 PM, William Kyngesburye wrote:

As I mentionaed a while back, for the nviz library to operate cleanly with wxpython, which is "Aqua", or AGL-based, you should configure OpenGL for Aqua, not X11. This means you should also disable X11 and TclTk features, or you will get some header confusion for OpenGL. Something like:

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

But, when I do this I get:

gcc -I/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include -Os -fno-common -DPACKAGE=\""grasslibs"\" -I/Library/Frameworks/GDAL.framework/Versions/1.5/Headers -DPACKAGE=\""grasslibs"\" -I/System/Library/Frameworks/OpenGL.framework/Headers -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Users/Shared/unix/ffmpeg-leo/include/ffmpeg -I/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include -o OBJ.i386-apple-darwin9.3.0/change_view.o -c change_view.c
In file included from change_view.c:20:
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:120: error: syntax error before ‘AGLPixelFmtID’
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:120: warning: no semicolon at end of struct or union
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:122: error: syntax error before ‘windowId’
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:122: warning: data definition has no type or storage class
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:129: error: syntax error before ‘}’ token
make[2]: *** [OBJ.i386-apple-darwin9.3.0/change_view.o] Error 1

It seems to be some AGL programming issue.

I get this too if I get rid of all references to x11 and x11 TclTk in the configure script, and add --without-x and with-opengl=aqua

--without-glw and --without-motif are default and don't need to be explicitly added.

It seems like this is getting closer to compiling on a Mac for testing.

Have you tried to compile with aqua tcltk 8.5.1 in the new OS X 10.5.4? I thought I'd try it and see what happens.

Michael

I just managed to compile GRASS on the Mac OS X (10.5.4) without x11 and with aqua tcltk 8.5.1. It actually works and looks pretty good. NVIZ does not work. No TclTk error messages (this is a difficulty with nviz; it traps all errors so you can't see what is wrong). However, because this is native aqua TclTk, it did give an Apple error message that I'll copy in below. It may be helpful if someone want's to debug it (I've added Paul to the cc list because of this).

You can see some quick screenshots of the GUI here <http://www.public.asu.edu/~cmbarton/files/grass_screenshots/grass_osx_aqua/ >. It looks surprisingly good. To get TclTk 8.5 aqua to compile and run, I had to do the following...

make distclean

export TCLTK_INTERNAL=
export TCLTKVER="8.5"

./configure --with-freetype --with-freetype-includes="/Library/Frameworks/FreeType.framework/unix/include/freetype2 /Library/Frameworks/FreeType.framework/unix/include" --with-freetype-libs=/Library/Frameworks/FreeType.framework/unix/lib --with-gdal=/Library/Frameworks/GDAL.framework/Programs/gdal-config --with-proj --with-proj-includes=/Library/Frameworks/PROJ.framework/unix/include --with-proj-libs=/Library/Frameworks/PROJ.framework/unix/lib --with-proj-share=/Library/Frameworks/PROJ.framework/Resources/proj --with-jpeg-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-jpeg-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --with-png-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-png-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --with-tiff-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-tiff-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --without-postgres --without-mysql --with-odbc --with-sqlite --with-sqlite-libs=/Library/Frameworks/SQLite3.framework/unix/lib --with-sqlite-includes=/Library/Frameworks/SQLite3.framework/unix/include --with-fftw-includes=/Library/Frameworks/FFTW3.framework/unix/include --with-fftw-libs=/Library/Frameworks/FFTW3.framework/unix/lib --without-x --with-cxx --with-opengl=aqua --without-readline --prefix=/Applications/GRASS --enable-macosx-app --with-python --with-wxwidgets=/usr/local/lib/wxPython-unicode-2.8.7.1/bin/wx-config --with-tcltk-includes="/Library/Frameworks/Tcl.framework/Headers /Library/Frameworks/Tk.framework/Headers /Library/Frameworks/Tk.framework/PrivateHeaders"

sudo make install

THEN, I had to find a copy of wish.app, show contents, and extract a copy of Wish from inside Wish.app/Contents/MacOS/.

NEXT, I had to rename Wish to wish8.5 and put it into /Applications/Grass/GRASS-7.0.app/Contents/MacOS/bin of the binary GRASS-7.0.ap that I'd just made.

After that GRASS launches fine in Mac TclTk aqua

I assume that this last part could go into the build instructions.

Perhaps this will help move all of GRASS Mac to native aqua as the wxPython GUI continues to get refined. If the nviz issues with aqua TclTk could be solved, the Mac version could dispense with x11 completely--and would still have a terminal for running bash and other command line things.

When I compiled, I got a number of togl warnings, but no obvious errors. So perhaps it can be made to run in 8.5.1 where it was problematic in 8.4.

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 15, 2008, at 8:36 PM, William Kyngesburye wrote:

On Jul 15, 2008, at 10:21 PM, Michael Barton wrote:

On Jul 15, 2008, at 2:18 AM, Glynn Clements wrote:

FWIW, I have made some changes to lib/nviz/render.c to get it to
compile on Windows, which may also help on OSX (there were some
X-specific portions which weren't conditionalised).

It doesn't work on Windows yet (G_malloc() fails), but I don't have a
native version of GDB installed, so I haven't looked into it any
further.

Glynn and Martin,

I tried this out on my Mac. It still doesn't compile, but it gets different errors this time.

Michael

cmb-MBP-2:grass7_src cmbarton$ cd ./lib/nviz
cmb-MBP-2:nviz cmbarton$ make
cc -dynamiclib -compatibility_version 7.0 -current_version 7.0 -install_name

L/Library/Frameworks/GDAL.framework/Versions/1.5/unix/lib -lgdal -L/usr/X11/lib -L/usr/X11R6/lib -lGL -L/usr/X11R6/lib -lGLU -

Undefined symbols:
"_XOpenDisplay", referenced from:
    _Nviz_create_render_window in render.o
"_XFreePixmap", referenced from:
    _Nviz_destroy_render_window in render.o
"_XCreatePixmap", referenced from:
    _Nviz_create_render_window in render.o
"_XFree", referenced from:
    _Nviz_create_render_window in render.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib/libgrass_nviz.7.0.svn.dylib] Error 1

As I mentionaed a while back, for the nviz library to operate cleanly with wxpython, which is "Aqua", or AGL-based, you should configure OpenGL for Aqua, not X11. This means you should also disable X11 and TclTk features, or you will get some header confusion for OpenGL. Something like:

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

But, when I do this I get:

gcc -I/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include -Os -fno-common -DPACKAGE=\""grasslibs"\" -I/Library/Frameworks/GDAL.framework/Versions/1.5/Headers -DPACKAGE=\""grasslibs"\" -I/System/Library/Frameworks/OpenGL.framework/Headers -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Users/Shared/unix/ffmpeg-leo/include/ffmpeg -I/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include -o OBJ.i386-apple-darwin9.3.0/change_view.o -c change_view.c
In file included from change_view.c:20:
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:120: error: syntax error before ‘AGLPixelFmtID’
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:120: warning: no semicolon at end of struct or union
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:122: error: syntax error before ‘windowId’
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:122: warning: data definition has no type or storage class
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:129: error: syntax error before ‘}’ token
make[2]: *** [OBJ.i386-apple-darwin9.3.0/change_view.o] Error 1

It seems to be some AGL programming issue.

-----
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

Forgot to give the nviz error. Here it is:

Process: nviz [64828]
Path: /Applications/Grass/GRASS-7.0.app/Contents/MacOS/etc/nviz2.2/nviz
Identifier: nviz
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: wish8.5 [64804]

Date/Time: 2008-07-15 22:36:04.896 -0700
OS Version: Mac OS X 10.5.4 (9E17)
Report Version: 6

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000029
Crashed Thread: 0

Thread 0 Crashed:
0 nviz 0x00012abf Togl_CreateWindow + 1371
1 com.tcltk.tklibrary 0x0b075242 Tk_MakeWindowExist + 120
2 nviz 0x000132fe Togl_Cmd + 875
3 com.tcltk.tcllibrary 0x001b1aeb TclInvokeStringCommand + 117
4 com.tcltk.tcllibrary 0x001b4245 TclEvalObjvInternal + 718
5 com.tcltk.tcllibrary 0x001d6b7d TclExecuteByteCode + 3036
6 com.tcltk.tcllibrary 0x001dbcbb TclCompEvalObj + 278
7 com.tcltk.tcllibrary 0x002029a6 TclObjInterpProc + 521
8 com.tcltk.tcllibrary 0x001b4245 TclEvalObjvInternal + 718
9 com.tcltk.tcllibrary 0x001b454f Tcl_EvalEx + 482
10 com.tcltk.tcllibrary 0x001f2087 Tcl_FSEvalFile + 411
11 com.tcltk.tcllibrary 0x001f216a Tcl_EvalFile + 50
12 com.tcltk.tklibrary 0x0b04bdb4 Tk_MainEx + 779
13 nviz 0x00010fed main + 109
14 nviz 0x0000282e start + 54

Michael

On Jul 15, 2008, at 10:42 PM, Michael Barton wrote:

I just managed to compile GRASS on the Mac OS X (10.5.4) without x11 and with aqua tcltk 8.5.1. It actually works and looks pretty good. NVIZ does not work. No TclTk error messages (this is a difficulty with nviz; it traps all errors so you can't see what is wrong). However, because this is native aqua TclTk, it did give an Apple error message that I'll copy in below. It may be helpful if someone want's to debug it (I've added Paul to the cc list because of this).

You can see some quick screenshots of the GUI here <http://www.public.asu.edu/~cmbarton/files/grass_screenshots/grass_osx_aqua/&gt;\. It looks surprisingly good. To get TclTk 8.5 aqua to compile and run, I had to do the following...

make distclean

export TCLTK_INTERNAL=
export TCLTKVER="8.5"

./configure --with-freetype --with-freetype-includes="/Library/Frameworks/FreeType.framework/unix/include/freetype2 /Library/Frameworks/FreeType.framework/unix/include" --with-freetype-libs=/Library/Frameworks/FreeType.framework/unix/lib --with-gdal=/Library/Frameworks/GDAL.framework/Programs/gdal-config --with-proj --with-proj-includes=/Library/Frameworks/PROJ.framework/unix/include --with-proj-libs=/Library/Frameworks/PROJ.framework/unix/lib --with-proj-share=/Library/Frameworks/PROJ.framework/Resources/proj --with-jpeg-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-jpeg-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --with-png-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-png-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --with-tiff-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-tiff-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --without-postgres --without-mysql --with-odbc --with-sqlite --with-sqlite-libs=/Library/Frameworks/SQLite3.framework/unix/lib --with-sqlite-includes=/Library/Frameworks/SQLite3.framework/unix/include --with-fftw-includes=/Library/Frameworks/FFTW3.framework/unix/include --with-fftw-libs=/Library/Frameworks/FFTW3.framework/unix/lib --without-x --with-cxx --with-opengl=aqua --without-readline --prefix=/Applications/GRASS --enable-macosx-app --with-python --with-wxwidgets=/usr/local/lib/wxPython-unicode-2.8.7.1/bin/wx-config --with-tcltk-includes="/Library/Frameworks/Tcl.framework/Headers /Library/Frameworks/Tk.framework/Headers /Library/Frameworks/Tk.framework/PrivateHeaders"

sudo make install

THEN, I had to find a copy of wish.app, show contents, and extract a copy of Wish from inside Wish.app/Contents/MacOS/.

NEXT, I had to rename Wish to wish8.5 and put it into /Applications/Grass/GRASS-7.0.app/Contents/MacOS/bin of the binary GRASS-7.0.ap that I'd just made.

After that GRASS launches fine in Mac TclTk aqua

I assume that this last part could go into the build instructions.

Perhaps this will help move all of GRASS Mac to native aqua as the wxPython GUI continues to get refined. If the nviz issues with aqua TclTk could be solved, the Mac version could dispense with x11 completely--and would still have a terminal for running bash and other command line things.

When I compiled, I got a number of togl warnings, but no obvious errors. So perhaps it can be made to run in 8.5.1 where it was problematic in 8.4.

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 15, 2008, at 8:36 PM, William Kyngesburye wrote:

On Jul 15, 2008, at 10:21 PM, Michael Barton wrote:

On Jul 15, 2008, at 2:18 AM, Glynn Clements wrote:

FWIW, I have made some changes to lib/nviz/render.c to get it to
compile on Windows, which may also help on OSX (there were some
X-specific portions which weren't conditionalised).

It doesn't work on Windows yet (G_malloc() fails), but I don't have a
native version of GDB installed, so I haven't looked into it any
further.

Glynn and Martin,

I tried this out on my Mac. It still doesn't compile, but it gets different errors this time.

Michael

cmb-MBP-2:grass7_src cmbarton$ cd ./lib/nviz
cmb-MBP-2:nviz cmbarton$ make
cc -dynamiclib -compatibility_version 7.0 -current_version 7.0 -install_name

L/Library/Frameworks/GDAL.framework/Versions/1.5/unix/lib -lgdal -L/usr/X11/lib -L/usr/X11R6/lib -lGL -L/usr/X11R6/lib -lGLU -

Undefined symbols:
"_XOpenDisplay", referenced from:
   _Nviz_create_render_window in render.o
"_XFreePixmap", referenced from:
   _Nviz_destroy_render_window in render.o
"_XCreatePixmap", referenced from:
   _Nviz_create_render_window in render.o
"_XFree", referenced from:
   _Nviz_create_render_window in render.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [/Users/cmbarton/grass_dev/grass7_src/dist.i386-apple-darwin9.4.0/lib/libgrass_nviz.7.0.svn.dylib] Error 1

As I mentionaed a while back, for the nviz library to operate cleanly with wxpython, which is "Aqua", or AGL-based, you should configure OpenGL for Aqua, not X11. This means you should also disable X11 and TclTk features, or you will get some header confusion for OpenGL. Something like:

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

But, when I do this I get:

gcc -I/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include -Os -fno-common -DPACKAGE=\""grasslibs"\" -I/Library/Frameworks/GDAL.framework/Versions/1.5/Headers -DPACKAGE=\""grasslibs"\" -I/System/Library/Frameworks/OpenGL.framework/Headers -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Users/Shared/unix/ffmpeg-leo/include/ffmpeg -I/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include -o OBJ.i386-apple-darwin9.3.0/change_view.o -c change_view.c
In file included from change_view.c:20:
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:120: error: syntax error before ‘AGLPixelFmtID’
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:120: warning: no semicolon at end of struct or union
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:122: error: syntax error before ‘windowId’
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:122: warning: data definition has no type or storage class
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include/grass/nviz.h:129: error: syntax error before ‘}’ token
make[2]: *** [OBJ.i386-apple-darwin9.3.0/change_view.o] Error 1

It seems to be some AGL programming issue.

-----
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

William Kyngesburye wrote:

On Jul 15, 2008, at 10:36 PM, William Kyngesburye wrote:

> In file included from change_view.c:20:
> /Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/
> include/grass/nviz.h:120: error: syntax error before �AGLPixelFmtID�

Hmm, I can't find AGLPixelFmtID *anywhere* in the OSX headers, and
there are no hits at Apple. Google only returns a few hits, all
mentioning that it's the AGL equivalent of "XVisualInfo" for pixel info.

According to:

http://developer.apple.com/documentation/GraphicsImaging/Reference/AGL_OpenGL/Reference/reference.html

it should be AGLPixelFormat (without the "ID" suffix).

And that's exactly what togl.c uses.

Also, I note that aglCreateAGLPixmap isn't mentioned on that page.
However, it does describe aglCreatePBuffer, which is probably the
appropriate function to use (similarly, the X11 implementation should
probably use pBuffers if they are available).

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

Michael Barton wrote:

Forgot to give the nviz error. Here it is:

Process: nviz [64828]
Path: /Applications/Grass/GRASS-7.0.app/Contents/MacOS/etc/
nviz2.2/nviz
Identifier: nviz
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: wish8.5 [64804]

Date/Time: 2008-07-15 22:36:04.896 -0700
OS Version: Mac OS X 10.5.4 (9E17)
Report Version: 6

Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000029
Crashed Thread: 0

Thread 0 Crashed:
0 nviz 0x00012abf Togl_CreateWindow + 1371

Is it possible to run it under GDB and find exactly where it crashed?

Note that "nviz" itself can't be debugged, as it's a shell script.
However, the script is essentially just:

  exec $GISBASE/etc/nviz2.2/nviz -f $GISBASE/etc/nviz2.2/scripts/nviz2.2_script ${1+"$@"}

So you can debug it with e.g.:

  gdb $GISBASE/etc/nviz2.2/nviz
  run -f /path/to/etc/nviz2.2/scripts/nviz2.2_script

I wonder if this might be an issue with Tcl/Tk 8.5; Togl depends quite
heavily upon Tcl/Tk internals, so it's likely to be quite
version-sensitive.

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

On Jul 16, 2008, at 2:45 AM, Glynn Clements wrote:

William Kyngesburye wrote:

On Jul 15, 2008, at 10:36 PM, William Kyngesburye wrote:

In file included from change_view.c:20:
/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/
include/grass/nviz.h:120: error: syntax error before �AGLPixelFmtID�

Hmm, I can't find AGLPixelFmtID *anywhere* in the OSX headers, and
there are no hits at Apple. Google only returns a few hits, all
mentioning that it's the AGL equivalent of "XVisualInfo" for pixel info.

According to:

http://developer.apple.com/documentation/GraphicsImaging/Reference/AGL_OpenGL/Reference/reference.html

it should be AGLPixelFormat (without the "ID" suffix).

And that's exactly what togl.c uses.

That works, but now it chokes on AGLPixmap...

Also, I note that aglCreateAGLPixmap isn't mentioned on that page.
However, it does describe aglCreatePBuffer, which is probably the
appropriate function to use (similarly, the X11 implementation should
probably use pBuffers if they are available).

... so I wonder if "AGLPixmap windowId;" should also be changed to "AGLPbuffer windowId;"?

Doing that works. But I imagine that the rest of the nviz library must be changed to use AGLPbuffers.

I didn't get errors elsewhere about missing AGL pixmap functions. I only see those in render.c, which I disabled to be able to compile libnviz.

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

"We are at war with them. Neither in hatred nor revenge and with no particular pleasure I shall kill every ___ I can until the war is over. That is my duty."

"Don't you even hate 'em?"

"What good would it do if I did? If all the many millions of people of the allied nations devoted an entire year exclusively to hating the ____ it wouldn't kill one ___ nor shorten the war one day."

<Ha, ha> "And it might give 'em all stomach ulcers."

- Tarzan, on war

I got further now. By ignoring render.c, libnviz compiles.

Now I'm in wxpython/nviz. I see that there is still the nviz header include order problem here. In wxpython nviz.h, the order should be:

extern "C" {
#include <grass/gis.h>
#include <grass/nviz.h>
#include <grass/gsurf.h>
#include <grass/gstypes.h>
}

And I see one in nviz.i:

%{
#include "nviz.h"
#include <grass/gsurf.h>
#include <grass/gstypes.h>
%}

Now I get an error in the swig wrapper:

c++ -I/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include -Os -fno-common -I/Library/Frameworks/GDAL.framework/Versions/1.5/Headers -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -I/usr/lib/wx/include/mac-unicode-debug-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ -DPACKAGE=\""grasslibs"\" -I/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include -o OBJ.i386-apple-darwin9.3.0/grass7_wxnviz_wrap.o -c grass7_wxnviz_wrap.cpp
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC but not for C++
/usr/include/wx-2.8/wx/mac/carbon/glcanvas.h:49: warning: ‘AGLDrawable’ is deprecated (declared at /System/Library/Frameworks/AGL.framework/Headers/agl.h:61)
/usr/include/wx-2.8/wx/mac/carbon/glcanvas.h:53: warning: ‘AGLDrawable’ is deprecated (declared at /System/Library/Frameworks/AGL.framework/Headers/agl.h:61)
grass7_wxnviz_wrap.cpp:3165: error: expected unqualified-id before ‘{’ token
grass7_wxnviz_wrap.cpp:3173: error: expected unqualified-id before ‘{’ token
grass7_wxnviz_wrap.cpp:3180: error: expected unqualified-id before ‘{’ token
grass7_wxnviz_wrap.cpp:3241: error: expected unqualified-id before ‘{’ token
grass7_wxnviz_wrap.cpp:3781: error: expected unqualified-id before ‘{’ token
grass7_wxnviz_wrap.cpp: In static member function ‘static int swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, Seq**)’:
grass7_wxnviz_wrap.cpp:3889: error: expected unqualified-id before ‘?’ token
make: *** [OBJ.i386-apple-darwin9.3.0/grass7_wxnviz_wrap.o] Error 1

The relevant lines (first case):

   template <class Type>
   struct traits_check<Type, value_category> {
     static bool check(PyObject *obj) {
       int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR;
       return SWIG_IsOK(res) ? true : false;
     }
   };

It's the check(PyObject) line. All the other errors are also on check(PyObject) lines (except that last one), which is:

      return pyseq.check() ? SWIG_OK : SWIG_ERROR;

I'm using the SWIG included in OSX Xcode 3.1: v1.3.31.

On Jul 16, 2008, at 8:33 AM, William Kyngesburye wrote:

On Jul 16, 2008, at 2:45 AM, Glynn Clements wrote:

According to:

http://developer.apple.com/documentation/GraphicsImaging/Reference/AGL_OpenGL/Reference/reference.html

it should be AGLPixelFormat (without the "ID" suffix).

And that's exactly what togl.c uses.

That works, but now it chokes on AGLPixmap...

Also, I note that aglCreateAGLPixmap isn't mentioned on that page.
However, it does describe aglCreatePBuffer, which is probably the
appropriate function to use (similarly, the X11 implementation should
probably use pBuffers if they are available).

... so I wonder if "AGLPixmap windowId;" should also be changed to "AGLPbuffer windowId;"?

Doing that works. But I imagine that the rest of the nviz library must be changed to use AGLPbuffers.

I didn't get errors elsewhere about missing AGL pixmap functions. I only see those in render.c, which I disabled to be able to compile libnviz.

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

"Time is an illusion - lunchtime doubly so."

- Ford Prefect

Hi,

2008/7/16 William Kyngesburye <woklist@kyngchaos.com>:

I got further now. By ignoring render.c, libnviz compiles.

render.c is just needed for nviz CLI module, in the future we need to
make working also off-screen rendering on Mac.

Now I'm in wxpython/nviz. I see that there is still the nviz header include
order problem here. In wxpython nviz.h, the order should be:

extern "C" {
#include <grass/gis.h>
#include <grass/nviz.h>
#include <grass/gsurf.h>
#include <grass/gstypes.h>
}

And I see one in nviz.i:

%{
#include "nviz.h"
#include <grass/gsurf.h>
#include <grass/gstypes.h>
%}

Now I get an error in the swig wrapper:

c++ -I/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include
-Os -fno-common -I/Library/Frameworks/GDAL.framework/Versions/1.5/Headers
-I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
-I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd
-fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX
-I/usr/include/ffi -DENABLE_DTRACE
-I/usr/lib/wx/include/mac-unicode-debug-2.8 -I/usr/include/wx-2.8
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__
-DPACKAGE=\""grasslibs"\"
-I/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/include -o
OBJ.i386-apple-darwin9.3.0/grass7_wxnviz_wrap.o -c grass7_wxnviz_wrap.cpp
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
C/ObjC but not for C++
/usr/include/wx-2.8/wx/mac/carbon/glcanvas.h:49: warning: 'AGLDrawable' is
deprecated (declared at
/System/Library/Frameworks/AGL.framework/Headers/agl.h:61)
/usr/include/wx-2.8/wx/mac/carbon/glcanvas.h:53: warning: 'AGLDrawable' is
deprecated (declared at
/System/Library/Frameworks/AGL.framework/Headers/agl.h:61)
grass7_wxnviz_wrap.cpp:3165: error: expected unqualified-id before '{' token
grass7_wxnviz_wrap.cpp:3173: error: expected unqualified-id before '{' token
grass7_wxnviz_wrap.cpp:3180: error: expected unqualified-id before '{' token
grass7_wxnviz_wrap.cpp:3241: error: expected unqualified-id before '{' token
grass7_wxnviz_wrap.cpp:3781: error: expected unqualified-id before '{' token
grass7_wxnviz_wrap.cpp: In static member function 'static int
swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, Seq**)':
grass7_wxnviz_wrap.cpp:3889: error: expected unqualified-id before '?' token
make: *** [OBJ.i386-apple-darwin9.3.0/grass7_wxnviz_wrap.o] Error 1

Hm, I am using the save version of swig (Linux box)...

Martin

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