Specify runtime path with mcc

4 visualizaciones (últimos 30 días)
Guido
Guido el 21 de Feb. de 2013
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>

Respuestas (0)

Categorías

Más información sobre C Shared Library Integration en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by