Erreur lors de la compilation du module mmh3 dans CircleCI

J'ai eu une erreur lorsque j'ai compilé le module mmh3, donc un mémorandum jusqu'à ce qu'il soit résolu.

  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

Il s'arrête avec une erreur car il a l'option -Werror = declaration-after-statement au moment de la compilation. Je ne veux pas jouer avec le code source de la bibliothèque, et bien que ce soit un peu forcé, j'ai écrasé CFLAGS et l'ai résolu.

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

référence

Recommended Posts

Erreur lors de la compilation du module mmh3 dans CircleCI
Définissez sitecustomize.py dans CircleCI.
Notes sur le module sqlite3 de python
Installer le module sur Anaconda (Mac)
Erreur lors de l'installation d'opencv-python sur jetson nano (ModuleNotFoundError: aucun module nommé'skbuild ')