GithubHelp home page GithubHelp logo

matlab-zmq's People

Contributors

abravalheri avatar dddvision avatar fagg avatar msvolenski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

matlab-zmq's Issues

Invalid MEX-file error

Hello,

I am using matlab 2016a and visual studio 2010. I run config.m file and all mex file are successfully build. When I run the examples code. I got the following error:

Invalid MEX-file 'R:\Python_C++_Development\MATLAB\matlab-zmq\lib+zmq+core\ctx_new.mexw64': The specified module could not
be found.

Though I've added lib directory in my MATLAB path.

Any help ?

Thanks in advance

[TODO: @abravalheri] Guess buffer length when receiving messages

Until now, when the user does not provide ther buffer length, the default value 255 is assumed. This may cause data loss when the user does not know the size of message.

The approach should be using zmq_msg_recv instead of zmq_recv when no length is passed.

Fails to build on macOS

Contents of config.m:

% ZMQ library filename
ZMQ_COMPILED_LIB = './libzmq.a';

% ZMQ library path
ZMQ_LIB_PATH = '/usr/local/Cellar/zeromq/4.3.4/lib/';

% ZMQ headers path
ZMQ_INCLUDE_PATH = '/usr/local/Cellar/zeromq/4.3.4/include/';

Verify that the above file exists:

>> config
>> ls(strcat(ZMQ_LIB_PATH,ZMQ_COMPILED_LIB))
/usr/local/Cellar/zeromq/4.3.4/lib/./libzmq.a

(no error)

Try to build:

>> make
compile ".../matlab-zmq/src/core/version.c"
Building with 'Xcode with Clang'.
Error using mex
ld: library not found for -l./libzmq
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Error in make>compile (line 213)
    mex('-largeArrayDims', '-O', flags{:}, deps{:}, file, '-output', outputfile);

Error in make>@(file)compile(zmq_compile_flags,file,fullfile(lib_path,'+zmq/+core')) (line 166)
  build_function = @(file) compile(zmq_compile_flags, file, fullfile(lib_path,'+zmq/+core'));

Error in make>build (line 167)
  cellfun(build_function, COMPILE_LIST);

Error in make (line 40)
    success = build;

make.m error LNK2019

hello,
i has an issue when i ran make.m, the following error happen

エラー: mex
Creating library C:\Users\wadalab\DOCUME1\MATLAB\Anh\ZMQ\MATLAB2\lib+zmq+core\version.lib and object
C:\Users\wadalab\DOCUME1\MATLAB\Anh\ZMQ\MATLAB2\lib+zmq+core\version.exp
version.obj : error LNK2019: unresolved external symbol __imp__zmq_version referenced in function _mexFunction
C:\Users\wadalab\DOCUME1\MATLAB\Anh\ZMQ\MATLAB2\lib+zmq+core\version.mexw32 : fatal error LNK1120: 1 unresolved externals
the version i used:
window 7
MATLAB R2015b
Visual Studio 2013 compiler
ZeroMQ 4.0.4 libzmq v120
with the config:
ZMQ_COMPILED_LIB = 'libzmq-v120-mt-4_0_4.lib';

% ZMQ library path
ZMQ_LIB_PATH = 'C:\Program Files\ZeroMQ 4.0.4\lib';

% ZMQ headers path
ZMQ_INCLUDE_PATH = 'C:\Program Files\ZeroMQ 4.0.4\include';

i've already spent hours try to solve it, but no luck.
i would be so grateful if some one help me with this.
thank you in advance.

Invalid MEX-file

Hello,

I am trying to implement ZMQ in MATLAB, with the following versions:

Branch: Master
MATLAB R2015b x 64 bits
Visual Studio 2013 compiler x 32 bits
ZeroMQ 4.0.4 x64 bits, libzmq v120

But it seems that I have problems with the compilation of the MEX-files since I got this message from MATLAB:

Error using zmq.core.ctx_new
Invalid MEX-file 'C:\Program_Files\matlab-zmq-master\lib+zmq+core\ctx_new.mexw64': The specified module could not be found.

Error in collector (line 7)
context = zmq.core.ctx_new();

However, the invalid MEX-file exists and is in the right location, maybe the problem is that my compiler is generating MEX-files wrongly. I tried changing the ZeroMQ for x32 version without any success. I used MinGW-w64 and I got the same error. Additionally, I tested it in another PC using MATLAB 2013b and Visual Studio 2012 and the same error was presented.

I would be so grateful if someone could help me or say me advices to try to debug it.

Thank you in advance.

Error while running the make command: error using mex: 'SOCKET': undeclared identifier

I am trying to use the "pupil-helpers/matlab" scripts. It states 'matlab-zmq' as a required package. But I can't get 'matlab-zmq' to work. I followed the instructions in the README file, but I'm stuck at successfully running the 'make.m' file. Please find the software versions, and text files containing MATLAB outputs. Any help will be greatly appreciated. Thank you!

Versions:

          MATLAB: R2019b Update 5 64-bit (win64)

          OS: Windows 10 Pro

          ZMQ - libzmq-v142-4_3_3

          matlab-zmq - master (but also tried **dev**, with the same results)

Installed ZeroMQ; configured mex (both mingw and visual studio c++ 2019); paths are added to MATLAB; 'config.m' has the correct library name and directories; error appears while running 'make' command


Attached text files contain just the errors, and also the whole output upon using either mex compiler - mingw or visual studio c++ 2019 - My understanding is that the cause of the error is the same, just the description is slightly different.


Error while running the 'make' command:

Building with 'Microsoft Visual C++ 2019 (C)'.
Error using mex
sockopt.c
C:\Users\Phil Lab\Documents\MATLAB\file-exchange\matlab-zmq-dev\src\util\sockopt.c(106): error C2065: 'SOCKET': undeclared
identifier



Error in make>compile (line 213)
    mex('-largeArrayDims', '-O', flags{:}, deps{:}, file, '-output', outputfile);

Error in make>@(file)compile(zmq_compile_flags,file,fullfile(lib_path,'+zmq/+core')) (line 166)
  build_function = @(file) compile(zmq_compile_flags, file, fullfile(lib_path,'+zmq/+core'));

Error in make>build (line 167)
  cellfun(build_function, COMPILE_LIST);

Error in make (line 40)
    success = build;

whole_output_vs19.txt
whole_output_mingw.txt
make_error_matlab-zmq_both-mingw-and-vscpp2019.txt

Error Using Mex

Hello,

I'm trying to run the make script however I keep having an error. Im using ZMQ version 4.3.2 ; Xcode version 8 and OS version 10.13.6. Any help is appreciated. Thank you very much!

I have attached a picture of the error I'm encountering.

Screen Shot 2019-07-31 at 10 51 03 AM

[TODO] Documentation

Need to properly document for user.

I am nominating that we use org-mode to generate HTML but I am open to other suggestions

Windows testing

Need to test on Windows-flavoured ZMQ and MATLAB, however I do not have a Windows machine nor the expertise.

creating mex file

To run the make.m file. First we have to configure mex as mentioned on the instruction. But I am slightly confused how to do this in this case. After googling and spending hours, I still don't have any clue.

Any insight ?

[TODO: @fagg] Runtime test failures on Mac.

core.getsockopt test doesn't even get the opportunity to fail, it causes MATLAB to crash spectacularly with a seg fault. From my testing this appears to be in anything based on master.

Add poller support

add zmq_poller support to matlab-zmq. It looks like there is a branch that is part of the way there but not merged/completed.

matlab error

Error using mex
C:\Users\User\Desktop\tool\matlab-zmq-master\src\util\sockopt.c:106:30: error: 'SOCKET' undeclared
here (not in a function)
{SOPT_SOCKET , sizeof(SOCKET) , pointer_to_m , pointer_from_m } ,
^~~~~~
can you help me solve this error?

[Regression] Tests don't work against fancy-api

It seems that the test suite no longer works on my Mac when run against the fancy-api branch. I think this is due to the changes earlier today.

make test that only 1 test completes successfully (see screenshot). Build is successful, everything working as expected when I run examples etc.

@abravalheri: Can you please confirm the tests run against Windows?

screen shot 2014-11-18 at 22 24 16

Invalid MEX-file

Hello,

I am able to run the make.m as you can see below.

Building with 'Microsoft Visual C++ 2019 (C)'.
MEX completed successfully.

Succesful build for:
ZMQ_INCLUDE_PATH = C:\Program Files\ZeroMQ 4.0.4\include
ZMQ_LIB_PATH = C:\Program Files\ZeroMQ 4.0.4\lib
ZMQ_COMPILED_LIB = libzmq-v120-mt-4_0_4.lib

ans =

logical

1

But when I want to use the program it says:
ctx = zmq_ctx_new()
Error:
Unrecognized function or variable 'zmq_ctx_new'.

or when I run something like
v = zmq.core.version

Error using zmq.core.version
Invalid MEX-file 'C:\realtime-matlab-experiment-main\matlab-zmq\lib+zmq+core\version.mexw64': The specified module could not be found.

Thank you in advance.

Context cleanup blocking on Windows

Hi @fagg , could you please verify if the following commands lead MATLAB to blocking state also in OS X?

context = zmq.Context();
socket = context.socket('ZMQ_PUB');
clear('context');

On Windows, I'm facing this problem, maybe it would be necessary to keep a track on opened sockets and close them before shutting down context...

Test failures on macOS MATLAB 2021b

Two tests (test 5 and 13) fail running the latest MATLAB 2021b + ZeroMQ (4.3.4) on macOS 12.1:

>> make test
Running test (1/18): test_context_cleanup...[PASS]
Running test (2/18): test_context_get...[PASS]
Running test (3/18): test_socket_bind...[PASS]
Running test (4/18): test_socket_connect...[PASS]
Running test (5/18): test_socket_get...[FAIL]
Running test (6/18): test_socket_send_recv...[PASS]
Running test (7/18): test_socket_send_recv_multipart...[PASS]
Running test (8/18): test_socket_send_recv_string...[PASS]
Running test (9/18): test_socket_set...[PASS]
Running test (10/18): test_zmq_bind...[PASS]
Running test (11/18): test_zmq_connect...[PASS]
Running test (12/18): test_zmq_ctx_get...[PASS]
Running test (13/18): test_zmq_getsockopt...[FAIL]
Running test (14/18): test_zmq_req_rep...[PASS]
Running test (15/18): test_zmq_req_rep_multipart...[PASS]
Running test (16/18): test_zmq_setsockopt...[PASS]
Running test (17/18): test_zmq_socket...[PASS]
Running test (18/18): test_zmq_version...[PASS]
Elapsed time is 1.313825 seconds.
Error using runner (line 67)
Tests: 16 passed, 2 failed.

test_socket_get (line 61):
	rcvbuf should be 0, -1 given.

test_zmq_getsockopt (line 59):
	ZMQ_RCVBUF should be 0, -1 given.



Error in make>run_tests (line 96)
  success = runner(varargin{:});

Error in make (line 33)
        success = run_tests(varargin{2:end});

Thanks!

getsockopts: Mutli-type return.

Once core_getsockopt() determines what the option selection is, we need to properly cast the return value before it's passed back to MATLAB workspace.

make.m returns error despite all files compiled well

Hello,

i had an issue where all files (16 files) are compiled well by Matlab, but the comparison in make.m exits with an error.

Line 171 in make.m:

files = ls(fullfile(fullfile(lib_path, '+zmq/+core'), '.mex'));
if size(files, 1) == length(COMPILE_LIST)
success = true;
fprintf('\nSuccesful build for:\n');
else
success = false;
fprintf('\nErrors during build for:\n');
end

The variable "files" is an 1 by x Char/String, containing the installed files (incl. newlines) and "COMPILE_LIST" is a 16 by x cell. I think "files" should be also a cell where each element of the "ls" command is split at the newlines or similiar.

Best regards!

mexw64 dependency issues

I'm using the master check out. I am able to run "make('build')" with the following result:

Building with 'MinGW64 Compiler (C)'.
MEX completed successfully.

Succesful build for:
ZMQ_INCLUDE_PATH = C:\Program Files\ZeroMQ 4.0.4\include
ZMQ_LIB_PATH = C:\Program Files\ZeroMQ 4.0.4\lib
ZMQ_COMPILED_LIB = libzmq-v120-mt-4_0_4.lib

ans =

 1

When I try to run "make('test')" the dll dependencies are not loading. I get the following error:
Invalid MEX-file 'C:\Users\Downloads\matlab-zmq-master\lib+zmq+core\ctx_new.mexw64'

The mexw64 files exist. Any idea as to how to fix this?

I'm running Matlab R2015b (64-bit) on Windows 10 (64-bit). Also running 64-bit ZMQ.

Trouble running in windows 7

Hello,

I'm trying to get it matlab-zmq to work on my Windows 7 x64 machine. I have installed ZMQ using the windows installer (http://zeromq.org/distro:microsoft-windows). I'm running Matlab R2013a and have set my to "Microsoft Windows SDK 7.1". I set the config.m file as indicated and run make.

I get a successful build:

Succesful build for:
ZMQ_INCLUDE_PATH = C:\Program Files\ZeroMQ 4.0.4\include
ZMQ_LIB_PATH = C:\Program Files\ZeroMQ 4.0.4\lib
ZMQ_COMPILED_LIB = libzmq-v100-mt-4_0_4.lib

ans =

 1

However, is I run make('test') all the test fail. Further, if I run one of the examples it gives me the following error:

Invalid MEX-file 'C:\Users\Downloads\matlab-zmq-dev\matlab-zmq-dev\lib+zmq+core\ctx_new.mexw64': The
specified module could not be found.

Error in pub_server (line 16)
context = zmq.core.ctx_new();

Any insight in why this is happening??

Thanks

[TODO: @fagg] Code cleanup

Need to clean up some code in dev to ensure code style is consistent. Some of it looks a little fragmented.

recv (MEX-file) taking a long time

I'm using a pub sub protocol where I'm the subscriber receiving a multipart message....when I try and receive the message > 4000 times the profiler begins to show the recv (MEX-file) is taking the longest amount of time

this is what I'm running

for k = 1:100000
    topic = char(zmq.core.recv(socket,10000));
    rc = zmq.core.getsockopt(socket, 'ZMQ_RCVMORE');
    msg = char(zmq.core.recv(socket, 10000));
    rc2 = zmq.core.getsockopt(socket, 'ZMQ_RCVMORE');
end

after ~200 seconds this is what the profiler showed I ended up stopping the loop at k = 12355

profilemultipartzmq

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.