Problem with executing Fortran codes using unix command in Matlab R2012a for MAC
9 views (last 30 days)
Show older comments
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 Comment
3s
on 25 Apr 2013
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?
Answers (3)
Aarne Pohjonen
on 16 Jun 2016
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 Comments
See Also
Categories
Find more on Fortran with MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!