matlab编译安装问题 [英] matlab compiler installation problems

查看:643
本文介绍了matlab编译安装问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在MATLAB上运行一个编译器,但事情不按预期。我如何正确安装MATLAB,如何检查到底是怎么回事。我有MATLAB r2013a版本。



我做了以下:


  1. 我已从此处下载SDK 7.1文件。




    • 工具的目标文件夹: C:\Program Files \ Microsoft SDKs \Windows \v7.1

    • 样本的目标文件夹: C:\Program Files \Microsoft SDKs \Windows \v7.1\ Samples


  2. 我已将我的编译器目录添加到路径环境




    • 控制面板 - >系统 - >高级 - >环境变量。

    • MSSdk。

    • 此变量的值:C:\Program Files\Microsoft SDKs\Windows \v7.1

    • 关闭重新启动MATLAB




接下来我尝试使用以下步骤配置MATLAB,选择后,执行code> mex -setup 命令:




    < n 通过你想要mex找到已安装的编译器我有一个编译器的列表(见上面的注释)。我选择了 17

      [1] Intel C ++ 13.0使用Microsoft软件开发工具包(SDK)链接器)
    [2] Intel C ++ 13.0(使用Microsoft Visual C ++ 2010链接器)
    [3] Intel C ++ 13.0(使用Microsoft Visual C ++ 2012链接器)
    [4] Intel C ++ 12.0(使用Microsoft软件开发工具包(SDK)链接器)
    [5] Intel C ++ 12.0(使用Microsoft Visual C ++ 2008 SP1链接器)
    [6] C ++ 2010链接器)
    [7] Intel C ++ 11.1(使用Microsoft Visual C ++ 2008 SP1链接器)
    [8] Intel Visual Fortran 13(使用Microsoft软件开发工具包(SDK)链接器)
    [ 9] Intel Visual Fortran 13.0(使用Microsoft Visual C ++ 2010链接器)
    [10] Intel Visual Fortran 13.0(使用Microsoft Visual C ++ 2012链接器)
    [11] (SDK)链接器)
    [12] Intel Visual Fortran 12.0(使用Microsoft Visual C ++ 2008 SP1链接器)
    [13] Intel Visual Fortran 12.0(使用Microsoft Visual C ++ 2008 Shell链接器)
    [ 14] Intel Visual Fortran 12.0(使用Microsoft Visual C ++ 2010链接器)
    [15] Intel Visual Fortran 11.1(使用Microsoft Visual C ++ 2008 SP1链接器)
    [16] 2008 Shell套接字)
    [17] Microsoft软件开发工具包(SDK)7.1
    [18] Microsoft Visual C ++ 2005 SP1
    [19] Microsoft Visual C ++ 2010
    [21] Microsoft Visual C ++ 2012


  •   Microsoft软件开发工具包(SDK)编译器的默认位置是:
    C:\Program Files x86)\Microsoft Visual Studio 10.0
    ,但该目录不存在或配置无效。


  • 问题:

     使用C:\Program文件(x86)\Microsoft Visual Studio 10.0无论如何[y] / n? 


  • 我选择了 n 并将 C:\Program Files \Microsoft SDKs \ Windows \v7.1 作为我的新目录




这里是停止的地方:

 错误:Microsoft Windows软件开发工具包(SDK)安装是
不完整。在尝试重新安装SDK之前,请确保.NET Framework已正确安装






EDIT:



我的第二次尝试如下:




  • 我删除了所有可视的基本文件程序中的视觉基础)

  • 我重新安装了SDK文件,但未编译可视化c ++编译器和Microsoft Visual c ++

  • 应用patch 从Microsoft到SDK 7.1安装(如果尚未完成) li>
  • 重新安装Visual C ++ 2010 Redistributable程序包:x86和x64

  • 在MATLAB中,我再次使用 mex -setup



发生以下情况:




  • 我在问题后选择了 y

     你想要mex找到已安装的编译器[y] / n? 
    [1] Microsoft软件开发工具包(SDK)7.1在C:\Program Files(x86)\Microsoft Visual Studio 10.0

  • 我选择了 1


  • 在询问是否正确后,根据选择 y n 输出以下2个输出



我选择了n

  mex:未选择编译器。未采取任何操作。 

****************************************** ********************************
警告:MATLAB C和Fortran API已更改为支持MATLAB
变量具有多于2 ^ 32-1个元素。在不久的将来
你将需要更新你的代码,以利用新的
API。您可以在以下网址找到更多相关信息:
httpx://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html
使用-largeArrayDims选项构建将启用新的API。
********************************************** ****************************


使用mex时出错(第206行)
无法成功完成。



我选择了y:

  ************************************ *************************************** 
警告:MEX文件生成使用Microsoft Windows软件开发
Kit(SDK)要求Microsoft Visual Studio 2010运行时
库在运行的计算机上可用。
如果您计划将MEX文件重新分发给其他MATLAB
用户,请确保它们具有运行时库。
********************************************** *****************************


尝试更新选项文件:C:\\ \\Users\Gebruiker\AppData\Roaming\MathWorks\MATLAB\R2013a\mexopts.bat
从模板:C:\PROGRA〜1 \MATLAB\R2013a\bin\ win64 \mexopts\mssdk71opts.bat

完成。 。 。

****************************************** ********************************
警告:MATLAB C和Fortran API已更改为支持MATLAB
变量具有多于2 ^ 32-1个元素。在不久的将来
你将需要更新你的代码,以利用新的
API。您可以在以下网址找到更多相关信息:
httpx://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html
使用-largeArrayDims选项构建将启用新的API。
********************************************** ****************************


使用mex时出错(第206行)
无法成功完成。






EDIT:



我发现我面临的问题似乎与Perl的问题是孤立的。稍等片刻,会出现以下注释:

 Perl命令行解释器已停止工作

post 有类似的问题。我做了如下。我下载了 Strawberry Perl ,并进行了几次更换。




  • 替换所有exe文件

  • 替换perl .exe文件




    $ b 无法在@INC中找到shellwords.pl(@INC包含:C:/ strawberry / perl / site / lib C:/ strawberry / perl / vendor / lib C:/ strawberry / perl / lib。C:\PROGRA〜1 \MATLAB\R2013a\bin\)在C:\Program Files\MATLAB\R2013a\bin\mex .pl line 159.
    使用mex时出错(行206)
    无法成功完成。


  • 使用草莓Perl的bin档案替换bin档案

     'C:\Program Files\MATLAB\R2013a\sys\perl\win32\bin/\\perl.exe不是被识别为内部或外部命令,
    可操作的程序或批处理文件。
    使用mex时出错(第206行)
    无法成功完成。




  • 但这似乎不起作用。所以,它似乎是两件事:




    • 它不工作这样(只有一个人声称他已经这样做)

    • 我用草莓Perl中的错误文件替换了MATLAB中的错误文件。



    推荐我将matlab中的perl恢复到原来的版本。






    我已经下载了Visual Studio Express 2012,这项工作。问题仍然相同。

    解决方案

    因此,我检查的第一件事是matlab支持的编译器页面:

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



    我以为SDK 7.1将不被支持,但显然它是,甚至在列表的顶部。但是,您的错误之一是抱怨.NET,并且在那个MATLAB页面上,有一个关于SDK 7.1需要.NET Framework 4.0的警告(在表中,在SDK 7.1单元格的底部。)



    每当我在Windows中完成此操作时,我总是使用Visual Studio编译器。我建议先尝试,因为我不记得这个mex设置过程需要很长时间(成功/失败前)。


    I'm trying to run a compiler on MATLAB but things don't go as expected. How can I properly install MATLAB and how can I check what exactly is going wrong. I have the MATLAB r2013a version.

    I've done as follow:

    1. I've downloaded the SDK 7.1 file from here

      • destination folder for Tools: C:\Program Files\Microsoft SDKs\Windows\v7.1
      • destination folder for Samples: C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples
    2. I've added my compiler directories to the path environment

      • Control Panel -> System -> "Advanced" -> "Environment variables".
      • new system variable with the name "MSSdk".
      • value of this variable: C:\Program Files\Microsoft SDKs\Windows\v7.1
      • close and restart MATLAB

    Next I tried to configure MATLAB using following steps and using the mex -setup command:

    • after choosing n by "would you like mex to locate installed compilers" i got a list of compilers (see comment above). I've selected 17:

      [1] Intel C++ 13.0 (with Microsoft Software Development Kit (SDK) linker) 
      [2] Intel C++ 13.0 (with Microsoft Visual C++ 2010 linker) 
      [3] Intel C++ 13.0 (with Microsoft Visual C++ 2012 linker) 
      [4] Intel C++ 12.0 (with Microsoft Software Development Kit (SDK) linker) 
      [5] Intel C++ 12.0 (with Microsoft Visual C++ 2008 SP1 linker) 
      [6] Intel C++ 12.0 (with Microsoft Visual C++ 2010 linker) 
      [7] Intel C++ 11.1 (with Microsoft Visual C++ 2008 SP1 linker) 
      [8] Intel Visual Fortran 13 (with Microsoft Software Development Kit (SDK) linker) 
      [9] Intel Visual Fortran 13.0 (with Microsoft Visual C++ 2010 linker) 
      [10] Intel Visual Fortran 13.0 (with Microsoft Visual C++ 2012 linker) 
      [11] Intel Visual Fortran 12 (with Microsoft Software Development Kit (SDK) linker) 
      [12] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 SP1 linker) 
      [13] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2008 Shell linker) 
      [14] Intel Visual Fortran 12.0 (with Microsoft Visual C++ 2010 linker) 
      [15] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 SP1 linker) 
      [16] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 Shell linker) 
      [17] Microsoft Software Development Kit (SDK) 7.1 
      [18] Microsoft Visual C++ 2005 SP1 
      [19] Microsoft Visual C++ 2008 SP1 
      [20] Microsoft Visual C++ 2010 
      [21] Microsoft Visual C++ 2012 
      

    • Following warning:

      The default location for Microsoft Software Development Kit (SDK) compiler is:
      "C:\Program Files (x86)\Microsoft Visual Studio 10.0"
      but either that directory does not exist or the configuration is invalid.
      

    • Question:

      Use C:\Program Files (x86)\Microsoft Visual Studio 10.0 anyway [y]/n?
      

    • I've chosen n and gave C:\Program Files\Microsoft SDKs\Windows\v7.1 as my new directory

    here is where it stops:

    Error: The Microsoft Windows Software Development Kit (SDK) installation is 
             incomplete.  Please be sure that the .NET Framework is installed 
             correctly before attempting to reinstall the SDK. 
    


    EDIT:

    My second attempt I did as follow:

    • I removed all visual basic files (by removing all items listed as visual basic in programs)
    • I re-installed the SDK file again but uncheked visual c++ compilers and Microsoft visual c++
    • Apply the patch from Microsoft onto the SDK 7.1 installation (if not done already)
    • Reinstalled the Visual C++ 2010 Redistributable packages: both x86 and x64
    • In MATLAB I again used mex -setup

    The following happened:

    • I've chosen y after the question:

      Would you like mex to locate installed compilers [y]/n?
      [1] Microsoft Software Development Kit (SDK) 7.1 in C:\Program Files (x86)\Microsoft Visual Studio 10.0 
      

    • I've chosen 1

    • and then I get the following 2 outputs depending on choosing y or n after asking if this is correct

    i selected n:

    mex: No compiler selected. No action taken. 
    
    ************************************************************************** 
      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: 
               httpx://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. 
    ************************************************************************** 
    
    
    Error using mex (line 206)
    Unable to complete successfully.
    

    i selected y:

    *************************************************************************** 
      Warning: MEX-files generated using Microsoft Windows Software Development 
               Kit (SDK) require that Microsoft Visual Studio 2010 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\Gebruiker\AppData\Roaming\MathWorks\MATLAB\R2013a\mexopts.bat 
    From template:              C:\PROGRA~1\MATLAB\R2013a\bin\win64\mexopts\mssdk71opts.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: 
               httpx://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. 
    ************************************************************************** 
    
    
    Error using mex (line 206)
    Unable to complete successfully.
    


    EDIT:

    I've found that the problem I'm facing seems to be isolated to a problem with Perl. For a brief moment the following note appears:

    "Perl Command Line Interpreter has stopped working"
    

    This post had a similar problem. I did as follow. I downloaded Strawberry Perl and did several replacements.

    • replacing all exe files
    • replacing perl .exe files

      In both situations the following appears

      Can't locate shellwords.pl in @INC (@INC contains: C:/strawberry/perl/site/lib C:/strawberry/perl/vendor/lib C:/strawberry/perl/lib . C:\PROGRA~1\MATLAB\R2013a\bin\) at C:\Program Files\MATLAB\R2013a\bin\mex.pl line 159. 
      Error using mex (line 206)
      Unable to complete successfully.
      

    • replacing bin file with bin file from Strawberry Perl

      '"C:\Program Files\MATLAB\R2013a\sys\perl\win32\bin\perl.exe"' is not recognized as an internal or external command, 
      operable program or batch file. 
      Error using mex (line 206)
      Unable to complete successfully.
      

    However this doesn't seems to work. So it seems to be two things:

    • It doesn't work that way (only one person claimed he has done this)
    • I'm replacing the wrong files in MATLAB with the one in Strawberry Perl.

    EDIT: As recommended I restored the perl in matlab to it's original version.


    I've downloaded Visual Studio Express 2012 and trying to make this work. Problems are still the same.

    解决方案

    So, the first thing I checked was the matlab supported compilers page:
    http://www.mathworks.com/support/compilers/R2013a/index.html

    I was thinking that SDK 7.1 would not be supported, but clearly it is, and is even at the top of the list. However, one of your errors was complaining about .NET, and on that MATLAB page, there is a caveat about SDK 7.1 needing .NET Framework 4.0 (in table, at the bottom of the SDK 7.1 cell.)

    Whenever I've done this in windows, I've always just used the Visual Studio compiler. I would suggest trying that first, since I don't remember this mex-setup process taking very long (before success/failure).

    这篇关于matlab编译安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆