mex

Error using DGESV in Matlab mex

Deadly 提交于 2019-12-25 08:02:40
问题 I'm trying to solve a linear system with DGESV in a mex file. When I have a 2x2 system, the mex file works fine and no errors occurred, but when the system is larger than 2, MATLAB System Error dialog box apperas and says that matlab has encountered an internal problem and needs to be closed. Im using matlab r2016a on 64-bit windows 10 and intel composer XE 2013 The compile line is: mex -lmwlapack *.F The code is as follows: #include "fintrf.h" C Gateway subroutine subroutine mexfunction(nlhs

makefile with mex-project: `.rodata' can not be used when making a shared object

不羁的心 提交于 2019-12-25 07:58:31
问题 I have a c-code which I can compile using makefile and run. Now, I want to convert it to mex file which I would like to compile using corresponding makefile. However, my makefile for mex code is not working. I would appreciate if someone can guide me. I am working on 64 bit system. Structure of both C-codes and mex codes: C-codes Mex Code Test_tsnnls.c <--Main defined Test_tsnnls_MEX.c <--mex defined here Include_4_TSNNLS.h Include_4_TSNNLS.h Include_4_TSNNLS.c Include_4_TSNNLS.c Makefile (C

makefile with mex-project: `.rodata' can not be used when making a shared object

微笑、不失礼 提交于 2019-12-25 07:57:35
问题 I have a c-code which I can compile using makefile and run. Now, I want to convert it to mex file which I would like to compile using corresponding makefile. However, my makefile for mex code is not working. I would appreciate if someone can guide me. I am working on 64 bit system. Structure of both C-codes and mex codes: C-codes Mex Code Test_tsnnls.c <--Main defined Test_tsnnls_MEX.c <--mex defined here Include_4_TSNNLS.h Include_4_TSNNLS.h Include_4_TSNNLS.c Include_4_TSNNLS.c Makefile (C

MATLAB gives “undefined reference” errors trying to use gfortran on Windows

南楼画角 提交于 2019-12-25 01:15:15
问题 I'm trying to use MinGW gfortran with MATLAB R2019a on Windows 10 by writing a mexopts XML file based on existing XML files. I have cygwin installed with MinGW gcc, and I've been able to run mex -setup referencing the XML file successfully. When I try to compile the timestwo.F file to test the setup (using mex -R2018a timestwo.F90 ), I get a bunch of errors: Building with 'cygwin MinGW64 Compiler (Fortran)'. C:\cygwin64\bin\x86_64-w64-mingw32-gfortran -c -DMX_COMPAT_64 -DMATLAB_MEXCMD_RELEASE

Error when building C mex files in Matlab: permission denied

烂漫一生 提交于 2019-12-24 19:28:01
问题 I have tried to compile C code in matlab. I tested with the simple example code in the matlabroot/extern/examples subfolders. I did the following: mex -setup copyfile(fullfile(matlabroot,'extern','examples','mex', 'yprime.c'), './'); mex -v -g yprime.c The command line outputs the following information, which I guess should be a path problem, but I don't know how to solve it. ************************************************************************** Warning: Neither -compatibleArrayDims nor

“Symbols not found for Architecture x86_64” for a MEX file that uses the CPLEX API in C

左心房为你撑大大i 提交于 2019-12-24 14:50:17
问题 I'm currently writing a MEX file in MATLAB that uses the CPLEX API in C to solve linear programming problems. Unfortunately, I run into a "symbol(s) not found for architecture x86_64" problem when I attempt to compile and I have no idea of how to solve it. Some basic information: I can compile yprime.c and other MEX files that do not use the CPLEX API I am using MATLAB 2011b on Mac OSX 10.7.2 I am using the GCC 4.2 package included in XCode 4.2. I already applied the XCode 4.2 Patch for

Does symbol capitalization matter in object files with a linked dll?

烂漫一生 提交于 2019-12-24 13:52:47
问题 I'm trying to get the gfortran compiler working in MATLAB on Windows to create mex files. Gfortran isn't supported, but the Intel Fortran compiler is, which leads me to believe that a Fortran compiler should be able to compile Fortran source using MATLAB libraries. As detailed in my previous question, I get an "undefined reference" error for every symbol that should come from the MATLAB libraries. I thought this was an error with the preprocessor not getting invoked as suggested in a question

invalid mex file error (libstd++ version)

强颜欢笑 提交于 2019-12-24 13:01:46
问题 I compiled some codes in Matlab on a Linux system, and .mexa64 files has been generated, but in run time, I get the following error: Invalid MEX-file '/*.mexa64': /matlab-8.5/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.8' not found. i tried setting -rpath in make file by two following commands in matlab make file: LDFLAGS="\$LDFLAGS -rpath=/usr/local/GNU/glibc-2.22/lib/" LDFLAGS="\$LDFLAGS -dynamic-linker=/usr/local/GNU/glibc-2.22/lib/ld-linux-x86-64.so.2" But, it

Issues running mex commands on Octave

Deadly 提交于 2019-12-24 10:22:36
问题 I am using Ubuntu and am trying to use Octave to run a Matlab script that runs the mex compiler on some cpp files https://github.com/yuxng/MDP_Tracking/blob/master/compile.m I have the OpenCV requirement already installed but am receiving some errors. Basically the commands in octave are compile MOT_test The errrors I got from the compile command are shown below. Based on my google search plus this thread Mex file building with Octave (issue with wrappers) it seems like this issue of

What does the %#mex pragma do?

亡梦爱人 提交于 2019-12-24 03:18:31
问题 When I create a MEX file in MATLAB, I'm in the habit of also creating a .m file with the same name, a function signature identical to the MEX file, and otherwise containing nothing but help text in the form of comments, that are then displayed when one types help myfcn . When one does this, a small side-effect is that MATLAB Code Analyzer picks up on the fact that the input and output arguments specified in the function signature are unused, and flags them with an orange underline. Recently I