mex

Compiling mexopencv in OS X 10.9 with Xcode 5 and Matlab R2013b

a 夏天 提交于 2019-12-03 19:42:38
问题 I'm interested in using Kota Yamaguchi's mexopencv library on my system with the following specifications: OS X 10.9 (Mavericks) Xcode 5 Matlab 2013b OpenCV installed via macports to /opt/local/include/{opencv,opencv2} and /opt/local/lib I git cloned the latest OpenCV revision using the command on the mexopencv web site; this is version 084838d62a25fcb3eec9f610abf91b167bc6c2f5 from Sat Jul 20 05:18:37 2013 -0700. I ran Matlab's mex -setup command and then implemented this workaround from

Matlab mex file is slow compared to its straight C equivalent

拜拜、爱过 提交于 2019-12-03 18:57:53
问题 I'm at a loss to explain (and avoid) the differences in speed between a Matlab mex program and the corresponding C program with no Matlab interface. I've been profiling a numerical analysis program: int main(){ Well_optimized_code(); } compiled with gcc 4.4 against the Matlab-Mex equivalent (directed to use gcc44, which is not the version currently supported by Matlab, but it's required for other reasons): void mexFunction(int nlhs,mxArray* plhs[], int nrhs, const mxArray* prhs[]){ Well

Setting up mex to use the Visual Studio 2010 compiler

自古美人都是妖i 提交于 2019-12-03 17:31:15
问题 I have Visual Studio 2010 installed. However, MATLAB doesn't find the compiler. >> mex -setup Please choose your compiler for building external interface (MEX) files: Would you like mex to locate installed compilers [y]/n? y Select a compiler: [0] None Compiler: If I answer n to the question, I get the following Would you like mex to locate installed compilers [y]/n? n Select a compiler: [1] Intel C++ 11.1 (with Microsoft Visual C++ 2008 SP1 linker) [2] Intel C++ 9.1 (with Microsoft Visual C+

How to install SPAMS toolbox in Matlab 2014b under windows 8.1

馋奶兔 提交于 2019-12-03 16:53:50
I am trying to learn how to successfully compile "Sparse Modeling Software" (SPAMS) in my machine which uses a Windows 8.1 OS and MATLAB R2014b. The steps I have taken are as followed (some parts might have been unnecessary or missing) Step 1. Installed "Microsoft Visual C++ 2013 Professional". Step 2. Installed "Microsoft Windows Software Development Kit (SDK)". Step 3. Download "spams-matlab-v2.4-svn2014-02-18.tar" from http://spams-devel.gforge.inria.fr/ Step 4. Unzip it in Windows using 7-zip. Only 1 error I received but all he other data were uncompressed. The error is this : ERROR: Can

GCC compilation very slow (large file)

不羁的心 提交于 2019-12-03 12:38:27
I am trying to compile a large C file (specifically for MATLAB mexing). The C file is around 20 MB (available from the GCC bug tracker if you want to play around with it). Here is the command I am running and the output to screen, below. This has been running for hours, and as you can see, optimization is already disabled (-O0). Why is this so slow? Is there a way I can make this faster? (For reference: Ubuntu 12.04 (Precise Pangolin) 64 bit and GCC 4.7.3) /usr/bin/gcc -c -DMX_COMPAT_32 -D_GNU_SOURCE -DMATLAB_MEX_FILE -I"/usr/local/MATLAB/R2015a/extern/include" -I"/usr/local/MATLAB/R2015a

Using boost in MATLAB MEX library, different from MATLAB's version

删除回忆录丶 提交于 2019-12-03 10:20:01
问题 We're creating a number of MATLAB MEX files that use our communications library. This communication library uses Boost a lot. Now, MATLAB also uses boost internally, which means that in a standard setup, we cannot use a boost version different from the one that comes with MATLAB or all hell ensues. Problem is, the boost version that comes with our reference version of matlab (boost 1.40) is quite old and has a few bugs. We'd very much like to use a newer version. The only solution I see is to

MATLAB parfor and C++ class mex wrappers (copy constructor required?)

匆匆过客 提交于 2019-12-03 08:02:38
I'm trying to wrap a C++ class in a matlab mex wrapper using the approach outlined here . Basically, I have an initialization mex file which returns a C++ object handle: handle = myclass_init() I can then pass this to another mex file (e.g. myclass_amethod ) which use the handle to call class methods, then ultimately to myclass_delete to free the C++ object: retval = myclass_amethod(handle, parameter) myclass_delete(handle) I've wrapped this up in a MATLAB class for ease of use: classdef myclass < handle properties(SetAccess=protected) cpp_handle_ end methods % class constructor function obj =

Embedding Python in MATLAB

☆樱花仙子☆ 提交于 2019-12-03 06:34:52
问题 I am trying to embed Python 2.6 into MATLAB (7.12). I wanted to embed with a mex file written in C. This worked fine for small simple examples using scalars. However, if Numpy (1.6.1) is imported in anyway MATLAB crashes. I say anyway because I have tried a number of ways to load the numpy libraries including In the python module (.py): from numpy import * With PyRun_SimpleString in the mex file: PyRun_SimpleString(“from numpy import *”); Calling numpy functions with Py_oBject_CallObject :

Setting up mex to use the Visual Studio 2010 compiler

房东的猫 提交于 2019-12-03 06:13:41
I have Visual Studio 2010 installed. However, MATLAB doesn't find the compiler. >> mex -setup Please choose your compiler for building external interface (MEX) files: Would you like mex to locate installed compilers [y]/n? y Select a compiler: [0] None Compiler: If I answer n to the question, I get the following Would you like mex to locate installed compilers [y]/n? n Select a compiler: [1] Intel C++ 11.1 (with Microsoft Visual C++ 2008 SP1 linker) [2] Intel C++ 9.1 (with Microsoft Visual C++ 2005 SP1 linker) [3] Intel Visual Fortran 11.1 (with Microsoft Visual C++ 2008 SP1 linker) [4] Intel

Using boost in MATLAB MEX library, different from MATLAB's version

[亡魂溺海] 提交于 2019-12-02 23:46:02
We're creating a number of MATLAB MEX files that use our communications library. This communication library uses Boost a lot. Now, MATLAB also uses boost internally, which means that in a standard setup, we cannot use a boost version different from the one that comes with MATLAB or all hell ensues. Problem is, the boost version that comes with our reference version of matlab (boost 1.40) is quite old and has a few bugs. We'd very much like to use a newer version. The only solution I see is to create a custom version of boost that lives in a different namespace. The name mangling should then