How do I configure the LD_LIBRARY_PATH on Linux and DYLD_LIBRARY_PATH on MAC OS X to point to MCR?
조회 수: 158 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2019년 7월 29일
답변: MathWorks Support Team
2019년 7월 29일
How do I configure the LD_LIBRARY_PATH on Linux and DYLD_LIBRARY_PATH on MAC OS X to point to MCR?
채택된 답변
MathWorks Support Team
2019년 7월 29일
To set the LD_LIBRARY_PATH on Linux follow the steps below:
1. Determine Linux shell being used. Use the following command on the Linux terminal:
echo $SHELL
For a TCSH shell this will return "/bin/tcsh"
For a BASH shell this will return "/bin/bash"
2. Check if you have a .tcshrc or .bashrc file ("the startup file") on your system. These files are run whenever a new terminal is opened.
ls -all
3. If the startup file is not present, you can create one for TCSH/BASH respectively:
touch .tcshrc
touch .bashrc
4. Check if LD_LIBRARY_PATH has been set already:
echo $LD_LIBRARY_PATH
This will either return the value for LD_LIBRARY_PATH or the following message:
LD_LIBRARY_PATH: Undefined variable
5. Open the file for editing in vi for TCSH/BASH respectively:
vi .tcshrc
vi .bashrc
6. Append the paths from the Configuration Notes dialog box ("<mypath>") obtained during MCR installation.
If LD_LIBRARY_PATH was not already set (refer to Step 4), append the variable using the first line. Otherwise, use the second.
For BASH:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<mypath>
or
export LD_LIBRARY_PATH=<mypath>
For TCSH:
setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:<mypath>
or
setenv LD_LIBRARY_PATH <mypath>
7. Save and exit vi using Shift + :wq
8. Confirm the LD_LIBRARY_PATH has been set correctly. Open a new terminal and execute:
echo $LD_LIBRARY_PATH
This should now reflect the paths to the MCR that you just set.
NOTE:
To set DYLD_LIBRARY_PATH on MAC OS X 10.11 and newer, you must use the following syntax when running an application ("run.app"):
DYLD_LIBRARY_PATH="/my/path/to/mcr" ./run.app
This is because dynamic library environment variables are no longer copied to child processes, due to System Integrity Protection.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 C Shared Library Integration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!