How do I use Dependency Walker with MATLAB?

52 views (last 30 days)
I am facing issues with missing dependencies while working in MATLAB (for example when calling a MEX file).
How do I create a runtime profile of MATLAB using Dependency Walker?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 19 Feb 2021
Edited: MathWorks Support Team on 19 Feb 2021
Dependency Walker is a free tool that allows you to view the dependencies of a portable executable (e.g. EXE, DLL files). In addition, you can profile your module to view the runtime dependencies.
Follow below steps on Windows 64-bit to create a runtime profile of MATLAB:
1) Download the "x64" version of Dependency Walker from the following website: http://dependencywalker.com.
2) Extract the archive and launch 'depends.exe'.
3) Click File > Open and select $MATLAB\bin\win64\matlab.exe, where $MATLAB is the MATLAB root directory on your machine, as returned by typing 'matlabroot' at the MATLAB Prompt.
4) Dependency Walker will now create the module dependency tree and modules list for MATLAB.exe. This may take a few minutes on Windows 10 (ignore the "Not responding" message).
5) A pop-up window reading "Errors were detected when processing "<...>\MATLAB.EXE" will appear. Note that Dependency Walker will show errors even for working applications; these missing libraries are not expected to exist on most systems, and are not cause for concern. You may ignore the warning and click "OK".
6) Click Profile > Start Profiling. A pop-up window will open. Check the box "Use full paths when logging filenames" and uncheck the box "Automatically open and profile child processes". If the issue is not related to Java VM, add "-nojvm" to the "Program arguments" field to accelerate the process (this means that only the Command Window of MATLAB is going to open). Then click "OK".
7) MATLAB should start after a few minutes. Again, this may take 5-30 minutes on Windows 10, depending on which MATLAB Release you are profiling.
8) Now work in MATLAB as usual and reproduce the dependency issue that you would like to analyze. For example, call your MEX file from within MATLAB. Dependency Walker will display your MEX file as a dependency of MATLAB, as well as the libraries your MEX file depends upon.
9) To save the output of Dependency Walker, click File > Save As. The file should be saved with a DWI extension.
To analyze the results of the Dependency Walker session, you can refer to the following links:
Otherwise, you can send .DWI file that you saved in step 9 to MathWorks Technical Support so that they can help you.

More Answers (0)

Categories

Find more on Troubleshooting in MATLAB Compiler SDK in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!