在 Centos 7 中编译 Octave 时出错

Error compiling Octave in Centos 7

这是我尝试在 Centos 7 中安装 Octave 4.2.1 的步骤列表(repo 版本是 3.8.2,现在已经很旧了)

1)   yum update
2)   yum-builddep -y octave
3)   yum -y install qt-devel mercurial gcc-c++ lapack-devel libtool
4)   yum -y install epstool transfig pstoedit qscintilla-devel 

(NOTE: First problem was right here as there is NO pstoedit in Centos 7, as far as I know)

5) sudo yum install bzip2-devel atlas-devel libsndfile-devel portaudio-devel GraphicsMagick-c++-devel
6)  ln -s /usr/lib64/atlas/libtatlas.so /usr/lib64/libatlas.so (One of the tutorials recommended doing this to fix a place where a library was being searched for or something like that. It seemed harmless enough)
7) wget ftp://ftp.gnu.org/gnu/octave/octave-4.2.1.tar.gz 
8) tar-xvf octave-4.2.1.tar.lz
9) cd octave-4.2.1
10) export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
11) ./configure --prefix=/usr/local/octave/versions/4.2.1
12)  make -j4

失败并出现此错误:

In file included from libgui/src/settings-dialog.cc:31:0:
libgui/src/ui-settings-dialog.h:13:29: fatal error: QtWidgets/QAction: No such file or directory
 #include <QtWidgets/QAction>

有没有人遇到过这个问题并有一些解决方法或解决方案?谢谢

QtWidgets/QAction 是 Qt5 特有的,似乎当你执行 yum-builddep -y octave 时它得到了 Qt4 的依赖。使用选项 --with-qt=4 配置八度。另一种选择是安装 qt5 库及其开发文件,配置 --with-qt=5,然后制作。

或者你可以直接使用 Flatpack 安装最新版本的 Octave,没有任何麻烦:

flatpak install flathub org.octave.Octave
flatpak run org.octave.Octave

CentOS 7 已经内置了 Flatpack 应用程序,但是您的发行版没有可以安装的应用程序:

sudo yum install flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

官网: https://flatpak.org/setup/