Matlab 2016a mac - gfortran and intel compilers

6 ビュー (過去 30 日間)
Ed Mendes
Ed Mendes 2017 年 7 月 24 日
コメント済み: Walter Roberson 2020 年 3 月 2 日
Hello
I have managed to get mex (2016a) working with mac sierra and the latest xcode (clang) using the instructions given elsewhere on this list. However I couldn't do the same for gfortran and the latest intel compilers (icc and ifort 17) even after modifying the xml files to accommodate the same changes made in the clang files. Here is the output of the command "mex -v -setup FORTRAN".
>> mex -v -setup FORTRAN
Verbose mode is on.
... Looking for compiler 'gfortran' ...
... Looking for environment variable 'DEVELOPER_DIR' ...No.
... Executing command 'which gfortran' ...No.
... Looking for file '/usr/local/bin/gfortran' ...Yes.
... Looking for folder '/usr/local/bin' ...Yes.
... Executing command 'which gfortran' ...No.
... Looking for file '/usr/local/bin/gfortran' ...Yes.
... Executing command '/usr/local/bin/gfortran -print-file-name=libgfortran.dylib' ...Yes ('/usr/local/Cellar/gcc/6.1.0_1/lib/gcc/6/libgfortran.dylib').
... Looking for folder '/usr/local/Cellar/gcc/6.1.0_1/lib/gcc/6' ...Yes.
... Executing command 'which gfortran' ...No.
... Looking for file '/usr/local/bin/gfortran' ...Yes.
... Executing command '/usr/local/bin/gfortran -print-file-name=libgfortranbegin.a' ...Yes ('libgfortranbegin.a').
... Looking for folder 'libgfortranbegin.a' ...No.
Did not find installed compiler 'gfortran'.
... Looking for compiler 'Intel Fortran' ...
... Looking for environment variable 'IFORT_COMPILER17' ...No.
... Looking for environment variable 'IFORT_COMPILER16' ...No.
... Looking for environment variable 'IFORT_COMPILER15' ...No.
... Looking for environment variable 'IFORT_COMPILER14' ...No.
... Looking for environment variable 'IFORT_COMPILER13' ...No.
... Executing command 'which ifort' ...No.
Did not find installed compiler 'Intel Fortran'.
Error using mex
No supported compiler or SDK was found. For options, visit
http://www.mathworks.com/support/compilers/R2016a/maci64.html.
Note that, on a terminal, the command "which ifort" returns "/usr/local/bin/ifort" and "ifort --version" returns "ifort (IFORT) 17.0.4 20170411".
I know that the above compilers (gfortran 6, ifort and icc 17) are not supported but I wonder whether someone out there got them working somehow.
Many thanks
Ed

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 7 月 24 日
Before you run the mex setup, use
setenv('PATH', [getenv('PATH') ':/usr/local/bin'] )
  4 件のコメント
Ed Mendes
Ed Mendes 2020 年 3 月 2 日
If you do not have sudo installed in your system, you can log in as root and issue a command that allows matlab to find the compiler.
Walter Roberson
Walter Roberson 2020 年 3 月 2 日
The sudo would have to be typed in the Terminal app that you can find in the Utilities folder of Applications
Alternately, inside MATLAB you could use
!sudo ln -s /opt/intel /opt/intel/compiler
The ! tells MATLAB to send the command to your login shell.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by