필터 지우기
필터 지우기

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 CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by