Compiling Qtiplot 0.9.8.9+2400svn

This post is about how I was able to successfully compile and package the most recent svn checkout of qtiplot on my Ubuntu 12.04 x64 installation.

Note from the future: These instructions are very old, and likely do not work anymore. Many of the links might not work either…

Qtiplot is a great software for scientific plotting, and is a very functional open-source replacement for Origin. Since it is a Qt application and open source, it can be compiled on pretty much any platform (although it is not the most trivial of compilations). The maintainer provides pre-compiled binaries if you subscribe ($$$) to a maintenance contract, but there’s no reason you can’t compile it yourself! Here’s how I managed to get it working on my installation.

  • Download the latest open source version of qtiplot from the development website
  • Download and install the dependencies that you will need to compile the program:

    sudo apt-get install libboost-all-dev libgsl0-dev libqt4-dev docbook-utils dblatex libpng12-dev libtool zlib1g-dev qt4-dev-tools python-all-dev libxext-dev libqtassistantclient-dev libmuparser-dev python-qt4-dev python-sip-dev pyqt4-dev-tools
    
  • Now we’ll need to download and compile a few third party libraries that are not included with the qtiplot sources: tamu_anova (0.2), QTeXEngine (0.3), and algLib (2.6.0):

    • (Note: if these sources are not available, you can download them from here, here, and here and proceed as below w/o the wget commands)

      cd qtiplot-0.9.8.9/3rdparty
      wget http://ftp.debian.org/debian/pool/main/t/tamuanova/tamuanova_0.2.orig.tar.gz
      tar xvzf tamu_anova-0.2.tar.gz
      cd tamu_anova-0.2
      ./configure
      make
      cd ..
      
      wget http://download.berlios.de/qtiplot/QTeXEngine-0.3-opensource.zip
      unzip QTeXEngine-0.3-opensource.zip
      cd QTeXEngine
      qmake
      make
      cd ..
      
      wget http://www.alglib.net/translator/re/alglib-2.6.0.cpp.zip
      unzip alglib-2.6.0.cpp.zip
      cd cpp
      chmod +x build
      ./build gcc
      cd ..
      
  • After this, your 3rdparty folder should look something like this:

    drwxrwxr-x 9 josh josh 4.0K Jul 30 12:30 ./
    drwxrwxr-x 7 josh josh 4.0K Jul 30 10:53 ../
    -rw-rw-r-- 1 josh josh 1.1M Sep 28  2011 alglib-2.6.0.cpp.zip
    drwxrwxr-x 8 josh josh 4.0K Jul 30 12:30 cpp/
    drwxrwxr-x 8 josh josh 4.0K Jul 30 12:30 QTeXEngine/
    -rw-rw-r-- 1 josh josh 143K Nov  9  2010 QTeXEngine-0.3-opensource.zip
    drwxrwxr-x 4 josh josh 4.0K Jul 30 10:46 qwt/
    drwxrwxr-x 6 josh josh 4.0K Jul 30 10:46 qwtplot3d/
    drwxrwxr-x 6 josh josh 4.0K Jul 30 10:53 .svn/
    drwxrwxr-x 2 josh josh 4.0K Jul 30 11:55 tamu_anova-0.2/
    -rw-rw-r-- 1 josh josh 216K Apr 28  2011 tamuanova_0.2.orig.tar.gz
    drwxrwxr-x 3 josh josh 4.0K Jul 30 10:46 zlib/
    
  • Now, you need to make a slight modification to one of the source files in order for the compilation to be successful because they don’t include the correct libraries:

    • We need to modify the file ./3rdparty/qwtplot3d/include/qwt3d_global.h by adding the GL/glu.h line, so the first 8 lines of the file look like:

      #ifndef QWT3D_GLOBAL_H
      #define QWT3D_GLOBAL_H
      
      #include <qglobal.h>
      #include <GL/glu.h>
      #if QT_VERSION < 0x040000
      #include <qmodules.h>
      #endif
      
  • The next step is to create a build.conf file. This file goes in the original ./qtiplot-0.9.8.9/ folder. You’ll notice that a build.conf.example file is included with the source, and this will show you the syntax, but does not have the correct path and library options. Copy the one that I used below, or download here.

    isEmpty( QTI_ROOT ) {
      message( "each file including this config needs to set QTI_ROOT to the dir containing this file!" )
    }
    
    ##########################################################
    ##     System specific configuration
    ##########################################################
    
    # Global include path which is always added at the end of the INCLUDEPATH
    SYS_INCLUDEPATH  =/usr/include/
    SYS_INCLUDEPATH = -I/$$QTI_ROOT/tmp/qtiplot
    # Global lib path and libs which is ls always added at the end of LIBS
    SYS_LIBS = -L/usr/lib -lGLU -lz
    
    ##########################################################
    ## muParser (http://muparser.sourceforge.net/)
    ##########################################################
    
    MUPARSER_INCLUDEPATH = /usr/include/muParser
    MUPARSER_LIBS = -lmuparser
    
    ##########################################################
    ## GNU Sientific Library (http://www.gnu.org/software/gsl/)
    ##########################################################
    
    GSL_LIBS = -lgsl -lgslcblas
    
    ##########################################################
    ## QWT - use local copy
    # http://qwt.sourceforge.net/index.html
    ##########################################################
    
    # include path.
    QWT_INCLUDEPATH = $$QTI_ROOT/3rdparty/qwt/src
    # link locally against a copy in 3rdparty/
    QWT_LIBS = $$QTI_ROOT/3rdparty/qwt/lib/libqwt.a
    
    ##########################################################
    ## QwtPlot3D - use local copy
    # http://qwtplot3d.sourceforge.net/
    ##########################################################
    
    # include path.
    QWT3D_INCLUDEPATH = $$QTI_ROOT/3rdparty/qwtplot3d/include
    # link locally against a copy in 3rdparty/
    QWT3D_LIBS = $$QTI_ROOT/3rdparty/qwtplot3d/lib/libqwtplot3d.a
    
    ##########################################################
    ## libpng - use system config
    ##########################################################
    
    LIBPNG_LIBS = -lpng
    
    ##########################################################
    ## QTeXEngine - use local config
    # http://soft.proindependent.com/qtexengine/
    ##########################################################
    
    # include path.
    TEX_ENGINE_INCLUDEPATH = $$QTI_ROOT/3rdparty/QTeXEngine/src
    # link locally against a copy in 3rdparty/
    TEX_ENGINE_LIBS = $$QTI_ROOT/3rdparty/QTeXEngine/libQTeXEngine.a
    
    ##########################################################
    ## ALGLIB (2.6) - use local config
    # http://www.alglib.net/
    ##########################################################
    
    # include path.
    ALGLIB_INCLUDEPATH = $$QTI_ROOT/3rdparty/cpp/src
    # link locally against a copy in 3rdparty/
    ALGLIB_LIBS = $$QTI_ROOT/3rdparty/cpp/out/libalglib.a
    
    ##########################################################
    ## TAMUANOVA - optional. you don't have to set these variables
    # http://www.stat.tamu.edu/~aredd/tamuanova/
    ##########################################################
    
    # include path.
    TAMUANOVA_INCLUDEPATH = $$QTI_ROOT/3rdparty/tamu_anova-0.2/
    # link locally against a copy in 3rdparty/
    TAMUANOVA_LIBS = $$QTI_ROOT/3rdparty/tamu_anova-0.2/libtamuanova.a
    
    ##########################################################
    ## python - system installation
    ##########################################################
    
    # the python interpreter to use
    PYTHON = python
    
    ##########################################################
    ## Qt tools - allows to use specific versions
    ##########################################################
    
    LUPDATE = lupdate
    LRELEASE = lrelease
    
    ############################################################
    ##  Target specific configuration: configure Qtiplot itself
    ############################################################
    
    contains( TARGET, qtiplot ) {
      # building without muParser doesn't work yet
      SCRIPTING_LANGS += muParser
      SCRIPTING_LANGS += Python
    
      # a console displaying output of scripts; particularly useful on Windows
      # where running QtiPlot from a terminal is inconvenient
      DEFINES         += SCRIPTING_CONSOLE
    
      # Uncomment the following line if you want to perform a custom installation using the *.path variables defined in ./qtiplot.pro.
      #CONFIG          += CustomInstall
    
      CONFIG          += release
      #CONFIG          += debug
    }
    
  • Now, after all that work you have to try to compile the software (this may take some time if you have a slow computer). First, run the following from the ./qtiplot-0.9.8.9/ folder:

    qmake qtiplot.pro
    make
    
    • Note: you can speed up the compilation process by using the -j option and providing a number of parallel processors to use. You can also use the -s option to reduce some of the output of the make command. The command that I use is make -j 4 -s
  • If everything goes according to plan, after some time you should have an executable file named qtiplot in the ./qtiplot-0.9.8.9/qtiplot/ folder. You can test it out by running the following commands:

    cd qtiplot
    ./qtiplot
    
  • You should now hopefully be running version 0.9.8.9 of qtiplot. Congratulations! Configuration options can be modified in the program, and the settings file (if you need to back it up) is located at $HOME/.config/ProIndependent/QtiPlot.conf

  • The default source packages do not come with a suitable Makefile for running sudo make install like you normally would to install the program. At this point, I would either create a link to the executable on your path, or continue and try to edit the Makefile. Since this is something I didn’t have time to do, I just did the first option, as it works for me.

Let me know how this works out for you in the comments, or if you have any questions.

Avatar
Joshua Taillon
Materials Data Scientist

A materials research scientist at NIST interested in scientific data curation, AI for materials research, and baking bread.

comments powered by Disqus
Next