Clear Filters
Clear Filters

compiler issue - 'Dependecy problem'

13 views (last 30 days)
lp2015
lp2015 on 6 Oct 2016
Edited: Mihaela Duta on 13 Oct 2016
Hi all,
I'm having issues with matlab's deploytool while I try to compile a program that uses the psychtoolbox libary. I do not have issues using the compiler with programs that do not use psychtoolbox. I know that psychtoolbox isn't an official mathworks toolbox but I think this might be a problem with my use of the the compiler more than a problem with psychtoolbox.
A few details:
Os: windows 10
matlab: R2013a
PsychtoolboxVersion: 3.0.13
Bug description:
When I use matlab's deploytool, the compiler finishes to build the exe with no problems, but when i open the exe file i get an error mesage: "Failed to load PsychPortAudio driver for unknown reason! Dependency problem?" .
I noticed that the 'mccExcludedFiles.log' lists many times Psychtoolbox functions.
An example line from this file: (log file is attached)
| _C:\Program Files\MATLAB\R2013a\toolbox\psychtoolbox\psychoneliners\Ellipse.m
called by C:\Program Files\MATLAB\R2013a\toolbox\matlab\scribe\private\legendHGUsingMATLABClasses.p
(C:\Program Files\MATLAB\R2013a\toolbox\compiler\depfun.opts, line 7:
exclude if $caller in [$toolbox/matlab, $toolbox/daq] and ...
$file in $toolbox and ...
$file not in [$toolbox/matlab, $toolbox/shared, $toolbox/compiler] ...
and not ($file in $toolbox/distcomp and $caller in $toolbox/matlab))_|
I should note that psychtoolbox is well defined at the top of my matlab path, and I do not have any problems with running psychtoolbox. Only with compiling.
Assuming that this might mean that psychtoolbox is not listed in the compiler path, I tried to manually add the psychtoolbox folder to the compiler path ( as seen in the screenshot attached), but still no luck.
Any ideas? Any help will be great!
Thank you.
Attached:
-screenshot of error msg shown when exe file is opened
-screenshot of compiler settings
- mccExcludedFiles.log

Accepted Answer

Mihaela Duta
Mihaela Duta on 11 Oct 2016
Edited: Mihaela Duta on 13 Oct 2016
You get the dependency error because portaudio dll file cannot be found. This can be fixed with the following steps:
  • Inside the folder with the code to be compiled, create a subfolder, let's say resources, where you copy the portaudio dll files from the PsychSound folder.
  • Inside the folder with the code to be compiled create a copy of the InitializePsychSound.m file renamed InitializePsychSound2compile.m
  • Edit InitializePsychSound2compile.m to point PsychtoolboxRoot to the resources folder, by adding the following line to the top of the InitializePsychSound2compile function
PsychtoolboxRoot = 'resources/';
  • In the code where psychportaudio is needed, use InitializePsychSound2compile instead of the original InitializePsychSound.m.
  • You may also need to delete the PsychHardware folder from the psychtoolbox folder before attempting to compile - unless, of course, your code requires code from that folder.
When using your compiled code, make sure that the resources folder is always a subfolder in the folder you have the resulting executable file.
You can run your compiled code directly, or you can run it through the command line, which will allow you to see warnings, errors and output to standard output. On Windows, you can create a .cmd file to call your aplication, using
call yourappname.exe
You can of course create a desktop link to the .cmd file for ease of access.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!