Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

mex issue

33 views
Skip to first unread message

SAMUEL HEROY

unread,
Sep 15, 2014, 11:02:08 AM9/15/14
to
Hi,
I'm having trouble compiling a code that uses a Fortran script via the mex feature.
I'm running MATLAB R2014A on MAC 10.9.4.

Based on suggestions, I've done the following:
1. change location of mexopt.sh home/.Matlab2014a
2. on mexopt.sh, change all SDK pointers 10.8 to 10.9 and the rest will be 10.6
3. Go to Applications/MATLAB_R2014a.app/sys/os/maci64
renamed the file (just to save it)
mv libgfortran.3.dylib libgfortran.3.dylib.old
4. create the symbolic link
ln -s /usr/local/lib/libgfortran.3.dylib libgfortran.3.dylib

Now, I get the following results
When I try to run the code--

Caught "std::exception" Exception message is:
FatalException(unknown)
MATLAB:dispatcher:loadLibrary Can't load '/Applications/MATLAB_R2014a.app/bin/maci64/libmwmathlinalg.dylib': dlopen(/Applications/MATLAB_R2014a.app/bin/maci64/libmwmathlinalg.dylib, 10): Library not loaded: @loader_path/../../sys/os/maci64/libgfortran.3.dylib
Referenced from: /Applications/MATLAB_R2014a.app/bin/maci64/libmwma57.dylib
Reason: image not found.

When I type mex -setup and click FORTRAN I get--

Error using mex
No supported compiler or SDK was found. For options, visit
http://www.mathworks.com/support/compilers/R2014a/maci64.

When I type gcc -version in Terminal, I get:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

This stuff is a little bit outside my area of expertise, so I'd appreciate any insight.

SAMUEL HEROY

unread,
Sep 15, 2014, 11:02:08 AM9/15/14
to

John Ashburne

unread,
May 19, 2015, 12:53:29 PM5/19/15
to
Hi Samuel,

I know I'm replying pretty late, but I was wondering if you found a solution to this problem? I'm running into the exact same issue that you are, and I was wondering if you have found a work-around?
Thanks,

John

John Ashburne

unread,
May 19, 2015, 12:55:30 PM5/19/15
to
"SAMUEL HEROY" <she...@live.unc.edu> wrote in message <lv6v1g$p60$1...@newscl01ah.mathworks.com>...
Hi Samuel,

Have you found a solution to this? I'm running into the same problem as you did...

Fabio Freschi

unread,
Jun 3, 2015, 12:21:19 PM6/3/15
to
Hi Everyone,
I got stuck with the same error, then I realised that the symlink is not correct. I guess you pasted-and-copied the terminal instructions from this website

http://issm.jpl.nasa.gov/documentation/faq/matlab/

My problem was that the libgfortran libraries where not in that place. I installed gfortran from homebrew and the library location is

/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/

Try to locate your libgfortran libraries and create the symlink accordingly

Fabio
0 new messages