System Command Gives Segmentation Fault?
Ältere Kommentare anzeigen
Hello! I am using an external solver to run simulations. I am trying to call the external solver with system(cmd) from a MATLAB script. The cmd itself runs fine with no problems from the Terminal (I'm running on OSX). However, every time the MATLAB script runs, the status is 139 - Segmentation Fault. Does anyone know why this might be happening?
2 Kommentare
jfherrm
am 20 Jan. 2017
Walter Roberson
am 20 Jan. 2017
Another approach might have been to use something like,
system('source ~/.bash_profile; rest of command')
Antworten (1)
Walter Roberson
am 20 Jan. 2017
0 Stimmen
It is a DYLD_DYNAMIC_PATH problem. MATLAB puts a dynamic path environment variable that either is missing a directory the executable needs or else puts a directory in priority that contains an incompatible dynamic path.
At the terminal window examine the environment variable. Then in your MATLAB program before calling system, use setenv() to set the environment variable to that same thing.
Kategorien
Mehr zu Environment and Settings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!