[GRASS-dev] error compiling nviz for Mac

Today’s update from the cvs has a problem compiling nviz. It probably has to do with issues recently discussed on the developer list.

Configure can no longer automatically find Open GL includes, even though Open GL is set to x11 and Open GL libs are specified. If I add a configure option for gl includes (/usr/X11R6/include) it configures fine.

When we run make, there is an error compiling nviz. Going to the nviz directory and running make there produces the following error.

Medland-G5:~/grass6/visualization/nviz amiller1$ make
cd src ; make
gcc -I/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include -g -O2 -I/usr/local/tcltk/include -I/usr/local/tcltk/include -I/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include -I/Library/Frameworks/UnixImageIO.framework/unix/include -I/Library/Frameworks/GDAL.framework/unix/include -DPACKAGE="“grassmods”" -I/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include
-o OBJ.powerpc-apple-darwin8.9.0/nvizAppInit.o -c nvizAppInit.c
In file included from nvizAppInit.c:8:
togl.h:53:23: error: GL/gl.h: No such file or directory
In file included from nvizAppInit.c:8:
togl.h:165: error: parse error before “Togl_LoadBitmapFont”
togl.h:165: warning: data definition has no type or storage class
togl.h:166: error: parse error before “GLuint”
togl.h:215: error: parse error before “left”
In file included from nvizAppInit.c:9:
interface.h:15:20: error: GL/glu.h: No such file or directory
In file included from /Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/gstypes.h:340,
from interface.h:23,
from nvizAppInit.c:9:
/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/ogsf_proto.h:200: warning: parameter names (without types) in function declaration
/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/ogsf_proto.h:201: error: parse error before “GLuint”
/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/ogsf_proto.h:458: error: parse error before “gsd_set_font”
/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/ogsf_proto.h:458: warning: data definition has no type or storage class
/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/ogsf_proto.h:461: error: parse error before “float”
/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/ogsf_proto.h:474: error: parse error before “GLuint”
/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/ogsf_proto.h:494: error: parse error before “GLuint”
/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/ogsf_proto.h:498: error: parse error before “GLuint”
/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/ogsf_proto.h:556: error: parse error before “int”
/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/ogsf_proto.h:748: error: parse error before “gsd_put_legend”
/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/ogsf_proto.h:748: error: parse error before “GLuint”
/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/ogsf_proto.h:748: warning: data definition has no type or storage class
/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include/grass/ogsf_proto.h:749: warning: parameter names (without types) in function declaration
In file included from nvizAppInit.c:9:
interface.h:67: error: parse error before “FontBase”
interface.h:67: warning: data definition has no type or storage class
interface.h:280: error: parse error before “load_font”
interface.h:280: warning: data definition has no type or storage class
make[1]: *** [OBJ.powerpc-apple-darwin8.9.0/nvizAppInit.o] Error 1
make: *** [nvwish] Error 2

Michael


Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

Michael Barton wrote:

Today¹s update from the cvs has a problem compiling nviz. It probably has to
do with issues recently discussed on the developer list.

Configure can no longer automatically find Open GL includes, even though
Open GL is set to x11 and Open GL libs are specified. If I add a configure
option for gl includes (/usr/X11R6/include) it configures fine.

When we run make, there is an error compiling nviz. Going to the nviz
directory and running make there produces the following error.

Medland-G5:~/grass6/visualization/nviz amiller1$ make
cd src ; make
gcc -I/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include -g -O2
-I/usr/local/tcltk/include -I/usr/local/tcltk/include
-I/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include
-I/Library/Frameworks/UnixImageIO.framework/unix/include
-I/Library/Frameworks/GDAL.framework/unix/include
-DPACKAGE=\""grassmods"\"
-I/Users/amiller1/grass6/dist.powerpc-apple-darwin8.9.0/include \
        -o OBJ.powerpc-apple-darwin8.9.0/nvizAppInit.o -c nvizAppInit.c
In file included from nvizAppInit.c:8:
togl.h:53:23: error: GL/gl.h: No such file or directory

I don't see /usr/X11R6/include in there.

Check Platform.make, specifically OPENGL_X11 and XCFLAGS.

OPENGLINC doesn't actually get used in nviz/src/Makefile, although it
is used int the configure header checks; I'll fix that.

Ordinarily, XCFLAGS would add -I/usr/X11R6/include; however, that
might not happen if you have a symlink:

  /usr/include/X11 -> /usr/X11R6/include/X11

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

On May 10, 2007, at 1:45 PM, Michael Barton wrote:

Today’s update from the cvs has a problem compiling nviz. It probably has to do with issues recently discussed on the developer list.

Configure can no longer automatically find Open GL includes, even though Open GL is set to x11 and Open GL libs are specified. If I add a configure option for gl includes (/usr/X11R6/include) it configures fine.

It's odd. I can't figure it out, since it still works for me - just like in the example in the macosx readme.

When we run make, there is an error compiling nviz. Going to the nviz directory and running make there produces the following error.

One problem I noticed with specifying opengl-includes, instead of x-includes, is that NVIZ includes the X11 headers setting but not the OpenGL headers setting.

EXTRA_INC = $(VECT_INC)
EXTRA_CFLAGS= $(TCLINCDIR) $(TKINCDIR) \
  $(INC) \
  $(TIFFINCPATH) $(FFMPEGINCPATH) $(DSPINC) \
  $(VECT_CFLAGS)

ifeq ($(OPENGL_X11),1)
EXTRA_CFLAGS += $(XCFLAGS)
endif

Even if you get opengl to work by changing this to add the opengl includes, the X11 problem will still remain. Somehow, the X11 check in configure is failing for some Mac users, unless x-libraries and x-headers are explicitly set.

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

"Those people who most want to rule people are, ipso-facto, those least suited to do it."

- A rule of the universe, from the HitchHiker's Guide to the Galaxy

William Kyngesburye wrote:

Even if you get opengl to work by changing this to add the opengl
includes, the X11 problem will still remain. Somehow, the X11 check
in configure is failing for some Mac users, unless x-libraries and x-
headers are explicitly set.

autoconf's X checks attempt to determine the directories by running
xmkmf on a minimal Imakefile and extracting the directories from the
resulting Makefile.

If your imake setup is either broken or weird enough to confuse
autoconf's checks, you'll probably need to specify the directories
explicitly.

autoconf does have a fallback in case the imake approach fails
completely, but it won't be used if it gets any answer (even a wrong
answer) from the imake check.

Unfortunately, config.log probably won't tell you anything useful. If
you want to figure out why AC_PATH_X doesn't work, you need to analyse
the output from "sh -x configure ...".

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

On May 10, 2007, at 3:28 PM, Glynn Clements wrote:

William Kyngesburye wrote:

Even if you get opengl to work by changing this to add the opengl
includes, the X11 problem will still remain. Somehow, the X11 check
in configure is failing for some Mac users, unless x-libraries and x-
headers are explicitly set.

autoconf's X checks attempt to determine the directories by running
xmkmf on a minimal Imakefile and extracting the directories from the
resulting Makefile.

Thanks for the clarification on that. When I poked around in configure to see how it checked for X11, I saw the list of dirs and thought it just tested for the existence of certain files. Instead it's actually trying to run something.

I don't know enough about X to say if something is getting messed up with OSX's X11 setup. But it sounds like it's not a direct GRASS problem. I'll add a note about that to the OSX readme configure example.

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

All generalizations are dangerous, even this one.

The weird think is this same Mac G5 compiled GRASS just fine yesterday
morning and bombed this afternoon. No change to the system in between times.

Michael

On 5/10/07 1:46 PM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

On May 10, 2007, at 3:28 PM, Glynn Clements wrote:

William Kyngesburye wrote:

Even if you get opengl to work by changing this to add the opengl
includes, the X11 problem will still remain. Somehow, the X11 check
in configure is failing for some Mac users, unless x-libraries and x-
headers are explicitly set.

autoconf's X checks attempt to determine the directories by running
xmkmf on a minimal Imakefile and extracting the directories from the
resulting Makefile.

Thanks for the clarification on that. When I poked around in
configure to see how it checked for X11, I saw the list of dirs and
thought it just tested for the existence of certain files. Instead
it's actually trying to run something.

I don't know enough about X to say if something is getting messed up
with OSX's X11 setup. But it sounds like it's not a direct GRASS
problem. I'll add a note about that to the OSX readme configure
example.

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

All generalizations are dangerous, even this one.

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

I just added a note to the OSX readme example. Basically, add to configure line:

--x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib

The opengl-includes option may or may not be needed after this.

On May 10, 2007, at 5:57 PM, Michael Barton wrote:

The weird think is this same Mac G5 compiled GRASS just fine yesterday
morning and bombed this afternoon. No change to the system in between times.

Michael

On 5/10/07 1:46 PM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

Thanks for the clarification on that. When I poked around in
configure to see how it checked for X11, I saw the list of dirs and
thought it just tested for the existence of certain files. Instead
it's actually trying to run something.

I don't know enough about X to say if something is getting messed up
with OSX's X11 setup. But it sounds like it's not a direct GRASS
problem. I'll add a note about that to the OSX readme configure
example.

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

Earth: "Mostly harmless"

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

Could it be because this is on a G5 rather than an intel Mac?

Michael

On 5/10/07 12:31 PM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

On May 10, 2007, at 1:45 PM, Michael Barton wrote:

Today¹s update from the cvs has a problem compiling nviz. It
probably has to do with issues recently discussed on the developer
list.

Configure can no longer automatically find Open GL includes, even
though Open GL is set to x11 and Open GL libs are specified. If I
add a configure option for gl includes (/usr/X11R6/include) it
configures fine.

It's odd. I can't figure it out, since it still works for me - just
like in the example in the macosx readme.

When we run make, there is an error compiling nviz. Going to the
nviz directory and running make there produces the following error.

One problem I noticed with specifying opengl-includes, instead of x-
includes, is that NVIZ includes the X11 headers setting but not the
OpenGL headers setting.

EXTRA_INC = $(VECT_INC)
EXTRA_CFLAGS= $(TCLINCDIR) $(TKINCDIR) \
$(INC) \
$(TIFFINCPATH) $(FFMPEGINCPATH) $(DSPINC) \
$(VECT_CFLAGS)

ifeq ($(OPENGL_X11),1)
EXTRA_CFLAGS += $(XCFLAGS)
endif

Even if you get opengl to work by changing this to add the opengl
includes, the X11 problem will still remain. Somehow, the X11 check
in configure is failing for some Mac users, unless x-libraries and x-
headers are explicitly set.

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

"Those people who most want to rule people are, ipso-facto, those
least suited to do it."

- A rule of the universe, from the HitchHiker's Guide to the Galaxy

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

No, I've seen others on OSX Intel with this problem.

On May 10, 2007, at 10:59 PM, Michael Barton wrote:

Could it be because this is on a G5 rather than an intel Mac?

Michael

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

"This is a question about the past, is it? ... How can I tell that the past isn't a fiction designed to account for the discrepancy between my immediate physical sensations and my state of mind?"

- The Ruler of the Universe