Matlab 2016a mac - gfortran and intel compilers
조회 수: 6 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
Walter Roberson
2017년 7월 24일
Before you run the mex setup, use
setenv('PATH', [getenv('PATH') ':/usr/local/bin'] )
댓글 수: 4
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 Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!