简体   繁体   English

如何在Matlab中找到mex的编译器?

[英]How to locate compiler for mex in matlab?

I want to run c code from Matlab. 我想从Matlab运行C代码。 So i started to google and saw that using mex , i can achieve it. 因此,我开始使用Google并发现使用mex可以实现它。 But i got problem to run mex in matlab. 但是我在用MATLAB运行mex时遇到了问题。 Here's what i did: 这是我所做的:

1. At first i ran mex -setup in matlab command window. 1.首先,我在matlab命令窗口中运行了mex -setup

2. Then i got the below response. 2.然后我得到以下答复。

Please choose your compiler for building MEX-files: 请选择用于编译MEX文件的编译器:
Would you like mex to locate installed compilers [y]/n? 您是否希望mex找到已安装的编译器[y] / n?

3. I wrote y and got below response 3.我写了y ,但没有得到回应

No supported SDK or compiler was found on this computer. 在此计算机上找不到支持的SDK或编译器。 For a list of supported compilers, see 有关受支持的编译器的列表,请参见
http://www.mathworks.com/support/compilers/R2013a/win64.html http://www.mathworks.com/support/compilers/R2013a/win64.html

4. I went to the link and downloaded the sdk and installed it in my windows 10 . 4.我转到链接并下载了sdk并将其安装在Windows 10中 But while installing i got some problem but continued. 但是在安装时我遇到了一些问题,但仍在继续。

在此处输入图片说明

5. Again repeated the whole process and wrote y but got same message as above. 5.再次重复整个过程,并写y但得到与上述相同的信息。

6. Then i tried by writing n and saw all the list of my compilers. 6.然后,我尝试通过编写n查看我的所有编译器列表。

 [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 

7. The number 17 is my installed sdk. 7.数字17是我安装的SDK。 so i got a response after selecting 17. 所以选择17后我得到了回应。

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. 警告:Microsoft软件开发工具包(SDK)编译器的默认位置是:“ C:\\ Program Files(x86)\\ Microsoft Visual Studio 10.0”,但是该目录不存在或配置无效。

8. I have uninstalled visual studio from my computer and that directory remained 8.我从计算机上卸载了Visual Studio,该目录仍然存在

Is there any easy way to run c file from matlab or how to install compiler for mex file ?? 有什么简单的方法可以从Matlab运行c文件,或者如何为mex文件安装编译器?

EDIT: Now what i found is Windows Software Development Kit (SDK) for Windows 10 from this link and downloading it. 编辑:现在我发现是从此链接下载Windows 10的Windows软件开发工具包(SDK)。 I don't know that it will work or not?? 我不知道它是否可以工作?

I can not remember how many times that I close with striking MEX files. 我不记得我用敲击MEX文件关闭了多少次。 The following way is time-consuming but effective. 以下方法很耗时但有效。

  1. Uninstall Visual Studios and SDKs from your computer. 从计算机上卸载Visual Studios和SDK。
  2. Find a supported version of Visual Studio from ' https://www.mathworks.com/support/compilers.html ' 从“ https://www.mathworks.com/support/compilers.html ”中找到受支持的Visual Studio版本。
  3. Install C++ and related libraries in this Visual Studios with default directory. 使用默认目录在此Visual Studio中安装C ++和相关库。 Do not try to choose libraries by yourself. 不要尝试自己选择库。
  4. Run 'mex -setup', and let it find the compiler. 运行'mex -setup',让它找到编译器。

The entire process will use up a whole morning with good luck. 整个过程将用尽整个早晨,祝您好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何解决Matlab中无效的MEX文件错误? - How to solve Invalid MEX file error In Matlab? 在64位Windows 7计算机上将GCC用作MATLAB 2014a的默认MEX编译器 - Use GCC as the Default MEX Compiler for MATLAB 2014a on a 64 bit Windows 7 machine Matlab的mex设置 - mex setup for Matlab 将FFTW链接到Matlab Mex文件 - Linking FFTW into Matlab Mex file 如何将MATLAB的mex设置定向到Microsoft Windows SDK以进行C ++编译? (设置位置错误) - How to direct MATLAB's mex setup to the Microsoft Windows SDK for C++ compiling? (error in setting location) 如何在Win64 MATLAB下编译随Linux makefile一起提供的基于ANSI C99的MEX代码? - How can I compile ANSI C99-based MEX code delivered with Linux makefiles under Win64 MATLAB? Matlab mex命令在Windows的Armadillo中构建armaMex_demo.cpp - Matlab mex command for building armaMex_demo.cpp in Armadillo in Windows 如何在Matlab编译器生成的exe的高DPI设置上禁用显示缩放 - How to disable display scaling on high DPI settings of an exe generated by Matlab compiler 编译器在Windows上找不到GCD头文件 - Compiler doesn’t locate GCD header file on Windows 如何以编程方式检测和定位 Windows 10 SDK? - How to programmatically detect and locate the Windows 10 SDK?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM