Error using mex No supported compiler was found.
显示 更早的评论
Hello
My matlab version is R2019b. I have visual studio 2017 with intel oneAPI 2021 installed. However, when I type the following, I get error:
Any guidance, especially from MatLab staff is highly appreciated as otherwise I have to code the program on my own in MatLab.
mex -setup FORTRAN
Error using mex
No supported compiler was found. For options, visit https://www.mathworks.com/support/compilers.
采纳的回答
10 个评论
Hi. I read both of these threads before posting my query. I need a more exact response as my problem still exist.
Bruno Luong
2021-10-28
编辑:Bruno Luong
2021-10-28
Of course, because the compiler is not supported in R2019b. You have to modify the xml file to make it works, and you won't get help from TMW since the compiler is not supported. I have done for C intel openAPI, it should be doable for fortran too.
BTW it seems R2021b supports intel fortran 18 to 21. I can't provide you the xml file, since it is copyright config file.
is there any Matlab version compatible to fortran compiler in oneAPI?
I mean which combination of matlab version+fortran compiler+ visual studio work?
Both questons are answered here : Support compilers for R2019b
Anotherway is to see the list of xml ci=onfiguration files (here is for R2021b)
>> cd([matlabroot '\bin\win64\mexopts'])
>> ls
. intel_c_20_vs2017.xml intel_cpp_19_vs2019.xml intel_fortran_19_vs2017.xml msvc2015.xml
.. intel_c_20_vs2019.xml intel_cpp_20_vs2017.xml intel_fortran_19_vs2019.xml msvc2017.xml
compilerComponents intel_c_21_vs2017.xml intel_cpp_20_vs2019.xml intel_fortran_20_vs2017.xml msvc2019.xml
intel_c_18_vs2015.xml intel_c_21_vs2019.xml intel_cpp_21_vs2017.xml intel_fortran_20_vs2019.xml msvcpp2015.xml
intel_c_18_vs2017.xml intel_cpp_18_vs2015.xml intel_cpp_21_vs2019.xml intel_fortran_21_vs2017.xml msvcpp2017.xml
intel_c_18_vs2019.xml intel_cpp_18_vs2017.xml intel_fortran_18_vs2015.xml intel_fortran_21_vs2019.xml msvcpp2019.xml
intel_c_19_vs2015.xml intel_cpp_18_vs2019.xml intel_fortran_18_vs2017.xml mingw64.xml
intel_c_19_vs2017.xml intel_cpp_19_vs2015.xml intel_fortran_18_vs2019.xml mingw64_g++.xml
intel_c_19_vs2019.xml intel_cpp_19_vs2017.xml intel_fortran_19_vs2015.xml mingw64_g++_sdk10+.xml
Thanks for your reply.
I saw that link before, thats why I downloaded VS2017 to be compatible to Matlab R2019b. So, the only issue is making the compiler support R2019b. However, I do not know how should I edit the xml file?
it is the list of compiler components in my R2019b, which shows intel fortran 17,18,19 are supported in R2019b. Could you please tell me how should I edit this? what is the guidance to edit xml file?
>> cd([matlabroot '\bin\win64\mexopts'])
>> ls
. intel_c_18_vs2019.xml intel_cpp_18_vs2017.xml intel_fortran_18_vs2015.xml mingw64_g++_sdk10+.xml
.. intel_c_19_vs2015.xml intel_cpp_18_vs2019.xml intel_fortran_18_vs2017.xml msvc2015.xml
compilerComponents intel_c_19_vs2017.xml intel_cpp_19_vs2015.xml intel_fortran_18_vs2019.xml msvc2017.xml
intel_c_17_vs2015.xml intel_c_19_vs2019.xml intel_cpp_19_vs2017.xml intel_fortran_19_vs2015.xml msvc2019.xml
intel_c_17_vs2017.xml intel_cpp_17_vs2015.xml intel_cpp_19_vs2019.xml intel_fortran_19_vs2017.xml msvcpp2015.xml
intel_c_17_vs2019.xml intel_cpp_17_vs2017.xml intel_fortran_17_vs2015.xml intel_fortran_19_vs2019.xml msvcpp2017.xml
intel_c_18_vs2015.xml intel_cpp_17_vs2019.xml intel_fortran_17_vs2017.xml mingw64.xml msvcpp2019.xml
intel_c_18_vs2017.xml intel_cpp_18_vs2015.xml intel_fortran_17_vs2019.xml mingw64_g++.xml
But I already post the instructions from the links in my answer. In your case you need to change the
<FORTRANROOT>
...
<and>
<or>
<envVarExists name="IFORT_COMPILER21" />
</or>
<fileExists name="$$/Bin/intel64/ifort.exe" />
<dirExists name="$$/../.." />
</and>
...
<and>
<or>
<envVarExists name="ONEAPI_ROOT" />
</or>
<fileExists name="$$/compiler/2021.1.1/windows/Bin/intel64/ifort.exe" />
<dirExists name="$$/../.." />
</and>
instead of <CROOT>. More instructions in this link.
You doesn't seem to read the answer I gave you.
Thanks. I editted the xml file according to your guidance and named it intel_one_classical_fortran_vs2017.xml . then Could you please tell me why am I getting this error?
<locationFinder>
<FORTRANROOT>
<and>
<or>
<envVarExists name="ONEAPI_ROOT" />
</or>
<fileExists name="$$/bin/intel64/ifort.exe" />
<dirExists name="$$/../.." />
</and>
cd(fullfile(matlabroot,'bin','win64','mexopts'));
>> setenv('ONEAPI_ROOT', 'C:\Program Files (x86)\Intel\oneAPI\compiler\2021.4.0\windows\bin\intel64\');
>> mex -setup:intel_one_classical_fortran_vs2017.xml -v
Verbose mode is on.
... Looking for compiler 'Intel oneAPI Fortran compiler with Microsoft Visual Studio 2017' ...
... Looking for environment variable 'ONEAPI_ROOT' ...Yes ('C:\Program Files (x86)\Intel\oneAPI\compiler\2021.4.0\windows\bin\intel64\').
... Looking for file 'C:\Program Files (x86)\Intel\oneAPI\compiler\2021.4.0\windows\bin\intel64\bin\intel64\ifort.exe' ...No.
Did not find installed compiler 'Intel oneAPI Fortran compiler with Microsoft Visual Studio 2017'.
Error using mex
MEX cannot use compiler 'Intel oneAPI Fortran compiler with Microsoft Visual Studio 2017' because that compiler is not found.
"Looking for file 'C:\Program Files (x86)\Intel\oneAPI\compiler\2021.4.0\windows\bin\intel64\bin\intel64\ifort.exe' ...No."
You have to check where is the intel fortran compiler is installed on your system and adapt accordingly.
I don't have access to your system or never work with intel fortran, you have to figure out on your own.
I did!
Thank you!
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Fortran with MATLAB 的更多信息
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
