Personal tools
You are here: Home Members cpascual Documents How to Compile QtiPlot for Windows (v0.9.7.8)

How to Compile QtiPlot for Windows (v0.9.7.8)

Compiling QtiPlot for windows is not trivial due to lack of detailed documentation from the developer. This is a step-by-step howto to keep record of the "tricks" in order to make the whole process easier in the future.

IMPORTANT NOTE:

 


****************************************************************************

A MORE RECENT VERSION OF THIS HOWTO CAN BE FOUND IN

http://www.cells.es/Members/cpascual/docs/qtiplot-howto

*****************************************************************************


 

The links in this guide were valid in July 2009. It is likely that some of the programs get updated and change their download addresses. I will update them if someone reports broken links.

Similarly, the instructions are given for the latests versions available at that time. I expect most of the information to be valid  (with trivial changes) if you use newer versions, but I don't test too often. If you succeed in compiling QtiPlot using newer versions and/or other configurations, I ask you to send me an email so that I can update the information in this page.

 

Introduction

QtiPlot is a scientific data analysis and plotting tool. It is a free clone of Origin.

The official page for Qtiplot is:  http://soft.proindependent.com/qtiplot.html

This how-to recreates the steps I used for compiling qtiplot-0.9.7.8 for windows XP.

Important: Python scripting is not enabled. Supporting Python scripting within QtiPlot introduces dependencies on PyQt and SIP. I haven't fought that war yet.

NOTE: you can find a more recent how-to in http://poolinfo.physik.hu-berlin.de/qtiplot-installer/README.html  which explains how to compile QtiPlot for windows with Python support (thanks to A.K. for pointing it out). I haven't tried it yet, but it looks pretty detailed. Just one note of caution: the instructions of that how-to may at some points be incompatible with the steps in this one, so you better follow one or the other, but don't mix them!

 

Ready to use packages


Important: If you are looking for ready-to-use (i.e., already compiled) packages for QtiPlot under Windows, you may be interested in this page instead.

 

Motivation

 

Although QtiPlot is Free (GPL v2), its author provides windows binaries only under a commercial contract.

Of course, given that the sources are GPL'ed, anyone is allowed to compile and redistribute the program by him/herself.

While the official compilation instructions in the QtiPlot web page are correct, they are far from being practical, and there is obvious lack of support from the author to any questions related to compilation problems. In general, the official policy seems (understandably) directed towards encouraging users to pay for a "maintenance contract".

Figuring out the little unexplained details for compilation took me a considerable amount of time and therefore I think it is interesting to document the whole process.

 

Prerequisites

We start from a pristine windows XP machine.

Acording to the QtiPlot Manual, we need about 9 libraries installed (Qt, Qwt, QwtPlot3D, liborigin2, muParser,  boost, GSL, zlib, libpng) as well as the mingw compiler.

In practice, some of them are included in the qtiplot source distribution and others are bundled in a package called Mingw-Distro. The instructions to have everything set-up are:

Installing Mingw-Distro

This bundle package (I used Mingw-4.2.zip) already provides you with:

  • the mingw compiler
  • libpng
  • zlib
  • boost 1.39

 

For installing the distro, do the following:

  1. Grab the latest release of MinGw-Distro from http://nuwen.net/mingw.html
  2. uncompress the zip file in c:\Mingw
  3. cd c:\Mingw\bin
  4. copy make.exe mingw32-make.exe
  5. Add c:\Mingw\bin to the system PATH environment variable

Installing GSL

There is a pre-compiled windows port of GSL at

http://gnuwin32.sourceforge.net/packages/gsl.htm

  1. Download the "complete package except sources" (gsl-1.8.exe)
  2. Install in c:\gnuwin32
Important

: do not install GSL in the default location (it includes a space that causes problems when linking).

Note: I haven't tried, but maybe installing GSL in the <Qtiplot_src_dir>/3dparties/gsl may simplify some configuration later

Installing muParser

  1. Download muParser from http://muparser.sourceforge.net/ (muparser_v130.tar.gz)
  2. Uncompress it to c:\muparser (you can use the gzip.exe and tar.exe executables in c:\mingw\bin, or just install 7zip from 7zip.org)
  3. open a command prompt and ...
  4. cd  c:\muparser\build
  5. make -f makefile.mingw

Installing Qt

I found out that I had to compile Qt from sources (instead of installing the pre-compiled binaries) to avoid an incompatibility with the mingw

compiler from mingw-distro.

  1. Download the sources package from ftp://ftp.qt.nokia.com/qt/source/ (qt-win-opensource-src-4.5.2.zip)
  2. uncompress the sources in: c:\qt\4.5.2
  3. set the following system environment variable: QMAKESPEC=win32-g++
  4. open a command prompt and...
  5. cd c:\qt\4.5.2
  6. configure -release
  7. make
  8. add "C:\Qt\4.5.2\bin"  to the system PATH environment variable

Compiling Qtiplot

Once all the prerequisites are dealt with, we can compile QtiPlot.

  1. Download Qtiplot from http://soft.proindependent.com/qtiplot.html (qtiplot-0.9.7.8.zip)
  2. Uncompress it to c:\qtiplot-0.9.7.8
  3. If you don have docbook and doxygen installed, edit c:\qtiplot-0.9.7.8\qtiplot.pro and delete the line referring to the "manual" subdirectory (this way you won't compile the manual, but you can always download it from the official page (there is even a menu option for that in the qtiplot program itself).
  4. Edit c:\qtiplot-0.9.7.8\qtiplot\qtiplot.pro and change all the INCLUDEPATH+= " and "win32:LIBS+=" lines in the windows sections so that they point to the right paths. Also comment out the line that says: "SCRIPTING_LANGS += Python" . This disables compiling with python support (otherwise you need to satisfy other tricky dependencies). In my case, the final version of the file looked like this.
  5. Edit the FitPlugins/*/*.pro files so that the GSL-related lines look like this example.
  6. Open a command prompt and...
  7.  cd c:\qtiplot-0.9.7.8
  8. qmake qtiplot.pro
  9. make

The compilation should proceed without problems now and qtiplot.exe should be ready in c:\qtiplot-0.9.7.8\qtiplot\

But if you try to execute it, you will probably get an error about a missing dll. Continue reading.

Creating a distribution package with all required libraries

For qtiplot.exe to run , it needs access to some dll's.

In order to distribute qtiplot with all needed files, create a distribution dir and copy the following files there:

Path relative to installation dir
original file in
gpl_license.txt
qtiplot_logo.png
 c:\qtiplot-0.9.7.8\
qtiplot.exe
c:\qtiplot-0.9.7.8\qtiplot\
fitPlugins\explin.dll
fitPlugins\exp_saturation.dll
fitPlugins\fitRational0.dll
fitPlugins\fitRational1.dll
fitPlugins\planck_wavelength.dll
C:\qtiplot-0.9.7.8\fitPlugins\
translations\
 c:\qtiplot-0.9.7.8\translations\*.qm
Qt3Support4.dll
QtAssistantClient4.dll 
QtCore4.dll 
QtGui4.dll 
QtNetwork4.dll 
QtOpenGL4.dll 
QtSql4.dll  QtSvg4.dll 
QtXml4.dll
 C:\Qt\4.5.2\bin\
mingwm10.dll c:\MinGW\bin\
README.txt
http://www.cells.es/Members/cpascual/files/

That's it. Qtiplot can be launched form this distribution directory and it can be zipped and copied to a different machine.

 

Contact information

If you have any comments, questions, or suggestions, feel free to contact me.

Document Actions