我知道类似的问题已经出现过。我尝试了所有我听说过的调试技术。我已确保从以下来源下载了 Qt4 的所有依赖项http://wiki.octave.org/Octave_for_Debian_systems。我尝试使用 pkg-config 找到 QtGui cflags 和库,并手动将它们添加到 ./configure 命令中。我甚至尝试将 qt cflags/libs 添加到 makefile 中。目前,我正在使用以下配置:
./configure --enable-shared --disable-static --enable-jit --prefix=/opt/octave4.0
我的输出尾部是:
Qt CPPFLAGS:
Qt LDFLAGS:
Qt libraries:
READLINE libraries: -lreadline
Sndfile CPPFLAGS:
Sndfile LDFLAGS:
Sndfile libraries: -lsndfile
TERM libraries: -lncurses
UMFPACK CPPFLAGS:
UMFPACK LDFLAGS:
UMFPACK libraries: -lumfpack
X11 include flags:
X11 libraries: -lX11
Z CPPFLAGS:
Z LDFLAGS:
Z libraries: -lz
Default pager: less
gnuplot: gnuplot
Build Octave GUI: no
JIT compiler for loops: yes
Build Java interface: yes
Do internal array bounds checking: no
Build static libraries: no
Build shared libraries: yes
Dynamic Linking: yes (dlopen)
Include support for GNU readline: yes
64-bit array dims and indexing: no
OpenMP SMP multithreading: yes
Build cross tools: no
configure: WARNING: Qt libraries not found -- disabling GUI
configure:
configure: NOTE: Libraries or auxiliary programs may be skipped if they are
configure: NOTE: not found OR if they are missing required features on your
configure: NOTE: system.
我正式陷入困境了......
答案1
不明显的是(或者使用 INSTALL.OCTAVE 建议的 apt-get builddep octave 安装)Octave 需要 qt4,我首先尝试安装 qt5 dev 包。
我做了以下事情让它发挥作用:
sudo apt-get install libqt4-opengl-dev libqt4-private-dev libqt4pas-dev
但是阅读您链接到的页面让我相信您只需要(这包括我已经安装的软件包:
sudo apt-get install libqt4-dev libqtcore4 libqtwebkit4 libqt4-network libqtgui4 libqt4-opengl-dev
之后 ./configure 运行正常并检测到 qt。
底部列出的支持一切的命令似乎也能正确安装依赖项:
sudo apt-get install gcc g++ gfortran make libblas-dev liblapack-dev libpcre3-dev libarpack2-dev libcurl4-gnutls-dev epstool libfftw3-dev transfig libfltk1.3-dev libfontconfig1-dev libfreetype6-dev libgl2ps-dev libglpk-dev libreadline-dev gnuplot-x11 libgraphicsmagick++1-dev libhdf5-serial-dev openjdk-8-jdk libsndfile1-dev llvm-dev lpr texinfo libgl1-mesa-dev libosmesa6-dev pstoedit portaudio19-dev libqhull-dev libqrupdate-dev libqscintilla2-dev libqt4-dev libqtcore4 libqtwebkit4 libqt4-network libqtgui4 libqt4-opengl-dev libsuitesparse-dev texlive libxft-dev zlib1g-dev autoconf automake bison flex gperf gzip icoutils librsvg2-bin libtool perl rsync tar
但这可能会很容易地安装更多您真正需要的依赖项。
答案2
我不确定哪个版本使其可以工作(Qt4 或 Qt5)但尝试安装此命令输出返回的包:
apt-cache search libqt5 | grep -e 'network' -e 'core' -e 'gui' -e 'opengl'
在我的计算机上,结果如下:
libqt5core5a - Qt 5 core module
libqt5gui5 - Qt 5 GUI module
libqt5network5 - Qt 5 network module
libqt5opengl5 - Qt 5 OpenGL module
libqt5opengl5-dev - Qt 5 OpenGL library development files
您可以尝试类似的操作,在上面的命令中用 qt4 替换 qt5。
INSTALL.OCTAVE 中没有提到 opengl 包,我通过查看配置脚本找到了它,在以下行
QT_MODULES="QtCore QtGui QtNetwork QtOpenGL"
这就是它对我起作用的原因。