[PYTHON] Fehler beim Kompilieren des mmh3-Moduls in CircleCI

Beim Kompilieren des mmh3-Moduls ist ein Fehler aufgetreten, also ein Memorandum, bis es behoben wurde.

  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

Es stoppt mit einem Fehler, da es zur Kompilierungszeit die Option "-Werror = Deklaration nach Anweisung" hat. Ich möchte mich nicht mit dem Quellcode der Bibliothek anlegen, und obwohl es ein bisschen gewaltsam ist, habe ich CFLAGS überschrieben und gelöst.

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

Referenz

Recommended Posts

Fehler beim Kompilieren des mmh3-Moduls in CircleCI
Legen Sie sitecustomize.py in CircleCI fest.
Hinweise zum SQLite3-Modul von Python
Installieren Sie das Modul auf Anaconda (Mac)
Fehler bei der Installation von opencv-python auf jetson nano (ModuleNotFoundError: Kein Modul namens'skbuild ')