Wiki

Clone wiki

FRA4PicoScope / Building FRA4PicoScope

Dependencies

The current versions known to work are PicoScope SDK 10.6.10, PLplot 5.11.1, Qt 4.8.6, and Boost 1.58.0.

Since v0.5b (or commit 1fde755), the preferred PicoScope driver DLLs are those from the installed PicoScope SDK, which can be downloaded and installed from the Pico Technology website. Install the SDK for the operating system and processor architecture appropriate for the FRA4PicoScope app (currently only Windows 32 bit)

Overall Build Steps

  1. Download and install the PicoScope SDK
  2. Download the source for PLplot and Qt and download the required build configuration tool, CMake (at least version 3.2.3)
  3. Build static debug and release versions of PLplot with Qt support in VS2012. See details below. If you run into trouble, a good resource is the PLplot Wiki.
  4. Download the Boost libraries and set the environment variable BOOST_ROOT to the location of the Boost root directory.
  5. Setup the local Git repository and get the code for this project.
  6. Make a folder in the project source code directory called lib
  7. Copy the debug and release install folders for PLplot (plplot_install_debug, and plplot_install_release) to the lib folder
  8. Copy the Qt library files QtGui.lib, QtGuid.lib, QtCore.lib, and QtCored.lib to the lib folder
  9. Build the FRA4PicoScope project in VS2012
  10. The Release project includes the build of a simple installer MSI. If you want to build the installer package you will need to have the WiX toolset installed. The current version (3.8 as of this writing) is known to work.

Building PLplot

Note: Since version 0.4b, FRA4PicoScope uses PLPlot with Qt support.

While there are probably multiple ways to go about this, well described on PLplot and related Wikis, the following is a more prescriptive example of what I did:

Building Qt first:

  1. We build a minimal Qt library for use with PLplot since PLplot is only using a very small portion of Qt. Even so, building Qt can take several minutes.

  2. Download and unpack the open-source licensed Qt version 4.8.6. I prefer to keep source code in short directory paths with no spaces. In this example, source code is in "C:\SourceCode".

  3. We're going to build for static runtime libs, to match the configuration of the FRA4PicoScope application. So, in the qt-everywhere-opensource-src-4.8.6\mkspecs\win32-msvc2012\qmake.conf file, edit these flags as follows (Changing MD to MT):
    Original:
    QMAKE_CFLAGS_RELEASE = -O2 -MD
    QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MD -Zi
    QMAKE_CFLAGS_DEBUG = -Zi -MDd
    New:
    QMAKE_CFLAGS_RELEASE = -O2 -MT
    QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -MT -Zi
    QMAKE_CFLAGS_DEBUG = -Zi -MTd

  4. We're going to build out of place, so create a directory at the same level as "qt-everywhere-opensource-src-4.8.6" called "qt_4.8.6_minimal_build_for_FRA4PicoScope"

  5. Launch the VS2012 command shell (normally Programs->Microsoft Visual Studio 2012->Visual Studio Tools->VS2012 x86 Native Tools Command Prompt)

  6. Change to the qt_4.8.6_minimal_build_for_FRA4PicoScope directory.

  7. Execute the following command* :
    ..\qt-everywhere-opensource-src-4.8.6\configure -mp -opensource -debug-and-release -static -nomake demos -nomake examples -nomake tools -no-ltcg -no-stl -no-accessibility -no-qt3support -no-openvg -no-system-proxies -no-libmng -no-gif -no-libpng -no-libtiff -no-libjpeg -no-dbus -no-script -no-scripttools -no-openssl -no-opengl -no-webkit -no-phonon -no-phonon-backend -no-multimedia -no-audio-backend -no-style-windowsxp -no-style-windowsvista -no-style-windowsce -no-style-windowsmobile -no-style-motif -no-style-cde -no-style-cleanlooks -no-style-plastique -no-style-s60 -no-native-gestures -no-sql-sqlite -no-declarative -no-declarative-debug -platform win32-msvc2012

  8. Enter 'y' to accept the GPLv3 license

  9. After configuration is done, just enter the command 'nmake' to build Qt.

*Note, if you take out all styles (i.e. also including -no-style-windows), you'll get a debug assert event in the debug build everytime PLplot initializes Qt (every Bode plot redraw). It will still work, but is very annoying. So, we'll leave that style in the Qt build.

Building PLplot:

  1. Get the 5.11.1 sources from the PLplot repository on Sourceforge: PLplot 5.11.1 Source
  2. Unpack the source, resulting in a directory plplot-5.11.1
  3. Configure the debug build tree
    1. Create a directory along-side the plplot-5.11.1 directory called plplot_static_debug_build
    2. Launch the VS2012 command shell (normally Programs->Microsoft Visual Studio 2012->Visual Studio Tools->VS2012 x86 Native Tools Command Prompt)
    3. Change directory to plplot_static_debug_build directory created in step 1.
    4. Run command: set QTDIR=C:\SourceCode\qt_4.8.6_minimal_build_for_FRA4PicoScope
    5. Run command: set PATH=%QTDIR%\bin;%PATH%
    6. Run command: cmake "C:/SourceCode/plplot-5.11.1" -G"Visual Studio 11" -DPL_DOUBLE=ON -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX="C:\SourceCode\plplot_install_debug" -DBUILD_SHARED_LIBS=OFF -DCMAKE_CONFIGURATION_TYPES="Debug" -DSTATIC_RUNTIME=ON -DDEFAULT_NO_QT_DEVICES=ON -DPLD_memqt=ON -DPLD_wincairo=OFF -DPLD_mem=OFF -DPLD_ps=OFF -DPLD_wingcc=OFF -DPLD_xfig=OFF -DENABLE_cxx=OFF -DWITH_CSA=OFF
  4. Configure the release build tree
    1. Create a directory along-side the plplot-5.11.1 directory called plplot_static_release_build
    2. Launch the VS2012 command shell (normally Programs->Microsoft Visual Studio 2012->Visual Studio Tools->VS2012 x86 Native Tools Command Prompt)
    3. Change directory to plplot_static_release_build directory created in step 1.
    4. Run command: set QTDIR=C:\SourceCode\qt_4.8.6_minimal_build_for_FRA4PicoScope
    5. Run command: set PATH=%QTDIR%\bin;%PATH%
    6. Run command: cmake "C:/SourceCode/plplot-5.11.1" -G"Visual Studio 11" -DPL_DOUBLE=ON -DBUILD_TEST=ON -DCMAKE_INSTALL_PREFIX="C:\SourceCode\plplot_install_release" -DBUILD_SHARED_LIBS=OFF -DCMAKE_CONFIGURATION_TYPES="Release" -DSTATIC_RUNTIME=ON -DDEFAULT_NO_QT_DEVICES=ON -DPLD_memqt=ON -DPLD_wincairo=OFF -DPLD_mem=OFF -DPLD_ps=OFF -DPLD_wingcc=OFF -DPLD_xfig=OFF -DENABLE_cxx=OFF -DWITH_CSA=OFF
  5. The CMake scripts create separate VS2012 projects for Debug and Release. Open the solution file plplot.sln in each tree (plplot_build_debug, and plplot_build_release) and execute a build of the INSTALL project.
  6. A correct build of both should result in two installation directory trees at the same level as the plplot-5.11.1 directory (plplot_install_debug, and plplot_install_release)

Updated