Clear Filters
Clear Filters

Linux gfortran no supported compiler

7 views (last 30 days)
Ken
Ken on 16 Mar 2017
Edited: Zain on 10 Sep 2018
I am attempting to generate a simple mex file for a fortran file. For example, compiling timestwo.f using mex. This is the output that I receive:
INPUT:
mex -v timestwo.f
OUTPUT:
Neither -compatibleArrayDims nor -largeArrayDims is selected.
Using -compatibleArrayDims. In the future, MATLAB will require the use of
-largeArrayDims and remove the -compatibleArrayDims option.
For more information:
http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html.
No MEX options file identified; looking for an implicit selection.
... Looking for compiler 'gfortran' ...
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Looking for folder '/usr/bin' ...Yes.
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Executing command 'gfortran -print-file-name=libgfortran.so' ...Yes ('/usr/lib/gcc/x86_64-redhat-linux/6.2.1/libgfortran.so').
... Looking for folder '/usr/lib64' ...Yes.
... Executing command 'which gfortran' ...Yes ('/usr/bin/gfortran').
... Executing command 'gfortran -print-file-name=libgfortranbegin.a' ...Yes ('libgfortranbegin.a').
... Looking for folder 'libgfortranbegin.a' ...No.
Did not find installed compiler 'gfortran'.
This happens on both my Fedora and Ubuntu Linux boxes. Note this only happens with fortran. I can run "mex -v timestwo.c" with no problem at all.
Outside of Matlab I can invoke gfortran with no problem.
Maybe this has to due with the compiler version. It picks up the newest version of my If it does, how can I get it use a lower version?

Answers (1)

Zain
Zain on 10 Sep 2018
Edited: Zain on 10 Sep 2018
Check this link:
and modify to your needs. Or change the version of the gfortran to the older one.

Categories

Find more on MATLAB Compiler 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!