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 Center および File ExchangeC Shared Library Integration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by