Borrar filtros
Borrar filtros

minGWがopenMPをサポートしない

37 visualizaciones (últimos 30 días)
Tatsuya Yoshida
Tatsuya Yoshida el 26 de Jun. de 2024 a las 7:50
Editada: Alan el 4 de Jul. de 2024 a las 9:26
R2017bでMinGW -w64 コンパイラを使用してCのMEXファイルをコンパイルしていますが、codegenでCコードを生成すると、コマンドウィンドウに「Warning: 選択したコンパイラは OpenMP ライブラリをサポートしません。このループは並列処理されません。」というメッセージが表示されます。MEX関数の生成は成功しています。
R2018aはR2017bと同じバージョンのMinGW -w64 コンパイラを使用するため、同様な操作を行うとエラーメッセージが表示されることなくMEX関数を生成できます。
R2017bで並列処理できるようにコンパイルすることはできますか。

Respuestas (1)

Alan
Alan el 4 de Jul. de 2024 a las 7:41
Editada: Alan el 4 de Jul. de 2024 a las 9:26
Hi Tatsuya,
I do not speak Japanese, so I am answering in English. So, I apologize in advances for any unintended tone or misinterpretation.
I was able to generate Mex files from C-code without the warning you mentioned. You could try updating MATLAB R2017b and the MATLAB Support for MinGW-w64 C/C++ Compiler” feature to the latest versions. Here are the versions I used:
  • MATLAB Version: 9.3.0.713579 (R2017b)
  • MATLAB Support for MinGW-w64 C/C++ Compiler (Version 17.2.0)
After that, you could make sure that the mex command is actually using the installed MinGW by executingmex -setup”. The output should look similar to this:
After confirming that the correct compiler is being used, execute the following command to generate Mex with OpenMP support:
mex file_name.c COMPFLAGS="/openmp $COMPFLAGS"
Also, make sure that the path to your C file does not contain any blank spaces, as this could cause problems during compilation.
Happy to help.

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!