Пути на библиотеку приложения на CentOS

Это могло бы помочь: http://support.microsoft.com/kb/968543

3
задан 24 October 2012 в 14:58
2 ответа

Embedded search paths

There is one option that will give you what you want:

When building an application you can set the LD_RUN_PATH environment variable and this will get compiled into the application. In theory the chrpath command will let you modify the embedded path in an application without needing to recompile it, but I've never tested this myself.

chrpath is available in Fedora, but I can't find an authoritative source for the, err, source.

You mention DYLD_* variables, which suggests you're working under OS X, in which case the above may not apply to you. This is certainly true for Linux but the OS X runtime linker may not operate the same way (and chrpath may be a Linux-only tool).

Managing your environment

A common way of managing per-application LD_LIBRARY_PATH settings is a wrapper script, as ewwhite suggested, or by using something like the Environment Modules project. This lets you package up environment variable settings (and more) into distinct units so that you do something like:

module load myapplication

And have your PATH, LD_LIBRARY_PATH, MANPATH and everything else set up appropriately for access to myapplication. And when you're done, you can:

module unload myapplication

To undo the environment changes.

4
ответ дан 3 December 2019 в 06:12

The normal approach to this in my background has been to use a wrapper script to execute the applications. In that wrapper script, the LD_LIBRARY_PATH would be set for the specific application. The variable could optionally be unset after execution is done.

0
ответ дан 3 December 2019 в 06:12

Теги

Похожие вопросы