mex

Trying to find and install libstdc++.so.5 to run C++ with mex for MATLAB

放肆的年华 提交于 2019-12-11 18:01:26
问题 I am using the BGL libraries for MATLAB found here on fileexchange . I get this error when using a function from this library under Ubuntu 10.04 LTS (this error did not occur under Windows, where it worked normally). ??? Invalid MEX-file '/home/alex/Documents/MATLAB/MATLABsvnWorkingDir/Bloom/graphAnalysis/analysisAttempt2/functi onsDownloaded/matlab_bgl-4.0.1/matlab_bgl/private/components_mex.mexglx': libstdc++.so.5: cannot open shared object file: No such file or directory. Error in ==>

Updated packages, now Mex files compiled with -O0 are “invalid mex file”?

感情迁移 提交于 2019-12-11 15:54:29
问题 I had a (previously working and compiling for months) set of MEX files. I updated my 3-month-old packages (which worked fine before with GCC/G++) with a pacman -Syu, and now here are my results: For GCC/G++ : O0 - MEX file is "invalid" O1-O2 - works O3 - "optimizes" away the entire program. A simple mexPrintf() in the right spot fixes this by forcing it not to optimize it away For Clang : Nothing works, all optimization levels result in invalid mexfile For TDM-GCC : Works flawlessly

MATLAB crashes when I run MEX file

跟風遠走 提交于 2019-12-11 15:16:27
问题 I am trying to write a mex file, When Evaluating the mex, MATLAB crashes up every time I ran it. Here is a part of C++ code that I wrote : void mexFunction(mwSize nlhs, mxArray *plhs[], mwSize nrhs, const mxArray *prhs[]){ vector<int> *NNLt; double *NNLtout; Vector *V; Vector *Fb; mwSize *sn; mwSize nsn; mwSize nf; double hs; double bw; double mw; mwSize ncols; mwSize i; double *NNLtoutt; /* check for proper number of arguments */ if(nrhs!=9) { mexErrMsgIdAndTxt("MyToolbox:arrayProduct:nrhs",

way to handle to write CUDA+MEX code in linux?

混江龙づ霸主 提交于 2019-12-11 13:09:09
问题 I try to write matlab mex code with Cuda integrated but it is just hard enough to compile and debug all around. Is there any better approach to code and test? I am on Matlab 2012b. Currently I am writing code in sublime then compile it on matlab but I am also newbie at CUDA as well thus it is just hard to code it without seeing the result instantly. 回答1: The comment by Robert Crovella is interesting. I just wanted to mention the way I was used to compile mex file with CUDA instructions (and

Can a WCF service w/ BasicHttpBinding without a MEX Endpoint be exploited by absolute strangers?

ⅰ亾dé卋堺 提交于 2019-12-11 12:43:13
问题 From what I understand: If you don't have a MEX endpoint / WSDL, your service is basically non-discoverable. Only people who have knowledge of your data contract should be able to consume your service. Does this assertion hold water, or are there ways for malicious denizens of the internet to figure out how to invoke/consume services that have no MEX endpoint? EDIT: As Andrew pointed out, this strategy should not be considered to be truly secure. I'm wondering more along the lines of if it is

How can one configure mex to pass compiler flags to nvcc

自古美人都是妖i 提交于 2019-12-11 11:52:15
问题 While compiling mex files with nvcc I have struggled to pass compiler options specific to CUDA to the nvcc compiler, as mex doesn't recognize them. I found some old posts about passing compiler flags and some newer ones, but the questions are quite user-specific, and the mex compiler has changed over the years, so I cant figure out what to do. So, my specific question: What should I do to make mex pass compiler flags to nvcc ? A bit more generic: What should one do to make mex pass compiler

Can a MATLAB Mex function accept both single and doubles?

a 夏天 提交于 2019-12-11 08:16:26
问题 I have a mex function that accepts double matrices as the input, but I just realized that the code this function is used for, can have single precision matrices as well. Is it possible to allow the function to accept either? Or if not, what is an alternative way to fix this issue? 回答1: The simple solution would be to convert the inputs in MATLAB to a consistent type (presumably double), but if you would like to have your MEX function handle multiple types, here is one way. Check the input

Segmentation fault when calling class from matlab

大憨熊 提交于 2019-12-11 06:14:06
问题 I am getting a segmentation fault with the following code, and I really dont know what is happening here. It seems that it has something to do with the pointer in the Master-class, but I am not sure how to solve this. I have the following code: class Shape { public: Shape(){} ~Shape(){} virtual void draw() = 0; }; class Circle : public Shape { public: Circle(){} ~Circle(){} void draw() { printf("circle"); // code for drawing circle } }; class Line : public Shape { public: Line() {} ~Line() {}

Invalid Mex-function

与世无争的帅哥 提交于 2019-12-11 05:36:01
问题 I am quite experienced with matlab mex functions, but I am having a problem very difficult to solve. I am receiving a message like this: Invalid MEX-file 'mymex.mexw64': The specified procedure could not be found. Normally, this problem is related to missing dlls. However, I checked several times with dependency walker and nothing is missing. Also, I checked with "alternative" softwares, eg: ProcessMonitor, ProcessExplorer, CFF_Explorer... and so on. I have tried everything. The problem

Make MATLAB Mex search for a library in a particular folder

拥有回忆 提交于 2019-12-11 04:25:15
问题 I have created a mex function which relies on a library that relies on another library. When I execute the function, it outputs this error at runtime: Invalid MEX-file ... Library not loaded: /usr/local/lib/libgomp.1.dylib I do have this library on my computer but it is located in usr/local/gfortran/lib So I tried this: setenv('DYLD_LIBRARY_PATH', '/usr/local/gfortran/lib'); But this doesn't fix the issue at all. I'm using MacOS Sierra 10.12.6. How can I make MATLAB search for that specific