[GRASS5] 5.7: compilation shared libs on Mac OSX failure

Glynn Clements glynn.clements at virgin.net
Wed Nov 19 16:44:35 EST 2003


Markus Neteler wrote:

> Just for the record:
> 
> While the compilation runs ok now, I faced another
> problem with GRASS 5.7/shared libs on MacOSX when using it:
> 
> dyld: /usr/local/grass57-17_11_2003/etc/lock can't open library:
> /grass57exp/dist.powerpc-apple-darwin6.8/lib/libgrass_gis.dylib  (No such file or directory, errno = 2)
> /usr/local/grass57-17_11_2003/etc/Init.sh: line 147:   784 Trace/BPT
> trap          "$ETC/lock" "$lockfile" $$
> Unable to properly access /Users/fabrizio/.gislock57
> Please notify system personel.
> 
> Programs (all?) such as 'etc/lock' have the path to the dynamic
> library hardcoded. After installation into a different place
> (e.g. /usr/local/something) it still searches the old
> path used at compile time.
> 
> Solution:
> 
> On MacOSX one has to set DYLD_LIBRARY_PATH (instead of LD_LIBRARY_PATH).
> After patching /etc/Init.sh GRASS 5.7 with shared libs on MacOSX works now.
> The relevant file in CVS is updated (needs still a trivial fix for
> "powermac").

Note that SC_CONFIG_CFLAGS in aclocal.m4 sets the variable
LD_LIBRARY_PATH_VAR to the name of the appropriate variable, i.e.:

	Rhapsody-*|Darwin-*)
		...
	    LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"

Maybe that can be used when creating Init.sh from init.sh.

One thing which stood out when examining SC_CONFIG_CFLAGS was this:

		CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
		LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}

I don't know how (or even if) this actually gets used, but it may
cause problems with moving shared libraries (-rpath embeds the library
path into the executable).

Reminder: there is a problem (at least with 5.0/5.3 on Linux) with
shared libraries and tcltkgrass. If tcltkgrass spawns an xterm to run
a particular command, LD_LIBRARY_PATH is reset (as a security measure,
because xterm is setuid root). The GRASS command which is being run
then fails because it can't find its shared libraries.

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list