[PD] LD_PRELOAD on Linux?

IOhannes m zmölnig zmoelnig at iem.at
Sun Jan 11 13:31:11 CET 2015

On 01/10/15 22:07, Jonghyun Kim wrote:
> FYI, leapmotion.pd_linux compiled with flext(c++).

disclaimer: this is only general advice, i don't have a leapmotion nor
ever used the external in question.

- properly link leapmotion.pd_linux against libLeap.so
if you do
$ ldd leapmotion.pd_linux | grep -i leap
you should see a line containing "libLeap.so"

- make sure that the libLeap.so library can be found by the runtime linker.
you can see that it is not found properly, if the above cmdline gives
you something like:
  libLeap.so => not found

there are two ways to fix this:
- either use the environment variable LD_LIBRARY_PATH to point to the
path where libLeap.so is liven before starting Pd (this is a hack; if
possible do not use it; it's also very similar to what you already have)
- install libLeap.so into a place that is searched automatically by your
linker (e.g. /usr/local/lib)

the second one is obviously preferred.
if - for whatever reasons - you want to keep using an evnironment
variable, you could create a wrapper script, that you run instead of the
actual Pd-binary, and which set's up the envvar:
 LD_LIBRARY_PATH=/path/to/my/leap-library/ /usr/bin/pd $@

if your actual Pd-binary is /usr/bin/pd (as installed by the Debian
packages, e.g. on  ubuntu), you could even call this script "pd" and put
it into "/usr/local/bin" (requires root).
if you then type "pd" on the cmdline, it will call the script from
/usr/local which in turn calls the binary in /usr/bin...


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150111/2dd290c2/attachment.sig>

More information about the Pd-list mailing list