Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get problem of mexing the c file #12

Open
bruce803 opened this issue Sep 22, 2016 · 3 comments
Open

get problem of mexing the c file #12

bruce803 opened this issue Sep 22, 2016 · 3 comments

Comments

@bruce803
Copy link

Hi,
It seems that the install didn't work for me.
My Matlab version is 2014a and the default compiler (Microsoft Visual C++ 2012 ) is compatible.

But I have been reported:

install
Building diagsqmex MEX file.
Warning: Legacy MEX infrastructure is provided for compatibility; it will be removed in a future version of MATLAB.
For more information, consult the MEX release notes http://www.mathworks.com/help/matlab/release-notes.html.
In install at 13
doublevectormex.c
../varbvs-R/src\misc.h(38) : error C2059: syntax error : 'type'

C:\PROGRA~1\MATLAB\R2014A\BIN\MEX.PL: Error: Compile of 'doublevectormex.c' failed.

Unable to complete successfully.

Error in install (line 13)
eval(['mex ',opts,' diagsqmex.c doublevectormex.c singlematrixmex.c ',...

@bruce803 bruce803 changed the title get problem of mex the c file get problem of mexing the c file Sep 22, 2016
@pcarbo
Copy link
Owner

pcarbo commented Sep 23, 2016

Can you please add -v to the opts in the install.m script, and re-run it? I need more information to figure out what the problem might be. Thanks.

@bruce803
Copy link
Author

I got this:

install
Building diagsqmex MEX file.

-> Default options filename found in C:\Users\bruce\AppData\Roaming\MathWorks\MATLAB\R2014a

-> Options file = C:\Users\bruce\AppData\Roaming\MathWorks\MATLAB\R2014a\mexopts.bat
MATLAB = C:\Program Files\MATLAB\R2014a
-> COMPILER = cl
-> Compiler flags:
COMPFLAGS = /c /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD
OPTIMFLAGS = /O2 /Oy- /DNDEBUG
DEBUGFLAGS = /Z7
arguments = -DMATLAB_MEX_FILE -I../varbvs-R/src
Name switch = /Fo
-> Pre-linking commands =
-> LINKER = link
-> Link directives:
LINKFLAGS = /dll /export:mexFunction /LIBPATH:"C:\Program Files\MATLAB\R2014a\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib /MACHINE:X64 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /manifest /incremental:NO /implib:"C:\Users\bruce\AppData\Local\Temp\mex_hMPmrf\templib.x" /MAP:"diagsqmex.mexw64.map"
LINKDEBUGFLAGS = /debug /PDB:"diagsqmex.mexw64.pdb"
LINKFLAGSPOST =
Name directive = /out:"diagsqmex.mexw64"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = rc /fo "mexversion.res"

-> Resource Linker =

--> cl -DMATLAB_MEX_FILE -I../varbvs-R/src /c /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\Users\bruce\AppData\Local\Temp\mex_hMPmrf\diagsqmex.obj -I"C:\Program Files\MATLAB\R2014a\extern\include" -I"C:\Program Files\MATLAB\R2014a\simulink\include" /O2 /Oy- /DNDEBUG diagsqmex.c

diagsqmex.c

--> cl -DMATLAB_MEX_FILE -I../varbvs-R/src /c /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\Users\bruce\AppData\Local\Temp\mex_hMPmrf\doublevectormex.obj -I"C:\Program Files\MATLAB\R2014a\extern\include" -I"C:\Program Files\MATLAB\R2014a\simulink\include" /O2 /Oy- /DNDEBUG doublevectormex.c

doublevectormex.c
../varbvs-R/src\misc.h(38) : error C2059: syntax error : 'type'

C:\PROGRA~1\MATLAB\R2014A\BIN\MEX.PL: Error: Compile of 'doublevectormex.c' failed.

Unable to complete successfully.

Error in install (line 13)
eval(['mex ',opts,' diagsqmex.c doublevectormex.c singlematrixmex.c ',...

Actually, the mex works after I switched to Ubuntu with Matlab2016a. Does that mean the problem of compiler setup in Windows?

@pcarbo
Copy link
Owner

pcarbo commented Sep 24, 2016

I'm glad to hear it works with Ubuntu. :)

I see it is using the "cl" compiler, which I'm not familiar with. In fact, I have little experience with compiling MEX files on Windows. Before trying to solve this problem for the varbvs package, you might first see if you can compile the MEX files in the tutorials given on the MathWorks website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants