不在windows下,再加上不想用盗版,所以需要一个origin的替代品——qtiplot。虽然我非常抵抗用这种不停点来点去的软件,用R的ggplot2画图多好啊,高效、优雅、漂亮,但是终抵不过老板一句“这个图你用origin画”。

有公司编译出了qtiplot的deb包,但是缺少一些功能,比如不能导出数据,这太坑爹了!好吧,我只有自己来编译。哪儿知道它有太多的依赖,并且头文件包含还不能紧跟时代。 解压源代码后复制build.conf.example为build.conf,然后在里面把库的链接改成系统内的目录,不要用它那个3rdparty的目录。然后就是qmake产生Makefile,接着一边make一边看出现什么错误提示,比如找不到头文件啊,这一般是因为某些依赖的包没有安装,使用Ubuntu的包内容搜索功能找到包含这个头文件的包,然后apt-get安装上。

注意:安装好包过后还是提示找不到头文件,就是文件包含位置不对,要么手动更改源代码将头文件位置改对,要么在build.conf里面添加一个包含目录。

唯一需要修改源代码的地方就是在./3rdparty/qwtplot3d/include/qwt3d_openglhelper.h中包含#include <GL/glu.h>

对python脚本的支持实在是弄不好了,需要sip和pyqt来生成一个头文件sipAPIqti.h,这一步我没有成功。

应该是需要下面这些包依赖:

  1. sudo apt-get install libqt4-opengl-dev libmuparser-dev libtamuanova-dev libalglib-dev libqtassistantclient-dev libqtexengine-dev python-dev

那个手册没有编译安装,为了装它得下个latex,太不值了,所以在生成makefile后直接把手册的那部分全部删掉。

最后,关于qtiplot的文件关联问题。在Ubuntu 12.04下,如果右键选取一个新的应用程序来打开该文件,必须要求该mime类型在/usr/share/applications/下有一个对应的desktop文件,同时,该desktop文件中Exec=一栏中命令后面需要带有参数%f以用来表示此程序后面可以跟文件名。同时,在/usr/share/mime/application/目录下会有一个xml文件标示该mime类型。

下面直接把我的build.conf传上来。

  1. isEmpty( QTI_ROOT ) {
  2. message( "each file including this config needs to set QTI_ROOT to the dir containing this file!" )
  3. }
  4. ##########################################################
  5. ## System specific configuration
  6. ##########################################################
  7. # Global include path which is always added at the end of the INCLUDEPATH
  8. SYS_INCLUDEPATH = /opt/local/include /usr/include/python2.7 /usr/include/muParser /usr/include/tamu_anova /usr/include/qt4/QtAssistant
  9. # Global lib path and libs which is ls always added at the end of LIBS
  10. SYS_LIBS = -L/opt/local/lib -lGLU
  11. ##########################################################
  12. ## zlib (http://www.zlib.net/)
  13. ##########################################################
  14. # include path. leave it blank to use SYS_INCLUDE
  15. ZLIB_INCLUDEPATH = $QTI_ROOT/3rdparty/zlib/
  16. ##########################################################
  17. ## muParser (http://muparser.sourceforge.net/)
  18. ##########################################################
  19. # include path. leave it blank to use SYS_INCLUDE
  20. MUPARSER_INCLUDEPATH = $QTI_ROOT/3rdparty/muparser/include
  21. # link statically against a copy in 3rdparty/
  22. #MUPARSER_LIBS = $QTI_ROOT/3rdparty/muparser/lib/libmuparser.a
  23. # or dynamically against a system-wide installation
  24. MUPARSER_LIBS = -lmuparser
  25. ##########################################################
  26. ## GNU Sientific Library (http://www.gnu.org/software/gsl/)
  27. ##########################################################
  28. # include path. leave it blank to use SYS_INCLUDE
  29. #GSL_INCLUDEPATH = $QTI_ROOT/3rdparty/gsl/include
  30. GSL_INCLUDEPATH =
  31. # link statically against a copy in 3rdparty/
  32. #GSL_LIBS = $QTI_ROOT/3rdparty/gsl/lib/libgsl.a \
  33. $QTI_ROOT/3rdparty/gsl/lib/libgslcblas.a
  34. # or dynamically against a system-wide installation
  35. GSL_LIBS = -lgsl -lgslcblas
  36. ##########################################################
  37. ## QWT - use local copy till upstream catches up
  38. # http://qwt.sourceforge.net/index.html
  39. ##########################################################
  40. # include path.
  41. QWT_INCLUDEPATH = $QTI_ROOT/3rdparty/qwt/src
  42. # link locally against a copy in 3rdparty/
  43. QWT_LIBS = $QTI_ROOT/3rdparty/qwt/lib/libqwt.a
  44. ##########################################################
  45. ## QwtPlot3D - use local copy till upstream catches up
  46. # http://qwtplot3d.sourceforge.net/
  47. ##########################################################
  48. # include path.
  49. QWT3D_INCLUDEPATH = $QTI_ROOT/3rdparty/qwtplot3d/include
  50. # link locally against a copy in 3rdparty/
  51. win32:QWT3D_LIBS = $QTI_ROOT/3rdparty/qwtplot3d/lib/qwtplot3d.dll
  52. unix:QWT3D_LIBS = $QTI_ROOT/3rdparty/qwtplot3d/lib/libqwtplot3d.a
  53. ##########################################################
  54. ## libpng - optional. you don't have to set these variables
  55. ##########################################################
  56. # include path. leave it blank to use SYS_INCLUDE
  57. LIBPNG_INCLUDEPATH = $QTI_ROOT/3rdparty/libpng/
  58. # link statically against a copy in 3rdparty/
  59. #LIBPNG_LIBS = $QTI_ROOT/3rdparty/libpng/libpng.a
  60. # or dynamically against a system-wide installation
  61. LIBPNG_LIBS = -lpng
  62. ##########################################################
  63. ## QTeXEngine - optional. you don't have to set these variables
  64. # http://soft.proindependent.com/qtexengine/
  65. ##########################################################
  66. # include path.
  67. TEX_ENGINE_INCLUDEPATH = $QTI_ROOT/3rdparty/QTeXEngine/src
  68. # link locally against a copy in 3rdparty/
  69. TEX_ENGINE_LIBS = $QTI_ROOT/3rdparty/QTeXEngine/libQTeXEngine.a
  70. ##########################################################
  71. ## ALGLIB (2.6) - optional. you don't have to set these variables
  72. # http://www.alglib.net/
  73. ##########################################################
  74. # include path.
  75. ALGLIB_INCLUDEPATH = $QTI_ROOT/3rdparty/alglib/
  76. # link locally against a copy in 3rdparty/
  77. ALGLIB_LIBS = /usr/lib/libalglib.a
  78. ##########################################################
  79. ## TAMUANOVA - optional. you don't have to set these variables
  80. # http://www.stat.tamu.edu/~aredd/tamuanova/
  81. ##########################################################
  82. # include path.
  83. TAMUANOVA_INCLUDEPATH = $QTI_ROOT/3rdparty/tamu_anova/
  84. # link locally against a copy in 3rdparty/
  85. TAMUANOVA_LIBS = /usr/lib/libtamuanova.a
  86. ##########################################################
  87. ## python - only used if python is needed
  88. ##########################################################
  89. # the python interpreter to use
  90. # (unix only, windows will use what ever is configured to execute .py files!)
  91. PYTHON = python
  92. ##########################################################
  93. ## Qt tools - allows to use specific versions
  94. ##########################################################
  95. LUPDATE = lupdate
  96. LRELEASE = lrelease
  97. ############################################################
  98. ## Target specific configuration: configure Qtiplot itself
  99. ############################################################
  100. contains( TARGET, qtiplot ) {
  101. # building without muParser doesn't work yet
  102. SCRIPTING_LANGS += muParser
  103. #SCRIPTING_LANGS += Python
  104. # a console displaying output of scripts; particularly useful on Windows
  105. # where running QtiPlot from a terminal is inconvenient
  106. DEFINES += SCRIPTING_CONSOLE
  107. #DEFINES += QTIPLOT_DEMO
  108. # Uncomment the following line if you want to perform a custom installation using the *.path variables defined in ./qtiplot.pro.
  109. #CONFIG += CustomInstall
  110. # Uncomment the following line if you want to build QtiPlot as a browser plugin (not working on Internet Explorer).
  111. #CONFIG += BrowserPlugin
  112. CONFIG += release
  113. #CONFIG += debug
  114. # Uncomment the following line if you want to link statically against Qt.
  115. #CONFIG += StaticBuild
  116. #win32: CONFIG += console
  117. }

 http://blog.uorz.me/2013/07/11/%E5%9C%A8Ubuntu-12.04%E4%B8%8B%E7%BC%96%E8%AF%91qtiplot.html

在Ubuntu 12.04下编译qtiplot的更多相关文章

  1. ubuntu 12.04下编译安装nginx-1.9.3

    1,下载nginx-1.9.3.tar.gz 两种方式: (1).ubuntu 下终端中(ctrl+alt+t) 运行命令: wget http://nginx.org/download/nginx- ...

  2. 在Ubuntu 12.04下采用apt-get的方法安装Qt4

    在Ubuntu 12.04下采用apt-get的方法安装Qt4 注:之前发表的一篇博客是采用编译源码的方式安装Qt4,这是很有用的方式,因为源码安装对于所有系统都是通用的,其次,在使用交叉编译器的时候 ...

  3. Angularjs学习---angularjs环境搭建,ubuntu 12.04下安装nodejs、npm和karma

    1.下载angularjs 进入其官网下载:https://angularjs.org/‎,建议下载最新版的:https://ajax.googleapis.com/ajax/libs/angular ...

  4. 升级Ubuntu 12.04下的gcc到4.7

    我们知道C++11标准开始支持类内初始化(in-class initializer),Qt creator编译出现error,不支持这个特性,原因在于,Ubuntu12.04默认的是使用gcc4.6, ...

  5. Ubuntu 16.04下编译安装Apache2.4和PHP7结合

    Ubuntu 16.04下编译安装Apache2.4和PHP7结合,并安装PDOmysql扩展. 1.编译安装apache2.4.20 1 第一步: ./configure --prefix=/usr ...

  6. Ubuntu 12.04下GAMIT10.40安装说明

    转载于:http://www.itxuexiwang.com/a/liunxjishu/2016/0225/164.html?1456481297 Ubuntu 12.04下GAMIT10.40安装步 ...

  7. [转]ubuntu(12.04)下, 命令 ,内核 源代码的获取

    [转]ubuntu(12.04)下, 命令 ,内核 源代码的获取 http://blog.chinaunix.net/uid-18905703-id-3446099.html 1.命令:例如:要查看l ...

  8. Ubuntu 12.04 下安装 Eclipse

    方法一:(缺点是安装时附加openjdk等大量程序并无法去除,优点是安装简单) $ sudo apt-get install eclipse 方法二:(优点是安装内容清爽,缺点是配置麻烦)1.安装JD ...

  9. 在Ubuntu 12.04下创建eclipse的桌面链接

    在Ubuntu 12.04下创建eclipse的桌面链接 作者:凯鲁嘎吉 - 博客园 http://www.cnblogs.com/kailugaji/ 在Ubuntu 12.04上安装Hadoop并 ...

随机推荐

  1. 微软阵营稳定的好消息:.NET开源、Visual Studio 自由

    今天各个IT社区,头版头条说的是微软.NET开源了.宇宙中最好的IED–Visual Studio Community 2013将免费提供给用户的消息. <宇宙中最强大的开发环境免费了! > ...

  2. JSP TAG

    Jsp tag 能够灵活的将公共JSP代码模块化,类似<jsp:include page="./include.jsp"></jsp:include>等等. ...

  3. CodeForces 525C Ilya and Sticks 贪心

    题目:click here #include <iostream> #include <cstdio> #include <cstring> #include &l ...

  4. Android学习笔记:多个AsyncTask实例的并发问题

    AsyncTask是Android给开发者提供的一个简单轻量级的多线程类,通过它我们可以很容易新建一个线程让在后台做一些耗时的操作(如IO操作.网络访问等),并在这个过程中更新UI.之所以说它轻量级, ...

  5. php前端控制器设计1

    The primary role of a front controller in web-based applications is to encapsulate the typical reque ...

  6. SpringMVC入门二: 1规范结构, 2简单整合MyBatis

    昨天拿springMVC写的helloworld结构不好, 这次先调整一下体系结构 , 然后简单整合一下MyBatis spring的配置还是以注解为主, 不过MyBatis的映射文件什么的还是拿xm ...

  7. Linux远程桌面工具 -- NoMachine

    玩Linux系统,会经常用到远程桌面软件. 我一直用的2个是Xmanager 和 VNC. 今天看到一个新软件: NoMachine. NoMachine NX 是一个快速的终端服务器和虚拟桌面软件, ...

  8. 解决TCP网络传输“粘包”问题

    当前在网络传输应用中,广泛采用的是TCP/IP通信协议及其标准的socket应用开发编程接口(API).TCP/IP传输层有两个并列的协议:TCP和UDP.其中TCP(transport contro ...

  9. Java 实现享元(Flyweight)模式

    /** * 字母 * @author stone * */ public class Letter { private String name; public Letter(String name) ...

  10. surfaceView画图

    1.视图 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:too ...