CircleCIでmmh3モジュールコンパイル時にエラー


mmh3モジュールをコンパイルしたらエラーが出たので解決までの備忘録。

```
  Running setup.py install for murmurhash3
    building 'mmh3' extension
    gcc -pthread -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/ubuntu/virtualenvs/venv-3.4.1/include -I/home/ubuntu/.pyenv/versions/3.4.1/include/python3.4m -c mmh3module.c -o build/temp.linux-x86_64-3.4/mmh3module.o -std=c99
    mmh3module.c: In function ‘mmh3_hash64’:
    mmh3module.c:63:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
    mmh3module.c: In function ‘mmh3_hash128’:
    mmh3module.c:90:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
    mmh3module.c: In function ‘mmh3_hash_bytes’:
    mmh3module.c:115:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
    mmh3module.c: In function ‘PyInit_mmh3’:
    mmh3module.c:184:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
    cc1: some warnings being treated as errors
    error: command 'gcc' failed with exit status 1
    Complete output from command /home/ubuntu/virtualenvs/venv-3.4.1/bin/python3.4 -c "import setuptools, tokenize;__file__='/home/ubuntu/virtualenvs/venv-3.4.1/build/murmurhash3/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-qrmqve3d-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/virtualenvs/venv-3.4.1/include/site/python3.4:
    running install

running build

running build_ext

building 'mmh3' extension

creating build

creating build/temp.linux-x86_64-3.4

gcc -pthread -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/ubuntu/virtualenvs/venv-3.4.1/include -I/home/ubuntu/.pyenv/versions/3.4.1/include/python3.4m -c mmh3module.c -o build/temp.linux-x86_64-3.4/mmh3module.o -std=c99

mmh3module.c: In function ‘mmh3_hash64’:

mmh3module.c:63:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

mmh3module.c: In function ‘mmh3_hash128’:

mmh3module.c:90:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

mmh3module.c: In function ‘mmh3_hash_bytes’:

mmh3module.c:115:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

mmh3module.c: In function ‘PyInit_mmh3’:

mmh3module.c:184:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]

cc1: some warnings being treated as errors

error: command 'gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /home/ubuntu/virtualenvs/venv-3.4.1/bin/python3.4 -c "import setuptools, tokenize;__file__='/home/ubuntu/virtualenvs/venv-3.4.1/build/murmurhash3/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-qrmqve3d-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/virtualenvs/venv-3.4.1/include/site/python3.4 failed with error code 1 in /home/ubuntu/virtualenvs/venv-3.4.1/build/murmurhash3
Storing debug log for failure in /home/ubuntu/.pip/pip.log
((pip install -r "requirements.txt")) returned exit code 1action pip install -r requirements.txt failed
```

コンパイル時に `-Werror=declaration-after-statement` オプションが付いているのでエラーで止まってしまう。ライブラリのソースコードもいじりたくないし、ちょっと強引だけどCFLAGSを上書きして解決した。

```yaml
machine:
  environment:
    CFLAGS: -Wno-error=declaration-after-statement
```


# 参考
* [Error compiling rpy2 on python3.4 due to -Werror=declaration-after-statement](http://stackoverflow.com/questions/25587039/error-compiling-rpy2-on-python3-4-due-to-werror-declaration-after-statement)