Problem in running fortran mex example on Matlab R2012a

1 view (last 30 days)
Hi,
I just installed Matlab R2012a on my 64bit Ubuntu Maverick machine. I have gcc-4.4, gfortran 4.4 and gfortran 4.3 on my machine. In this article http://www.mathworks.com/support/compilers/R2012a/glnxa64.html, it says only gfortran 4.3 is supported by using mex, so I changed the file /usr/local/MATLAB/R2012a/bin/mexopts.sh. In the section "glnxa64" in that file, I changed FC='gfortran-4.3'.
But when I try to run the mex examples in /extern/examples/mex as described in http://www.mathworks.com/support/tech-notes/1600/1605.html#testing, I can successfully run mex yprime.c and yprime(1,1:4), but mex does not compile yprime.F or yprimefg.F, it throws an exception "mex: yprime.F not a normal file or does not exist. Error using mex (line 206) Unable to complete successfully." What's the possible reason for this?
Thanks for your kind help!
Hongkai

Answers (2)

Hongkai Dai
Hongkai Dai on 9 Apr 2012
Problem solved! It turns out except for gcc-4.4, I also need gcc-4.3 to make gfortran-4.3 work. I installed gcc-4.3 and it works now!

Octopode
Octopode on 31 Jul 2013
Edited: Octopode on 31 Jul 2013
I'm having the same problem under Ubuntu 13.04. I installed gcc 4.4, but cannot install gfortran 4.3. Following the above answer i couldn't install gcc-4.3 using apt-get. Got this error :
~$ sudo apt-get install gcc-4.3 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:
The following packages have unmet dependencies: gcc-4.3 : Depends: binutils (>= 2.19.1) but it is not going to be installed Depends: libgomp1 (>= 4.3.4-10ubuntu1) but it is not going to be installed libgcc1 : Breaks: gcc-4.3 (< 4.3.6-1) but 4.3.4-10ubuntu1 is to be installed libgtk2.0-0 : Depends: libpango1.0-0 (>= 1.28.3) but it is not going to be installed Recommends: libgtk2.0-bin libstdc++6 : Breaks: gcc-4.3 (< 4.3.6-1) but 4.3.4-10ubuntu1 is to be installed ure : Depends: uno-libs3 (= 4.0.2-0ubuntu1) but it is not going to be installed Breaks: openoffice.org-core (< 1:3.3~) but 1:3.2.0-7ubuntu4 is to be installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
So I'm stuck. Any idea how i can install gcc-4.3 to make gfortran 4.3 happy ?

Categories

Find more on Introduction to Installation and Licensing 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!