Linux gfortran no supported compiler

1 回表示 (過去 30 日間)
Ken
Ken 2017 年 3 月 16 日
編集済み: Zain 2018 年 9 月 10 日
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?

回答 (1 件)

Zain
Zain 2018 年 9 月 10 日
編集済み: Zain 2018 年 9 月 10 日
Check this link:
and modify to your needs. Or change the version of the gfortran to the older one.

カテゴリ

Help Center および File ExchangeWrite C Functions Callable from MATLAB (MEX Files) についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by