Skip to content

Building Scopy on Windows

AlexandraTrifan edited this page Nov 3, 2017 · 14 revisions

Installing the dependencies

Installing MSYS2

Download the 64-bit (x86_64) version of MSYS2 from here: https://msys2.github.io
Follow the instructions on the page linked above to install it, and update it.

When it's done, you need to install a couple of packages that Scopy depends on:

pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb mingw-w64-x86_64-cmake \ 
mingw-w64-x86_64-libxml2 mingw-w64-x86_64-libusb mingw-w64-x86_64-boost mingw-w64-x86_64-python3 \
mingw-w64-x86_64-fftw mingw-w64-x86_64-libzip mingw-w64-x86_64-glib2 mingw-w64-x86_64-glibmm \
mingw-w64-x86_64-pkg-config mingw-w64-x86_64-ninja git tar

This will take about 5-6 GiB on your hard drive.

Installing Qt

We need to install Qt 5.9.1, instead of the latest Qt package provided by pacman.

Downloading and installing Qt 5.9.1 for 64-bit

 wget http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-qt5-5.9.1-1-any.pkg.tar.xz
 pacman -U --noconfirm mingw-w64-x86_64-qt5-5.9.1-1-any.pkg.tar.xz

Downloading and installing Qt 5.9.1 for 32-bit

 wget http://repo.msys2.org/mingw/i686/mingw-w64-i686-qt5-5.9.1-1-any.pkg.tar.xz
 pacman -U --noconfirm mingw-w64-i686-qt5-5.9.1-1-any.pkg.tar.xz

Installing the pre-compiled libraries

Some dependencies cannot be found in MSYS2 (GNU Radio, libsigrok etc.).
To simplify things, we created a ZIP package containing these dependencies in pre-compiled form.

Let's download it and extract it in the MSYS2 folder:

64-bit pre-compiled libraries

 wget "https://ci.appveyor.com/api/projects/analogdevicesinc/scopy-mingw-build-deps/artifacts/scopy-mingw64-build-deps.tar.xz?branch=master&job=Environment: MINGW_VERSION=mingw64, ARCH=x86_64" -O- | tar -C / --strip-components=1 -xJ

32-bit pre-compiled libraries

 wget "https://ci.appveyor.com/api/projects/analogdevicesinc/scopy-mingw-build-deps/artifacts/scopy-mingw32-build-deps.tar.xz?branch=master&job=Environment: MINGW_VERSION=mingw32, ARCH=i686" -O- | tar -C / --strip-components=1 -xJ

Building Scopy

First, make sure you launch the 64-bit shell of MSYS2. It won't work in any other shell.

Cloning the repository

cd ~
git clone https://github.com/analogdevicesinc/scopy.git

This will fetch the latest sources from GitHub to a "scopy" directory.

Building Scopy

First, let's create a build folder so that we don't pollute the sources with generated files:

mkdir ~/scopy/build
cd ~/scopy/build

Then, let's configure the build:

cmake -GNinja ~/scopy

If everything goes well, it should say "Configuring done" and "Generating done".
If it says that it failed, no need to continue further.

To build the project:

ninja

This can take as long as 10 minutes or more, depending on your CPU.

Running Scopy

To run Scopy, it is required to first set a few environment variables.
To do that, click on the Start menu, search for 'environment'. The option 'Edit environment variables for your account' should appear; click on it.

The following dialog will open:

You will need to create two environment variables: "PATH" and "SCOPY_PYTHONPATH".
First, let's add "PATH":

  • Click on "New..."
  • In "Variable name:", write PATH
  • In "Variable value:" write %PATH%;C:\msys64\mingw64\bin
  • Then click OK.

Finally, add the "SCOPY_PYTHONPATH" variable:

  • Click on "New..."
  • In "Variable name:", write SCOPY_PYTHONPATH
  • In "Variable value:" write C:\msys64\mingw64\lib\python3.6;C:\msys64\mingw64\lib\python3.6\plat-win;C:\msys64\mingw64\lib\python3.6\lib-dynload;C:\msys64\mingw64\lib\python3.6\site-packages
  • Then click OK.

Once those steps are done, the Scopy you built should run.
With the file explorer, navigate to C:\msys64\home\<your_username>\scopy\build, and double-click on scopy.exe.

That's all folks!

Clone this wiki locally