Problem with executing Fortran codes using unix command in Matlab R2012a for MAC
10 次查看(过去 30 天)
显示 更早的评论
Hi,
I am using Matlab R2012a Student version on MAC Mountain Lion.
I am trying to execute a fortran code using Unix() function in Matlab.
For example,
unix('sac2asc GSLA01_BHZ00.sac');
sac2asc is the fortran executable and GSLA.. is the input file name. I have already added the path to the executable in Matlab file in the bin directory.I get error,
_________________
dyld: lazy symbol binding failed: Symbol not found: __gfortran_transfer_real_write Referenced from: /Users/avinash/Programs/SAC2ASCfolder/sac2asc Expected in: /Applications/MATLAB_R2012a_Student.app/sys/os/maci64/libgfortran.3.dylib
dyld: Symbol not found: __gfortran_transfer_real_write Referenced from: /Users/avinash/Programs/SAC2ASCfolder/sac2asc Expected in: /Applications/MATLAB_R2012a_Student.app/sys/os/maci64/libgfortran.3.dylib
sac2asc GSLA01_BHZ00.sac: Trace/breakpoint trap
ans =
133
_____________________________
I get errors for other Fortran codes too. The same command (sac2asc GSLA01_BHZ00.sac), however, works fine when I run it normally from a UNIX terminal. I use gfortran. Curiously, this whole thing used to work fine on my previous Matlab (Matlab R2009b for Linux) installed on Ubuntu.
Can anyone help me :(
Thanks.
1 个评论
3s
2013-4-25
I am having the same issue on mountain lion. Any compiled fortran source code does not allow interaction with the screen and keyboard when run from matlab. Instead the fort.5 and fort.6 files are generated. The compiled versions run fine in terminal though.
did you manage to find a fix for this?
回答(3 个)
Aarne Pohjonen
2016-6-16
This is reply to old question, but for those who are googling for this, the solution is to statically to link your code, e.g. gfortran -static-libgfortran -static-libgcc parabole.f90
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!