Help us understand the problem. What is going on with this article?

mecab-pythonをMacにインストールする

More than 5 years have passed since last update.

すんなり行かなかったのでメモしておく。

mecabはbrewでインストールすると楽だった。
(後述のmecab-pythonが上手くインストールできず、試行錯誤の過程でコンパイルして入れちゃったけど)

$ brew install mecab
$ brew install mecab-ipadic

こっからが本番。mecab-pythonのインストール。
普通にeasy_install https://mecab.googlecode.com/files/mecab-python-0.996.tar.gzとかやると、
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command '/usr/bin/gcc' failed with exit status 1
ってエラーが出てくる。

上手くいかなくていろいろ調べた結果、環境変数をセットすると上手くいった。

$ wget https://mecab.googlecode.com/files/mecab-python-0.996.tar.gz
$ tar zxfv mecab-python-0.996.tar.gz
$ cd mecab-python-0.996
$
$ export CFLAGS=-Qunused-arguments
$ export CPPFLAGS=-Qunused-arguments
$ python setup.py build
$ python setup.py install

おわり。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away