mex

How to link during Matlab's MEX compilation

对着背影说爱祢 提交于 2019-11-27 06:07:11
问题 I've written a program of the following form: #include "stuff_I_need.h" int main(){ construct_array(); // uses OpenMP pragma's print_array(); return(0); } that compiles, links, and runs correctly with the following command: `gcc44 -I/home/matteson/sundials/include/ main.c -lm -L/home/matteson/sundials/lib -lsundials_cvode -lsundials_nvecserial -fopenmp -o /home/matteson/MPI_test/CVODE_test/main_test` "gcc44" is simply gcc version 4.4 and is named like this because it's being compiled on a

Preventing a MEX file from crashing in MATLAB

最后都变了- 提交于 2019-11-27 05:23:11
I have a MEX file which I "borrowed" from someone else to help me code a semi-automated nuclear detection algorithm. The problem is that the MEX file sporadically causes a segmentation fault. However, if the code is run with the same parameters a second time, it's fine. I was hoping there was a sort of try/catch idiom for MEX files, but after spending most of my Saturday looking for something, I couldn't find anything. Any help on this issue would be amazing! Otherwise, I am going to have to port the .cpp into MATLAB (and it's around 10,000 lines using hundreds of dependencies :-(). Which

Matlab 2012a with Windows SDK 7.1

橙三吉。 提交于 2019-11-27 02:12:53
I am trying to setup the mex compiler. I am on Windows 8 with Visual studio 2012 and Matlab 2012a. I have already downloaded Windows SDK 7.1 and installed: But when I try to: mex -setup It says: No supported SDK or compiler was found on this computer. For a list of supported compilers, see http://www.mathworks.com/support/compilers/R2012a/win64.html Any thoughts? The Windows SDK 7.1 is on the list of supported compilers, so this is a valid question. I think it might be this bug , which I have run into where compilers get removed ( details from MS )! Check it out here too . The patch is on

MEX compile error: unknown type name 'char16_t'

给你一囗甜甜゛ 提交于 2019-11-26 19:31:50
问题 I cannot compile any MATLAB MEX code due to the following error: In file included from /Applications/MATLAB_R2013a.app/extern/include/mex.h:58: In file included from /Applications/MATLAB_R2013a.app/extern/include/matrix.h:294: /Applications/MATLAB_R2013a.app/extern/include/tmwtypes.h:819:9: error: unknown type name 'char16_t' typedef char16_t CHAR16_T; The only thing that has changed on my machine as far as I can remember is that Xcode was updated to version 5.1 (5B130a). Any fix for the time

What was the difference between WSDL & Mex Endpoint in WCF

允我心安 提交于 2019-11-26 19:28:15
问题 I have couple of question on mex endpoint. In legacy web services, we create a proxy using wsdl. The WSDL exposes the web service's meta data. In wcf, another term comes that mex endpoint, which also exposes meta data, but wsdl is still alive in wcf. I am new to wcf, and I am confused regarding the difference between wsdl & mex endpoint ? What is the meaning of httpGetEnabled="false" or httpGetEnabled="true" ? If I set httpGetEnabled="false" then what will happen? Does it mean the client will

How to build mex file directly in Visual Studio?

最后都变了- 提交于 2019-11-26 17:18:36
I have a Visual Studio 2010 solution that contains a library of functions, and I would like to be able to use MATLAB as one of several possible front-ends to this library. Therefore, I would like Visual Studio to automatically generate a mex file when I build the solution, without having to export all my build options and paths to mexopts.bat and open MATLAB to build the file from there. I have seen several suggestions to achieve something similar, for example in these posts: Matlab 7.1+ and Visual Studio 2005 Compiling a MEX file with Visual Studio How to use CMake and Visual Studio 2010 (64

Mex files: how to return an already allocated matlab array

南楼画角 提交于 2019-11-26 14:31:59
问题 I have found a really tricky problem, which I can not seem to fix easily. In short, I would like to return from a mex file an array, which has been passed as mex function input. You could trivially do this: void mexFunction(int nargout, mxArray *pargout [ ], int nargin, const mxArray *pargin[]) { pargout[0] = pargin[0]; } But this is not what I need. I would like to get the raw pointer from pargin[0] , process it internally, and return a freshly created mex array by setting the corresponding

Using GCC (MinGW) as MATLAB's MEX compiler

笑着哭i 提交于 2019-11-26 12:56:38
I've been given a project to run on MATLAB R2011a. As there are several .c files in there - I need to set up GCC as the MEX compiler for that project. However, I cannot seem to find any explanation as to how to set it up. I've tried a script program called gnumex - but it failed (probably set up for an older version of MATLAB). Any idea how to set it up? Richard Dualmann In Matlab 2011b, just compile and link directly in mingw64 or cygwin environment. MINGWPATH=c:/MinGW64 CYGPATH=c:/cygwin MATLABROOT=c:/Progra~1/MATLAB/R2011b CC=$(MINGWPATH)/bin/x86_64-w64-mingw32-gcc CFLAG= -Wall -m64 -O3 -I$

Matlab 2012a with Windows SDK 7.1

霸气de小男生 提交于 2019-11-26 12:32:44
问题 I am trying to setup the mex compiler. I am on Windows 8 with Visual studio 2012 and Matlab 2012a. I have already downloaded Windows SDK 7.1 and installed: But when I try to: mex -setup It says: No supported SDK or compiler was found on this computer. For a list of supported compilers, see http://www.mathworks.com/support/compilers/R2012a/win64.html Any thoughts? 回答1: The Windows SDK 7.1 is on the list of supported compilers, so this is a valid question. I think it might be this bug, which I

Preventing a MEX file from crashing in MATLAB

蹲街弑〆低调 提交于 2019-11-26 11:33:24
问题 I have a MEX file which I \"borrowed\" from someone else to help me code a semi-automated nuclear detection algorithm. The problem is that the MEX file sporadically causes a segmentation fault. However, if the code is run with the same parameters a second time, it\'s fine. I was hoping there was a sort of try/catch idiom for MEX files, but after spending most of my Saturday looking for something, I couldn\'t find anything. Any help on this issue would be amazing! Otherwise, I am going to have