Installing pymatbridge on Windows

后端 未结 3 1598
醉话见心
醉话见心 2021-01-14 08:22

In version 0.3 of pymatbridge, an additional dependency was added for ZMQ. To install this version, you might therefore need to compile a messenger mex extensio

3条回答
  •  盖世英雄少女心
    2021-01-14 09:01

    As I use Visual Studio as my standard IDE I fiddled around and got a working build process. I used:

    VS 2013
    Matlab 2013b x64
    Python 3.3 x64
    ZeroMQ 4.0.4.
    

    If you use different Versions please make sure that you adjust the Path where necessary.

    Build messenger using Visual Studio (2013)

    • First create a new Solution with an empty C++ Project.
    • Set up the configuration, e.g. x64 Release
    • Open up the Project Properties and set up the following:

    Configuartion Properties -> General:

    Target Name: messenger

    Target Extension: .mexw64

    Configuration Type: Dynamic Library (.dll)

    Configuartion Properties -> VC++ Directories -> Include Directories:

    MATLABPATH \extern\include

    ZEROMQ PATH\include

    Configuartion Properties -> VC++ Directories -> Library Directories:

    MATLABPATH \extern\lib\win64\microsoft

    ZEROMQ PATH \lib

    Configuartion Properties -> Linker -> Input -> Additional Dependencies:

    libmx.lib; libmex.lib; libmat.lib; libzmq-v120-mt-4_0_4.dll

    Configuartion Properties -> Linker ->Command Line -> Additional Options:

    /export:mexFunction

    • Add messenger.c as source file
    • Build the library
    • Copy it to: PYTHONPATH \Lib\site-packages\pymatbridge\matlab\

    Please Note:

    I got some incompatible error cause by the function names already present in windows.h. The solution was to rename:

    • initialize
    • listen
    • respond
    • cleanup

    to:

    • initializeMat
    • listenMat
    • respondMat
    • cleanupMat

提交回复
热议问题