[GRASS-dev] nviz crashes on MacOSX

Glynn Clements glynn at gclements.plus.com
Thu Apr 19 15:19:01 EDT 2007


Agustin Diez Castillo wrote:

> I did compile with TCLTKPREFIX=/usr/local/tcltk. At first it refuses  
> to launch grass, if the terminal was already open nothing happened  
> otherwise I got this:
> ************************************************************************ 
> *******************
> GRASS 6.3.cvs (Projecte):/Applications/GRASS-6.3.app/Contents/ 
> Resources > gis.m &
> GRASS 6.3.cvs (Projecte):/Applications/GRASS-6.3.app/Contents/ 
> Resources > Xlib: connection to ":0.0" refused by server
> Xlib: No protocol specified
> 
> Application initialization failed: couldn't connect to display ":0.0"
> Xlib: connection to ":0.0" refused by server
> Xlib: No protocol specified

This implies that no X server is running.

If you want to use the Aqua Tcl/Tk, set the environment variable
GRASS_WISH to the full path to the Aqua "wish" (or "wish8.4" etc)
executable.

> After fixing .grassrc GRASS_GUI=tcltk (as expected it changes to text  
> after failure) it starts either the aqua tclktk or the x11 one  
> (arbitrarily as far as I can say);

The default setting for GRASS_WISH is just "wish", so gis.m will use
whichever "wish" program comes first in $PATH.

> after several tryouts I got what I  
> want grass started from x11 but nviz still crashes, I have tried from  
> both the icon and the terminal. Now everything I try but nviz is working

Whereas gis.m is written entirely in Tcl/Tk, and uses the standard
"wish" Tcl/Tk interpreter, NVIZ is a hybrid C + Tcl/Tk application
which links against the Tcl/Tk libraries.

Consequently, the Tcl/Tk implementation used by NVIZ is determined at
compile-time. As NVIZ also uses OpenGL, the Tcl/Tk implementation has
to match the OpenGL implementation. If it uses the X11 Tcl/Tk, it must
also use X11 OpenGL (GLX); if it uses native (Aqua) Tcl/Tk, it must
use native OpenGL (AGL).

The default OpenGL implementation is the X11 one; if you want the
native version, you must use --with-opengl=mac.

The Tcl/Tk implementation is determined by the
--with-tcltk-{libs,headers} switches. However, if you use other
libraries from a directory which contains the X11 Tcl/Tk libraries
(e.g. /usr/local/lib), it's possible that it will end up using the X11
version even if you point --with-tcltk-libs at the Aqua version.

Ultimately, there's no way to tell the linker to link specific
libraries from specific directories. You specify a list of directories
and a list of libraries, and all libraries are located using the same
list of directories.

If you have multiple versions of a particular library, this can cause
problems. Sometimes, the only solution is to create a separate
directory, populate it with symlinks to the libraries which you
actually wish to use, then specify that directory instead of e.g. 
/usr/local/lib etc.

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




More information about the grass-dev mailing list