Bug #160

anidot does not work on a mac, unless development tools are installed (needs /usr/lib/libltdl.3.dylib)

Added by Axel Belinfante almost 11 years ago. Updated almost 11 years ago.

Status:NewStart date:20 Aug 2009
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

when JTorX is started on a mac on which no development tools are installed,
anidot windows appear, but on stdout/stderr of JTorX
(only visible when JTorX is started from a terminal window)
the following appears:

anidotsrv : could not require package Tcldot: dlopen(libtcldot_builtin.dylib, 6): Library not loaded: /usr/lib/libltdl.3.dylib
Referenced from: /private/var/folders/[some path elided]/-Tmp-/tcldotlib/libtcldot_builtin.dylib
Reason: image not found

when an attempt is made to make anidot show an automaton, as JTorX typically does,
an error popup window appears:
Error: invalid command name "dotnew"

work around: make sure that development tools are installed.

alternative workaround: only install /usr/lib/libltdl.3.dylib
either in the given path, or in another default location where
dlopen looks, like $(HOME)/lib.
see the description of DYLD_FALLBACK_LIBRARY_PATH
in manual page dlopen(3)

in the code of anidot we can almost fix this.
we can just distribute libltdl.3.dylib next to libtcldot_builtin.dylib
however, we then still have to make sure that it is found.

this is a bit tricky when we use anidot.kit, because we copy the
library .dylib files out of the .kit archive to a temporary location
on disk.
we then cd to that location,
load the .dylib
and return to the original location.

it will find the tcldot dylib, but not the libltdl one that is referenced from it.
However, if DYLD_LIBRARY_PATH contains .
then it will find the libltdl also -- this is nice, because we only decide
on the temporary location when we run the lib/tcldot/pkgIndex.tcl script.

now there is one ugly problem remaining:
setting DYLD_LIBRARY_PATH from a script that is run by tclkit
does not seem to affect the dlopen that is executed by that tclkit.
i.e. we can not change the lookup paths from within the scripts.
To work around that, we either have to set DYLD_LIBRARY_PATH
in a wrapper around "tclkit anidot.kit", or we could set the
DYLD_LIBRARY_PATH in a tcl script, and then exec a fresh instance
of tclkit to do the actual work.
The latter approach is appealing (hide issues from end-user) but nasty.

libltdl.3.dylib (156 KB) Axel Belinfante, 20 Aug 2009 15:04


Related issues

Related to JTorX - Bug #222: JTorX animation viewers do not work on Mac OS X 10.6 New 26 Nov 2009
Related to JTorX - Bug #546: Mac OS 10.7 (Lion): Automaton visualizations do not work ... Feedback 24 Jul 2011

History

#1 Updated by Axel Belinfante almost 11 years ago

attached libltdl.3.dylib to allow copying it to directory $HOME/lib as workaround.

Once it has been copied there and any running anidot has been closed,
any new anidot instance that is started (e.g. by JTorX) will work as intended.

Also available in: Atom PDF