[GRASS-dev] nviz on mac

nviz still crashes on my macintel -last friday cvs building- with openGL flags.
************************************************************
Date/Time: 2007-05-14 09:51:39.453 +0200
OS Version: 10.4.9 (Build 8P2137)
Report Version: 4

Command: nviz
Path: /Applications/GRASS-6.3.app/Contents/Resources/etc/nviz2.2/nviz
Parent: wish8.4 [13178]

Version: ??? (???)

PID: 13189
Thread: 0

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0x6e614320

Thread 0 Crashed:
0 libX11.6.dylib 0x00709cd2 XQueryExtension + 51
1 libGL.1.dylib 0x006745f3 glXQueryExtension + 62
2 nviz 0x000149bf Togl_CreateWindow + 56 (togl.c:1805)
3 com.tcltk.tklibrary 0x9adbf131 Tk_MakeWindowExist + 120
4 nviz 0x00015e89 Togl_Cmd + 1046 (togl.c:1572)
5 com.tcltk.tcllibrary 0x9acbe16f TclInvokeStringCommand + 121
6 com.tcltk.tcllibrary 0x9acc08e1 TclEvalObjvInternal + 733
7 com.tcltk.tcllibrary 0x9ace365a TclExecuteByteCode + 3101
8 com.tcltk.tcllibrary 0x9ace8442 TclCompEvalObj + 279
9 com.tcltk.tcllibrary 0x9ad0f261 TclObjInterpProc + 524
10 com.tcltk.tcllibrary 0x9acc08e1 TclEvalObjvInternal + 733
11 com.tcltk.tcllibrary 0x9acc0be8 Tcl_EvalEx + 488
12 com.tcltk.tcllibrary 0x9acfe930 Tcl_FSEvalFile + 400
13 com.tcltk.tcllibrary 0x9acfea14 Tcl_EvalFile + 47
14 com.tcltk.tklibrary 0x9ad95291 Tk_MainEx + 835
15 nviz 0x00012e4f main + 102 (nvizMain.c:64)
16 nviz 0x0000205a _start + 216
17 nviz 0x00001f81 start + 41

Thread 1:
0 libSystem.B.dylib 0x9001a93c select + 12
1 libSystem.B.dylib 0x90024987 _pthread_body + 84

On May 14, 2007, at 6:34 AM, Agustin Diez Castillo wrote:

nviz still crashes on my macintel -last friday cvs building- with openGL flags.

What do you get from:

otool -L /Applications/GRASS-6.3.app/Contents/Resources/etc/nviz2.2/nviz

Particularly, what does it say for Tcl and Tk?

And, did you also use the --x-includes and -x-libraries flags?

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

On May 14, 2007, at 10:37 AM, Agustin Diez Castillo wrote:

From otool -L /Applications/GRASS-6.3.app/Contents/Resources/etc/nviz2.2/nviz, I get:
/Applications/GRASS-6.3.app/Contents/Resources/lib/libgrass_ogsf.dylib (compatibility version 6.3.0, current version 6.3.0)

        /System/Library/Frameworks/Tk.framework/Versions/8.4/Tk (compatibility version 8.4.0, current version 8.4.0)
        /System/Library/Frameworks/Tcl.framework/Versions/8.4/Tcl (compatibility version 8.4.0, current version 8.4.0)

Somehow it linked the system TclTk frameworks. Not good.

Do you still have the make output? I wonder what the link command was for NVIZ - either -L/usr/lib is in it so it finds the system TclTk first, or you have a symlink in /usr/X11R6/lib (or somewhere else) to the system tcltk.

If you don't have the make output, the linking used could be reconstructed from your platform.make.

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

All generalizations are dangerous, even this one.

Thanks to William nviz is working now on my macintel, latest grass6.3 compilation.

On May 17, 2007, at 8:54 PM, William Kyngesburye wrote:

Add these symlinks:

sudo ln -s libtcl8.4.dylib /usr/local/tcltk/lib/libtcl.dylib

sudo ln -s libtk8.4.dylib /usr/local/tcltk/lib/libtk.dylib

On May 18, 2007, at 5:29 AM, Agustin Diez Castillo wrote:

Thanks to William nviz is working now on my macintel, latest grass6.3 compilation.

On May 17, 2007, at 8:54 PM, William Kyngesburye wrote:

Add these symlinks:

sudo ln -s libtcl8.4.dylib /usr/local/tcltk/lib/libtcl.dylib
sudo ln -s libtk8.4.dylib /usr/local/tcltk/lib/libtk.dylib

What he said. Long explanation:

It appears that the standard TclTk build doesn't create those symlinks. So, while you specify the correct dir and configure finds it, the linker doesn't and falls back to the system tcltk, which causes NVIZ to crash (older Aqua tcltk).

(I had partially fixed this on my Mac a while back and forgot about it, and it's been working for me.)

I added the sylink step to the TclTk build instructions in the OSX readme. Hopefully this will take care of the mysterious OSX NVIZ problems many people have been having.

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