コンパイラの設定

MATLAB R2013aのcompilerをVisual C++ 2013にする... 1

MATLAB R2013aのMATLAB Compiler 4.18.1のCompilerをVisual C++ 2013にする... 1

mingw-w64のアドオン... 1

 

 

MATLAB R2013acompilerVisual C++ 2013にする

R2013aではVisual C++ 2013はサポートされていません。

>> mex -setup

 

Welcome to mex -setup.  This utility will help you set up 

a default compiler.  For a list of supported compilers, see 

http://www.mathworks.com/support/compilers/R2013a/win64.html

 

Please choose your compiler for building MEX-files:

 

Would you like mex to locate installed compilers [y]/n? y

 

No supported SDK or compiler was found on this computer.

For a list of supported compilers, see 

http://www.mathworks.com/support/compilers/R2013a/win64.html 

 

エラー mex (line 206)

正常に終了できません。

 

>> 

MathWorks communityのコメントを探します。

Downloadを押してmexopts_x64.zipをダウンロードします。

mexopts_x64.zipの中身をC:\Program Files\MATLAB\R2013a\bin\win64\mbuildoptsでなく、C:\Program Files\MATLAB\R2013a\bin\win64\mexoptsにコピーします。

Visual C++ 2013がコンパイラとして認識されました。

>> mex -setup

 

Welcome to mex -setup.  This utility will help you set up 

a default compiler.  For a list of supported compilers, see 

http://www.mathworks.com/support/compilers/R2013a/win64.html

 

Please choose your compiler for building MEX-files:

 

Would you like mex to locate installed compilers [y]/n? y

 

Select a compiler:

[1] Microsoft Visual C++ 2013 in C:\Program Files (x86)\Microsoft Visual Studio 12.0

 

[0] None

 

Compiler: 1

 

Please verify your choices:

 

Compiler: Microsoft Visual C++ 2013 

Location: C:\Program Files (x86)\Microsoft Visual Studio 12.0

 

Are these correct [y]/n? y

 

***************************************************************************

  Warning: MEX-files generated using Microsoft Visual C++ 2013 require

           that Microsoft Visual Studio 2013 run-time libraries be 

           available on the computer they are run on.

           If you plan to redistribute your MEX-files to other MATLAB

           users, be sure that they have the run-time libraries.

***************************************************************************

 

 

Trying to update options file: C:\Users\akira\AppData\Roaming\MathWorks\MATLAB\R2013a\mexopts.bat

From template:              C:\PROGRA~1\MATLAB\R2013a\bin\win64\mexopts\msvc120opts.bat

 

Done . . .

 

**************************************************************************

  Warning: The MATLAB C and Fortran API has changed to support MATLAB

           variables with more than 2^32-1 elements.  In the near future

           you will be required to update your code to utilize the new

           API. You can find more information about this at:

           http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html  

           Building with the -largeArrayDims option enables the new API.

**************************************************************************

 

MATLAB R2013aMATLAB Compiler 4.18.1CompilerVisual C++ 2013にする

MATLAB R2013acompilerVisual C++にしてもMATLAB Compile 4.18.1Visual C++ 2013は認識されません。

>> mbuild -setup

 

Welcome to mbuild -setup.  This utility will help you set up 

a default compiler.  For a list of supported compilers, see 

http://www.mathworks.com/support/compilers/R2013a/win64.html

 

Please choose your compiler for building shared libraries or COM components:

 

Would you like mbuild to locate installed compilers [y]/n? y

 

No supported SDK or compiler was found on this computer.

For a list of supported compilers, see 

http://www.mathworks.com/support/compilers/R2013a/win64.html  

 

エラー mbuild (line 189)

正常に終了できません。

 

 

>> 

MathWorks communityのコメントを探します。

Downloadボタンを押してmbuldopts.zipをダウンロードします。

zipファイルの中身をC:\Program Files\MATLAB\R2013a\bin\win64\mbuildoptsにコピーします。

>> mbuild -setup

 

Welcome to mbuild -setup.  This utility will help you set up 

a default compiler.  For a list of supported compilers, see 

http://www.mathworks.com/support/compilers/R2013a/win64.html

 

Please choose your compiler for building shared libraries or COM components:

 

Would you like mbuild to locate installed compilers [y]/n? y

 

Select a compiler:

[1] Microsoft Visual C++ 2013 in C:\Program Files (x86)\Microsoft Visual Studio 12.0

 

[0] None

 

Compiler: 1

 

Please verify your choices:

 

Compiler: Microsoft Visual C++ 2013 

Location: C:\Program Files (x86)\Microsoft Visual Studio 12.0

 

Are these correct [y]/n? y

 

****************************************************************************

  Warning: Applications/components generated using Microsoft Visual C++     

           2013 require that the Microsoft Visual Studio 2013 run-time      

           libraries be available on the computer used for deployment.      

           To redistribute your applications/components, be sure that the   

           deployment machine has these run-time libraries.                  

****************************************************************************

 

 

Trying to update options file: C:\Users\akira\AppData\Roaming\MathWorks\MATLAB\R2013a\compopts.bat

From template:              C:\PROGRA~1\MATLAB\R2013a\bin\win64\mbuildopts\msvc120compp.bat

 

Done . . .

 

>> 

無事MATLAB Compiler 4.18.1Visual C++ 2013が認識されました。

 

mingw-w64のアドオン

Visual C++ 2013R2018bではサポートされていません。無料のmingw-w64がサポートされているので、これをアドオンします。

 

アドオンの入手を選択します。

mingw-w64を検索します。

どっかをクリックします。

インストールを押します(ダウンロードではありません)。

サインインします。

承諾するを選択します。

次へを選択します。

ちょっと時間がかかって、インストールが終了します。

MATLAB R2018bVisual C++ 2013はサポートされてないはずなんですが、コンパイラに設定されていました。mingw64に変更します。

>> mex -setup

MEX C 言語のコンパイルに 'Microsoft Visual C++ 2013 (C)' を使用するよう設定されています。

警告: MATLAB C および Fortran API は、2^32-1 を超える要素のある MATLAB

         変数をサポートするように変更されました。今後、新しい API

         利用するためのコードの更新が必要になります。

         詳細については、次を参照してください:

         https://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html

 

別の C コンパイラを選択するには、次のいずれかを選択してください。

MinGW64 Compiler (C)  mex -setup:'C:\Program Files\MATLAB\R2018b\bin\win64\mexopts\mingw64.xml' C

Microsoft Visual C++ 2013 (C)  mex -setup:'C:\Program Files\MATLAB\R2018b\bin\win64\mexopts\msvc2013.xml' C

 

別の言語を選択するには、次のいずれかを選択してください。

 mex -setup C++

 mex -setup FORTRAN

>> mex -setup:'C:\Program Files\MATLAB\R2018b\bin\win64\mexopts\mingw64.xml' C

オプション ファイル 'C:\Users\akira\AppData\Roaming\MathWorks\MATLAB\R2018b\mex_C_win64.xml' の名前を 'C:\Users\akira\AppData\Roaming\MathWorks\MATLAB\R2018b\mex_C_win64_backup.xml' に変更しました。

MEX C 言語のコンパイルに 'MinGW64 Compiler (C)' を使用するよう設定されています。

警告: MATLAB C および Fortran API は、2^32-1 を超える要素のある MATLAB

         変数をサポートするように変更されました。今後、新しい API

         利用するためのコードの更新が必要になります。

         詳細については、次を参照してください:

         https://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html

>> 

MATLAB R2018bMATLAB Compiler 7.0Visual C++ 2013はサポートされてないはずなんですが、コンパイラに設定されています。

mingw64に変更します。

>> mbuild -setup

MBUILD C 言語のコンパイルに 'Microsoft Visual C++ 2013 (C)' を使用するよう設定されています。

 

別の C コンパイラを選択するには、次のいずれかを選択してください。

MinGW64 Compiler (C)  mex -setup:'C:\Program Files\MATLAB\R2018b\bin\win64\mexopts\mingw64.xml' C -client MBUILD

Microsoft Visual C++ 2013 (C)  mex -setup:C:\Users\akira\AppData\Roaming\MathWorks\MATLAB\R2018b\MBUILD_C_win64.xml C -client MBUILD

 

別の言語を選択するには、次のいずれかを選択してください。

 mex -setup C++ -client MBUILD

 mex -setup FORTRAN -client MBUILD

>> mex -setup:'C:\Program Files\MATLAB\R2018b\bin\win64\mexopts\mingw64.xml' C -client MBUILD

オプション ファイル 'C:\Users\akira\AppData\Roaming\MathWorks\MATLAB\R2018b\MBUILD_C_win64.xml' の名前を 'C:\Users\akira\AppData\Roaming\MathWorks\MATLAB\R2018b\MBUILD_C_win64_backup.xml' に変更しました。

MBUILD C 言語のコンパイルに 'MinGW64 Compiler (C)' を使用するよう設定されています。

>>