Skip to content

Building libm2k on Windows

AlexandraTrifan edited this page Aug 30, 2019 · 3 revisions

Install libm2k using the system installer

  • Get the latest installer here .

Dependencies

libiio

  • Download the libiio zip from this page.
  • Choose a location and extract libiio.

CMake

Swig

  • Download the SWIG zip from this page.
  • Choose a location and extract SWIG.

Python3

  • Download and install Python3 from the official page.
  • Set path to program files or C:\Python37.

libm2k

  • Clone libm2k or download zip and extract it.
  • Use the CMake-gui and open libm2k/CMakeLists.txt. At startup, select platform x64.

  • Press the Configure button. Some of the parameters will be set to their correct value.

  • Browse the location where you extracted libiio and set IIO_LIBRARIES to libiio/MS64/libiio.lib and IIO_INCLUDE_DIRS libiio/include.

  • Press the Configure button again.

  • Set the PYTHON_EXECUTABLE to have the python install folder (C:/Python37/python.exe).

  • Press the Configure button again.

  • Browse the location where you extracted SWIG and the SWIG_DIR to that location.

  • Press the Configure button again.

  • If no errors, click Generate button in CMake-gui

  • Click Open Project in CMake-gui - this will open Visual Studio.

Build solution in visual studio

If you want to install the library in the system:

  • Open a Command Prompt in the libiio folder and copy all the .dll files in C:\Windows\System32 .
  • Open a Command Prompt in the build folder and copy libm2k.dll in C:\Windows\System32 .
  • In the build folder run pip install wheel and python setup.py bdist_wheel in order to build and install the Python Bindings.

C# bindings

  • The C# bindings are built by default. In order to disable them, set ENABLE_CSHARP=OFF in the CMake configuration.
  • In order to use the C# bindings, you need to copy the following dlls in your build folder: libm2k-sharp.dll and libm2k-sharp-cxx-wrap.dll . These can be found in C:\Program Files\Common Files\libm2k if you installed libm2k using the system installer. Otherwise, you can download the latest archive from appveyor: Appveyor artifacts and get the dlls from there.
  • Add libm2k-sharp.dll as a reference in your project.
  • Check the examples from the source code.
Clone this wiki locally