安装Gnuplot时使用命令"brew install gnuplot --with-qt --with-x11"无法工作

8
我今天尝试使用Homebrew在Mac(Mojave 10.14.2)上安装gnuplot,但是它不接受--with-qt和--with-x11选项(我尝试了其他变体,如--with-qt5和--with-x,但都没有成功)。brew options gnuplot没有报告任何选项。现在我们该如何安装gnuplot的qt和x11终端?
5个回答

6

我联系了最近修改gnuplot配方的brew维护者。Brew不再允许在配方中使用选项,因此"brew install gnuplot --with-x11"不能再执行,但是"brew install gnuplot"会安装qt终端和cairo包中有用的终端,但不会安装x11终端。我在几个小时内捕捉到了配方出错的情况。现在它已经可以正常工作,但没有办法安装x11终端。(如果有人愿意维护该配方,这可能是值得的)。


2
在Mojave上,gnuplot的默认brew安装是有问题的。解决这个问题的最好方法是安装一个带有可用公式的自定义“tap”,如此处所述:https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap 如果您只想快速解决问题:以下手动重新编译所需选项即可正常工作。这是我在安装gnuplot时brew报告给我的内容:
$ brew reinstall gnuplot
==> Reinstalling gnuplot 
==> Downloading https://downloads.sourceforge.net/project/gnuplot/gnuplot/5.2.7/gnuplot-5.2.7.tar.gz
==> Downloading from https://versaweb.dl.sourceforge.net/project/gnuplot/gnuplot/5.2.7/gnuplot-5.2.7.tar.gz
######################################################################## 100.0%
==> ./configure --disable-silent-rules --prefix=~/brew/Cellar/gnuplot/5.2.7_1 --with-readline=~/brew/opt/readline --without-tutorial --disable-wxwidgets --with-qt --without-x
==> make
==> make install
  ~/brew/Cellar/gnuplot/5.2.7_1: 48 files, 2.9MB, built in 1 minute 47 seconds

卸载gnuplot,下载包,按照您的喜好进行配置,并手动重新安装到brew位置:

brew uninstall gnuplot

### Downloading sources
mkdir ~/src
cd ~/src
wget https://downloads.sourceforge.net/project/gnuplot/gnuplot/5.2.7/gnuplot-5.2.7.tar.gz
tar zxvf gnuplot-5.2.7.tar.gz
cd gnuplot-5.2.7

### Configuring with x11
./configure --disable-silent-rules --prefix=~/brew/Cellar/gnuplot/5.2.7_1 --with-readline=~/brew/opt/readline --without-tutorial --with-cairo --with-qt --with-x

### Uninstall gnuplot from brew and install the substitute
make -j
make install      # installs to the same location where brew would
brew link gnuplot

1

1

我不知道官方的说法/故事/解释,只是通过实验得出了以下结论。如果有人知道更好的方法,请告诉我,我会删除这个。

我刚刚运行了brew info gnuplotX11Qt选项都存在。然后我运行了brew update,它们确实消失了。我注意到brew info gnuplot现在显示Qt“必需”

所以,我用brew rm gnuplot移除了gnuplot,然后再次使用brew install gnuplot安装它,并安装了所需但迄今缺失的依赖项Qt

如果我现在执行:

export GNUTERM=qt
gnuplot

它报告:
Terminal type is now 'qt'

以下代码会弹出一个Qt窗口:
gnuplot> plot sin(x)

enter image description here


0

经过多次尝试,我唯一的方法是删除gnuplot并使用homebrew重新安装。但是,如果我执行brew install gnuplot,会出现错误提示说/usr/local不可写,并且我无法更改/usr/local的权限。所以我使用了这里的方法here

因此,对我有效的顺序是:

  1. 使用相应的方法卸载gnuplot。

  2. 使用以下命令卸载homebrew:

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

  3. 重新安装homebrew:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

  4. 使用以下命令安装gnuplot:

    brew install gnuplot


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接