Why does my Mac (OS X 10.7.3) have an old version (2.3) of Gnu Bison?

前端 未结 7 771
孤街浪徒
孤街浪徒 2021-02-14 03:15

The version of GNU Bison on my mac is 2.3 but I know that Bison 2.5 was released long ago. The book Flex & Bison uses version 2.5.

Should I upgrade to 2.5 m

7条回答
  •  情深已故
    2021-02-14 04:13

    Because bison was been installed,the default version on osx is 2.3. So we should do something as follow:

    1. Install a higher version os bison

      If you use Brew, try to use this command--brew install bison, it will install bison 3.0.2. The binary package is under /usr/local/Cellar/bison/3.0.4/bin/ in my computer.

      Or you can install bison through source code, follow instructions on offical website http://www.gnu.org/software/bison/.

    2. Replace the old one(you need sudo or root permission)

      $ which bison --- find the installed path,in my computer it's /usr/bin/bison

      $ cd /usr/bin

      $ sudo mv bison bison.2.3

      $ sudo cp /usr/local/Cellar/bison/3.0.4/bin/bison bison

    Then you can install thrift without this problem.

提交回复
热议问题