system or unix command run compiled fortran binary fails, but it runs fine from a terminal
6 ビュー (過去 30 日間)
古いコメントを表示
Hi, I'm trying to get matlab to start up a compiled fortran program with the unix or system commands. To do this, I fill "str" with the required information, and then call unix(str). However, the fortran program won't run when I call it from matlab, but works just fine when I call it from a terminal window.
This is the string I am sending:
/home/derek/Research/2Layer_new/src/seis-spread-response-sameani /home/derek/Data/tables/GSN_SKS_Nov_2011_best/1_Layer_flat/model.synthetics /home/derek/Data/tables/GSN_SKS_Nov_2011_best/1_Layer_flat/geometry /home/derek/Data/tables/GSN_SKS_Nov_2011_best/1_Layer_flat/phasefile /home/derek/Data/tables/GSN_SKS_Nov_2011_best/1_Layer_flat/arrivalfile /home/derek/Data/tables/GSN_SKS_Nov_2011_best/1_Layer_flat/traces.out SV
and this is the output:
/home/derek/Research/2Layer_new/src/seis-spread-response-sameani: /usr/local/MATLAB/R2012a/sys/os/glnxa64/libgfortran.so.3: version `GFORTRAN_1.4' not found (required by /home/derek/Research/2Layer_new/src/seis-spread-response-sameani)
Like I said above, I can take the value in str and cut and paste it to a terminal window, and the fortran code runs fine. I've tried both the system and unix commands, and also confirmed that the MATLAB_SHELL environmental variable is set to the shell I I am using. Apparently there is something I don't understand about how matlab does a system command, but I can't seem to find any useful information. Does anyone have a clue? Thanks.
0 件のコメント
採用された回答
Walter Roberson
2012 年 5 月 16 日
compare
getenv('LD_LIBRARY_PATH')
!ldd /home/derek/Research/2Layer_new/src/seis-spread-response-sameani
inside MATLAB, to
echo $LD_LIBRARY_PATH
ldd /home/derek/Research/2Layer_new/src/seis-spread-response-sameani
from the terminal window. You might need some options to ldd.
0 件のコメント
その他の回答 (2 件)
Shan Dou
2014 年 3 月 4 日
After our matlab gets updated to R2013b, I still have the same issue with gfortran, even though the version of gfortran is supposed to be compatible with R2013b. The temporary solution that works for me is to use g77 instead of gfortran.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Fortran with MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!