0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Posted at

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を上書きして解決した。

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

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?