-
Notifications
You must be signed in to change notification settings - Fork 14
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
Compiling make_mex in MATLAB 2012b #3
Comments
Unfortunately, his looks like a problem in ZeroMQ, not in my code. Can you successfully compile and run their own (C-based) demo programs? What version of ZeroMQ are you using? |
Hi, I am using ZeroMQ 3.2.0. I have not used ZeroMQ, which is the best demo to try to compile? Thanks, Chris From: Tim Holy [mailto:[email protected]] Unfortunately, his looks like a problem in ZeroMQ, not in my code. Can you successfully compile and run their own (C-based) demo programs? What version of ZeroMQ are you using? Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-9033168. |
On Monday, October 01, 2012 07:28:47 AM skinney75 wrote:
3.2 is far too buggy to use now (I think I even mention that in the Readme).
I bet switching to 2.x will fix it, but maybe this one? https://github.com/imatix/zguide/blob/master/examples/C/hwserver.c It may compile even under 3.2, of course, since it's one of their main demo Best, |
Hi, I have installed ZeroMQ 2.2 and I have the same issue. I will try to compile the sample you suggest. Regards, Chris |
Hi Tim, I have downloaded the Windows 7 SDK which had some additional compilers and I have tried the 'make_mex' again. I still get errors but they are now in zmq_connect.c:
C:\PROGRA~2\MATLAB\R2012B\BIN\MEX.PL: Error: Compile of 'zmq_connect.c' failed. It looks like it is failing on MATLAB calls, can I ask what version of MATLAB you are using? Regards, Chris |
I've used a couple (current R2012a), but I think the problem is that your C compiler doesn't like to have the variable declarations on the same line as assignment. I've changed the code, please try again (and sorry for the inconvenience). |
Thanks I will get the new code. Out of interest are you using MATLAB 64 or 32 bit? From: Tim Holy [mailto:[email protected]] I still get errors but they are now in zmq_connect.c: I've used a couple (current R2012a), but I think the problem is that your C compiler doesn't like to have the variable declarations on the same line as assignment. I've changed the code, please try again (and sorry for the inconvenience). Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-9082218. |
Hi, I have tried the new code and most of the errors have gone, there seems to be one left relating to the definition of classid:
C:\PROGRA~2\MATLAB\R2012B\BIN\MEX.PL: Error: Compile of 'zmq_connect.c' failed. From: Tim Holy [mailto:[email protected]] I still get errors but they are now in zmq_connect.c: I've used a couple (current R2012a), but I think the problem is that your C compiler doesn't like to have the variable declarations on the same line as assignment. I've changed the code, please try again (and sorry for the inconvenience). Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-9082218. |
On Wednesday, October 03, 2012 12:43:13 AM skinney75 wrote:
64
|
Thanks Tim, I think our posts got slightly mixed up, did you see my response to trying your new code this morning? |
Hi Tim, I changed my copy of the zmq_connect.c to have the 'class id' with the other variables that you changed recently. I now get on to the link stage and get: Warning: MEX could not find the library "zmq" specified with -l option. Creating library C:\Users\Admin\AppData\Local\Temp\mex_ep8dWE\templib.x and object C:\Users\Admin\AppData\Local\Temp\mex_ep8dWE\templib.exp C:\PROGRA~2\MATLAB\R2012B\BIN\MEX.PL: Error: Link of 'zmq_connect.mexw32' failed. C:\Program Files (x86)\ZeroMQ 2.2.0\lib has: libzmq-v100-mt.lib and libzmq-v100-mt-gd.lib I cant seem to find zmq.lib, am I missing something or do I need to change the 'make_mex' file? |
Hmm, this is weird: I sent two emails saying I had fixed this one, too (see commit from two days ago), but somehow they never appeared here. But obviously there are still problems. Unfortunately, I know nothing about linking on Windows. I would definitely consider changing the mex file. If you find some general solution, please submit a pull request and I'll merge it. Alternatively, under Linux I might think about making a link to the library in one of the places it's expecting to find it. (But I really don't know my way around Windows at all, so don't take this suggestion too seriously.) Sorry this is such trouble. Compiling MEX files is a pain---part of the point of this package, of course! |
Hi thank you kindly for contributing this code... I have been getting this issue when trying to compile: "zmq_connect.c(2) : fatal error C1083: Cannot open include file: 'zmq.h': No such file or directory C:\PROGRA~1\MATLAB\R2011B\BIN\MEX.PL: Error: Compile of 'zmq_connect.c' failed. " Is there any solutions? many thanks |
This means that zmq.h is not on your include search path. I don't know Windows, unfortunately, and I don't have a system I could easily test on. So I don't know how one goes about fixing this. How did you install ZeroMQ? |
It took some work but I managed to compile the MEX files under Windows. I'm using:
First, the make_mex.m needs to be changed as follows (got that hint from another ZeroMQ/Matlab project: https://github.com/smcgill3/zeromq-matlab): Then, zmq_cleanup.c and zmq_exec.c need to be modified to declare all variables at the top of the function, as apparently the free Microsoft compiler that comes with SDK 7.1 doesn't support the C99 style of variable declaration. I didn't try to actually use the matlab-julia interface yet so I don't know if it works but I at least wanted to put the info out there for other Windows users. -Patrick |
Thanks for posting this! I hope it works for you. These days I use Julia directly, so I don't have recent experience with it, but I'll be pleased if it helps you. |
On OS X, the code in
|
Hi,
I wonder if you can help with an issue that I am seeing, I am running MATLAB on a Windows 7 machine and I would like to compile your julia-matlab code.
I have ZeroMQ installed and I am using the 32-bit version of MATLAB which has its own compiler, however when I do 'make_mex' as instructed I get the following:
make_mex
Error zmq_connect.c: .\zmq.h: 71 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 126 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 129 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 144 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 145 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 146 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 147 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 150 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 151 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 162 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 163 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 164 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 166 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 167 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 168 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 169 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 170 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 171 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 172 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 173 unrecognized declaration
Error zmq_connect.c: .\zmq.h: 174 too many errors
C:\PROGRA~2\MATLAB\R2012B\BIN\MEX.PL: Error: Compile of 'zmq_connect.c' failed.
It seems that each declaration that has the ZMQ_EXPORT definition raises an error, for example on line 71 is the definition:
ZMQ_EXPORT void zmq_version(int *major, int *minor, int *patch)
Do you know how I can resolve this issue?
Thanks in advance,
Chris
The text was updated successfully, but these errors were encountered: