조회 수: 39(최근 30일)
Hi, I am facing the following problem. When I try to execute a fortran program through "system" command, I get:
_dyld: lazy symbol binding failed: Symbol not found: __gfortran_transfer_integer_write Referenced from: < path of my executable program> Expected in: /Applications/MATLAB_R2011a.app/sys/os/maci64/libgfortran.3.dylib
dyld: Symbol not found: __gfortran_transfer_integer_write
<path of my executable program>
I solved this by running setenv('DYLD_LIBRARY_PATH', '/usr/local/bin') , or setenv('DYLD_LIBRARY_PATH', '/opt/local/lib').
Unfortunately I need at the same time to run code in parallel configuration but now matlab cannot find the /Applications/MATLAB_R2011a.app/bin/maci64 or the /Applications/MATLAB_R2011a.app/sys/os/maci64:
I have already tried to run setenv('DYLD_LIBRARY_PATH', [getenv('DYLD_LIBRARY_PATH') '/usr/local/bin:/opt/local/lib:']) but this reproduces the initial problem (_dyld: lazy symbol binding failed: Symbol not found: [...])
MATLAB Version 126.96.36.1995 (R2011a)
Operating System: Mac OS X Version: 10.6.8 Build: 10K549
Thank you in advance for any answers
Sylvain Barbot 2014년 4월 10일
편집: Sylvain Barbot 2014년 4월 10일
It is probable that you are dynamically loading the wrong version of the gfortran library. On Mac, by default the gfortran dynamic library is loaded in
You can edit matlabroot/bin/.matlab7rc.sh and add the correct path to your dynamic library. I have gfortran with fink, so I have the following line in my .matlab7rc.sh
Upon loading Matlab, I then get
This way, you can load you own Mex/Fortran routines and still use the other Matlab dynamic libraries.
Kelly Kearney 2014년 4월 10일
편집: Kelly Kearney 2014년 4월 10일
This is probably not the Mathworks-recommended way of doing things, but my solution to system path issues was to add
to the first line of the Matlab shell script (i.e. [matlabroot]/bin/matlab), and then within my startup.m file add
I find that this seems to keep all my system paths and other environmental variables in the Matlab and terminal environments in sync with a minimal amount of fiddling on my part. So far, I haven't noticed any issues calling system commands in parallel.
Nuno Nobre 2016년 6월 3일
I am probably five years late, but you just set the environment variable in the wrong order. Your desired path should come BEFORE the old one and not after. Of course you were getting the same error: MATLAB was locating the wrong file first and not the one you wanted it to.