Specify runtime path with mcc

5 次查看(过去 30 天)
Guido
Guido 2013-2-21
The Matlab compiler generates a run_<name>.sh script which sets the environment for the execution of a compiled Matlab model, which includes a number of LD_LIBRARY_PATH entries.
In my case I need an extra runtime path for a custom library. However, due to policy reasons, I am not supposed to permanently modify the LD_LIBRARY_PATH of the shell. As a quick hack I apply a patch script to run_<name>.sh which adds one entry to the LD_LIBRARY_PATH. I search for a cleaner solution than this.
  • My preferred solution would be to specify the runtime path through mcc in analogy to
gcc -Wl,-rpath,dir1:dir2
  • Alternatively, it would be still acceptable if I could get this extra path into the LD_LIBRARY_PATH settings of run_<name>.sh without patching this file.
  • Patching the Matlab installation itself is no option.
If nothing more elegant comes up, I would probably go for an extra wrapper file around run_<name>.sh.
Any ideas?
========================================================
I found a solution myself:
I simply add the custom library path to the MCR root path in the call of the run_<name>.sh script:
run_<name>.sh $CUSTOM_PATH:$MCR_ROOT <args>

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 C Shared Library Integration 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by