Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 如何在mac OSX上安装bison_Macos_Bison_Thrift - Fatal编程技术网

Macos 如何在mac OSX上安装bison

Macos 如何在mac OSX上安装bison,macos,bison,thrift,Macos,Bison,Thrift,我正试图在我的macbook上安装Thrift。 否则我会出错: 配置:错误:系统上必须安装Bison 2.5或更高版本 所以我试着在我的操作系统上安装Bison,但在互联网上找不到教程。 有谁能告诉我如何在我的系统上安装Bison吗 亲切问候为了节省大量时间,请使用或。这些将为您安装所有相关软件包 我使用Macports,安装后非常简单: $ sudo port install thrift 在你的咖啡准备好之前,它就会完成。请参阅。您可以使用brew安装: brew安装bison 然后在

我正试图在我的macbook上安装Thrift。 否则我会出错:

配置:错误:系统上必须安装Bison 2.5或更高版本

所以我试着在我的操作系统上安装Bison,但在互联网上找不到教程。 有谁能告诉我如何在我的系统上安装Bison吗


亲切问候

为了节省大量时间,请使用或。这些将为您安装所有相关软件包

我使用Macports,安装后非常简单:

$ sudo port install thrift
在你的咖啡准备好之前,它就会完成。

请参阅。您可以使用brew安装:

brew安装bison
然后在
中首先更新脚本或shell配置以使用brew的bison 您的路径:

export PATH=“$(brew--前缀bison)/bin:$PATH”

export PATH=“/usr/local/opt/bison/bin:$PATH”

重命名目录下的默认野牛: “/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xctoolschain/usr/bin$”

通过自制安装最新版本的bison:

brew install bison
连接野牛:

brew link bison --force 
如果需要取消野牛的链接并从xcode重命名野牛。
最好的祝愿~~

我在
brew安装bison
之后收到警告,并且在尝试
brew链接bison时--force

bison is keg-only, which means it was not symlinked into /usr/local,
because some formulae require a newer version of bison.

If you need to have bison first in your PATH run:
  echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.bash_profile

For compilers to find bison you may need to set:
  export LDFLAGS="-L/usr/local/opt/bison/lib"
因此,我建议您添加上述两个标志,而不是强制链接
/usr/local

因此,首先,您需要以下三个步骤:

brew install bison
echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/bison/lib"

我需要设置导出路径=“/usr/local/opt/bison/bin:$PATH”
brew install bison
在/usr/local/cillar安装bison新版本,但$path中未设置此路径

我在终端上写了“sudo port install thrift”,但出现了一个错误“error:port thrift not found we Can's find a solution?”善意的问候。@bonzaitek该端口很奇怪。您是否遵循了所有Macports安装步骤(即,
sudo端口自我更新
)?哦。。。不,我没有,我所做的唯一处理是从源代码处安装,如“$curl-O$tar xf MacPorts-2.3.3.tar.bz2$cd MacPorts-2.3.3/”。您认为,此链接教程对其余安装是否正确?种类Regard只有在运行El Capitan时才需要这样安装,因为它不受官方支持。如果您运行的是非测试版OSX,那么就可以使用二进制安装程序。@NeeleshSalian是的,我在回答中提到了自制软件。什么时候需要取消bison的链接?我肯定会忘记。为什么我们需要链接和取消链接?链接后,我们应该在什么时候再次取消链接?Brew不再允许强制链接系统提供的软件包。当脚本中需要brew的bison时,请使用
export PATH=“$(brew--前缀bison)/bin:$PATH”
。我更新了此答案以反映我之前的评论。感谢您的建议。我在macOS 10.15.2上也遇到了同样的问题,请不要忘记执行“source~/.bash_profile”以使其按预期工作。Brew不再允许强制链接系统提供的软件包。默认值
bison
不应重命名。当脚本中需要brew的bison时,请使用
export PATH=“$(brew--前缀bison)/bin:$PATH”