Matlab R2011a, Fortran Mex, and Ubuntu 12.04

1 view (last 30 days)
Tom Pavlak
Tom Pavlak on 11 May 2012
I'm attempting to mex Fortran code in a new install of Ubuntu 12.04 and am not having luck. I am testing using timestwo.c and timestwo.F. (I need the Fortran to work, but I use the C as a second test case.)
Both compile without error and the file produced by timestwo.c runs successfully. However, the file produced by timestwo.F crashes Matlab ("Would you like Matlab to try and restart" or something like that). I am using gcc/gfortran 4.6. I know the gcc 4.3.4 is the "approved" version, but I've never had a problem with this in previous versions of Matlab/Ubuntu.
Any insight would be greatly appreciated. Thank you.
  2 Comments
James Tursa
James Tursa on 11 May 2012
How are you calling it? The timestwo.F file only works with scalars.
Tom Pavlak
Tom Pavlak on 24 Jul 2012
For example, timestwo(2) crashes Matlab. This is more than just an Ubuntu 12.04 problem. It will compile under a recently upgraded version of Red Hat but crashes when called. gcc 4.3 is so old that it has a lot of dependency problems and I'm having a hard time installing it in my Ubuntu 12.04.
I've been doing this for several years without a problem, but it appears that Matlab's Fortran mex interface has become unusable on [even somewhat] modern technology. Any insight would be greatly appreciated.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 24 Jul 2012
  1 Comment
Tom Pavlak
Tom Pavlak on 24 Jul 2012
Walter, thank you for the suggestion. I'm not very savvy with library issues. I tried the suggestion in the other post, but still experience the same problem - the mex file compiles without error, but Matlab crashes when I run the .mex64 file. There is no error output in Matlab or the terminal (other than the crash message). If I click "Details", the results are included in the following pastebin:
I would greatly appreciate any help. I'm considering installing a Linux distribution that is a couple years old just to get mex working again.

Sign in to comment.

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!