[GRASS-dev] X11 trouble on OSX 10.5

This seems to be an OSX 10.5 Leopard problem, so this is a heads-up, but maybe something similar has been seen on other platforms?

-----
some background:

Leopard updated to X11R7 - Tiger, Panther have R6.

Apple dropped the "Rn" part of the name, so it's just /usr/X11 now. The side effect makes new X11-linked software incompatible with Tiger. There is also a symlink from X11R6 to X11 so old Tiger X11 software can run on Leopard (assuming they're compatible).

It looks like Tiger's default is to build multi-module libraries (one for each object file), while now it's single-module libraries.
-----

First, linking -L/usr/X11/lib -lGL on OSX causes a weird link problem:

ld: cycle in dylib re-exports with /usr/X11/lib/libGL.dylib

After some digging around, this appears to be a common problem on Leopard, and the workaround is to use the -dylib_file flag:

-dylib_file /usr/X11/lib/libGL.dylib:/usr/X11/lib/libGL.dylib

So, this works for GRASS/NVIZ. But now there is another problem - maybe OSX-specific. Togl can't find ANY _glX* symbols in libGL:

Undefined symbols for architecture i386:
   "_glViewport", referenced from:
       _Togl_EventProc in togl.o
   "_glXChooseVisual", referenced from:
       _Togl_CreateWindow in togl.o
   "_glPixelStorei", referenced from:
       _Togl_DumpToEpsFile in togl.o
...

Linking with -undefined dynamic_lookup solves the build problem. NVIZ also runs, so it's finding those symbols at runtime. Though there are some visual glitches in the view pane that are mostly cleared up by resizing the window.

Another issue with X11/Tcltk in Leopard - gis.m won't run. I get an error:

GRASS 6.3.cvs (spearfish60):~ > X Error of failed request: BadMatch (invalid parameter attributes)
   Major opcode of failed request: 70 (X_PolyFillRectangle)
   Serial number of failed request: 2296
   Current serial number in output stream: 2337

Maybe this is a problem with Tcltk 8.5? Or the newer X11? or both? The error is meaningless to me, and there is no crash+crashlog to help figure it out.

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

The equator is so long, it could encircle the earth completely once.

William Kyngesburye wrote:

But now there is another problem -
maybe OSX-specific. Togl can't find ANY _glX* symbols in libGL:

Undefined symbols for architecture i386:
   "_glViewport", referenced from:
       _Togl_EventProc in togl.o
       _Togl_EventProc in togl.o
   "_glXChooseVisual", referenced from:
       _Togl_CreateWindow in togl.o
   "_glPixelStorei", referenced from:
       _Togl_DumpToEpsFile in togl.o
       _Togl_DumpToEpsFile in togl.o

The first and last ones aren't GLX functions, they're standard OpenGL
functions, so it isn't just GLX that's the problem.

Another issue with X11/Tcltk in Leopard - gis.m won't run. I get an
error:

GRASS 6.3.cvs (spearfish60):~ > X Error of failed request: BadMatch
(invalid parameter attributes)
   Major opcode of failed request: 70 (X_PolyFillRectangle)
   Serial number of failed request: 2296
   Current serial number in output stream: 2337

Maybe this is a problem with Tcltk 8.5? Or the newer X11? or both?
The error is meaningless to me, and there is no crash+crashlog to help
figure it out.

That can only be a Tk error. It's almost impossible to say what the
problem is; BadMatch can mean just about anything:

       BadMatch Some argument or pair of arguments has the correct type and
                 range but fails to match in some other way required by the
                 request.

IIRC, X_PolyFillRectangle corresponds to XFillRectangles, which most
GUI toolkits use extensively.

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

On Nov 10, 2007, at 5:12 PM, Glynn Clements wrote:

William Kyngesburye wrote:

But now there is another problem -
maybe OSX-specific. Togl can't find ANY _glX* symbols in libGL:

Undefined symbols for architecture i386:
  "_glViewport", referenced from:
      _Togl_EventProc in togl.o
  "_glXChooseVisual", referenced from:
      _Togl_CreateWindow in togl.o
  "_glPixelStorei", referenced from:
      _Togl_DumpToEpsFile in togl.o

The first and last ones aren't GLX functions, they're standard OpenGL
functions, so it isn't just GLX that's the problem.

Tired brain. I saw a lot of glx in there (about a dozen or so more that I didn't copy-n-paste).

Another issue with X11/Tcltk in Leopard - gis.m won't run. I get an
error:

GRASS 6.3.cvs (spearfish60):~ > X Error of failed request: BadMatch
(invalid parameter attributes)
  Major opcode of failed request: 70 (X_PolyFillRectangle)
  Serial number of failed request: 2296
  Current serial number in output stream: 2337

Maybe this is a problem with Tcltk 8.5? Or the newer X11? or both?
The error is meaningless to me, and there is no crash+crashlog to help
figure it out.

That can only be a Tk error. It's almost impossible to say what the
problem is; BadMatch can mean just about anything:

      BadMatch Some argument or pair of arguments has the correct type and
                range but fails to match in some other way required by the
                request.

IIRC, X_PolyFillRectangle corresponds to XFillRectangles, which most
GUI toolkits use extensively.

More info, I forgot: the GUI splash displays just before this error.

Definitely something wrong in TclTk 8.5. The GUI runs with 8.4 (32bits).

The reason I tried 8.5 is that 8.4 does not build 64bits on OSX (configure actually removes any 64bit flags you try to add). I suppose the GUI itself doesn't need to run in 64bits, as long as the modules are 64bits they will run as such.

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

"Mon Dieu! but they are all alike. Cheating, murdering, lying, fighting, and all for things that the beasts of the jungle would not deign to possess - money to purchase the effeminate pleasures of weaklings. And yet withal bound down by silly customs that make them slaves to their unhappy lot while firm in the belief that they be the lords of creation enjoying the only real pleasures of existence....

- the wisdom of Tarzan

This sounds like sort of good news. No reason for the GUI to run in 64 bit
mode AFAICT. It might make the displays run a tiny bit faster, but most of
any display delay is on the GRASS side rendering the PPM to display in
TclTk.

One Mac issue I need to mention. In the current cvs version (on 10.4) GRASS
help no longer is listed in my Help Library, although the GRASS addons help
IS listed. It's not a huge issue as help comes up OK from within GRASS, but
it was handy having it in the library listing too.

Michael

On 11/10/07 6:32 PM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

On Nov 10, 2007, at 5:12 PM, Glynn Clements wrote:

William Kyngesburye wrote:

But now there is another problem -
maybe OSX-specific. Togl can't find ANY _glX* symbols in libGL:

Undefined symbols for architecture i386:
  "_glViewport", referenced from:
      _Togl_EventProc in togl.o
      _Togl_EventProc in togl.o
  "_glXChooseVisual", referenced from:
      _Togl_CreateWindow in togl.o
  "_glPixelStorei", referenced from:
      _Togl_DumpToEpsFile in togl.o
      _Togl_DumpToEpsFile in togl.o

The first and last ones aren't GLX functions, they're standard OpenGL
functions, so it isn't just GLX that's the problem.

Tired brain. I saw a lot of glx in there (about a dozen or so more
that I didn't copy-n-paste).

Another issue with X11/Tcltk in Leopard - gis.m won't run. I get an
error:

GRASS 6.3.cvs (spearfish60):~ > X Error of failed request: BadMatch
(invalid parameter attributes)
  Major opcode of failed request: 70 (X_PolyFillRectangle)
  Serial number of failed request: 2296
  Current serial number in output stream: 2337

Maybe this is a problem with Tcltk 8.5? Or the newer X11? or both?
The error is meaningless to me, and there is no crash+crashlog to
help
figure it out.

That can only be a Tk error. It's almost impossible to say what the
problem is; BadMatch can mean just about anything:

      BadMatch Some argument or pair of arguments has the correct
type and
                range but fails to match in some other way required
by the
                request.

IIRC, X_PolyFillRectangle corresponds to XFillRectangles, which most
GUI toolkits use extensively.

More info, I forgot: the GUI splash displays just before this error.

Definitely something wrong in TclTk 8.5. The GUI runs with 8.4
(32bits).

The reason I tried 8.5 is that 8.4 does not build 64bits on OSX
(configure actually removes any 64bit flags you try to add). I
suppose the GUI itself doesn't need to run in 64bits, as long as the
modules are 64bits they will run as such.

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

"Mon Dieu! but they are all alike. Cheating, murdering, lying,
fighting, and all for things that the beasts of the jungle would not
deign to possess - money to purchase the effeminate pleasures of
weaklings. And yet withal bound down by silly customs that make them
slaves to their unhappy lot while firm in the belief that they be the
lords of creation enjoying the only real pleasures of existence....

- the wisdom of Tarzan

__________________________________________
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-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

On Nov 12, 2007, at 10:13 AM, Michael Barton wrote:

One Mac issue I need to mention. In the current cvs version (on 10.4) GRASS
help no longer is listed in my Help Library, although the GRASS addons help
IS listed. It's not a huge issue as help comes up OK from within GRASS, but
it was handy having it in the library listing too.

The install puts a symlink in /Library/Documentation/Help. If you move or rename the GRASS app after install, this will break, but as you found g.manual still knows where the files are.

One idea that's been pushed to the back of my brain is to install the actual help files in the Documentation folder. But this would complicate g.manual and GUI help references, and the bindist installer package setup.

Michael

More info, I forgot: the GUI splash displays just before this error.

Definitely something wrong in TclTk 8.5. The GUI runs with 8.4
(32bits).

The reason I tried 8.5 is that 8.4 does not build 64bits on OSX
(configure actually removes any 64bit flags you try to add). I
suppose the GUI itself doesn't need to run in 64bits, as long as the
modules are 64bits they will run as such.

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

Earth: "Mostly harmless"

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