Sensirion / gas-index-algorithm

Sensirion's Gas Index Algorithm provides a VOC and NOx Index output signal calculated from the SGP40/41 raw signals
https://sensirion.github.io/gas-index-algorithm/
BSD 3-Clause "New" or "Revised" License
17 stars 11 forks source link

Install and/or compile fails on ARMv7 #15

Open NetForces opened 1 month ago

NetForces commented 1 month ago

I'm trying to use this package so first thing I tried was just a simple pip install, which failed with:

# pip install sensirion-gas-index-algorithm
Collecting sensirion-gas-index-algorithm
  Using cached sensirion-gas-index-algorithm-3.2.2.tar.gz (49 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: sensirion-gas-index-algorithm
  Building wheel for sensirion-gas-index-algorithm (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-3.10
      creating build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      copying sensirion_gas_index_algorithm/sensirion_gas_index_algorithm_wrap.py -> build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      copying sensirion_gas_index_algorithm/version.py -> build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      copying sensirion_gas_index_algorithm/gas_index_algorithm.py -> build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      copying sensirion_gas_index_algorithm/nox_algorithm.py -> build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      copying sensirion_gas_index_algorithm/voc_algorithm.py -> build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      copying sensirion_gas_index_algorithm/__init__.py -> build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      running build_ext
      building 'sensirion_gas_index_algorithm._sensirion_gas_index_algorithm_wrap' extension
      creating build/temp.linux-armv7l-3.10
      creating build/temp.linux-armv7l-3.10/swig
      arm-linux-gnueabihf-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iswig -I/usr/include/python3.10 -c swig/sensirion_gas_index_algorithm.c -o build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm.o
      arm-linux-gnueabihf-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iswig -I/usr/include/python3.10 -c swig/sensirion_gas_index_algorithm_wrap.c -o build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm_wrap.o
      arm-linux-gnueabihf-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm.o build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm_wrap.o -Lswig -o build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm/_sensirion_gas_index_algorithm_wrap.cpython-310-arm-linux-gnueabihf.so
      /usr/bin/ld: cannot find -lgcc: No such file or directory
      /usr/bin/ld: cannot find -lgcc: No such file or directory
      collect2: error: ld returned 1 exit status
      error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for sensirion-gas-index-algorithm
  Running setup.py clean for sensirion-gas-index-algorithm
Failed to build sensirion-gas-index-algorithm
Installing collected packages: sensirion-gas-index-algorithm
  Running setup.py install for sensirion-gas-index-algorithm ... error
  error: subprocess-exited-with-error

  × Running setup.py install for sensirion-gas-index-algorithm did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      running install
      /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-3.10
      creating build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      copying sensirion_gas_index_algorithm/sensirion_gas_index_algorithm_wrap.py -> build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      copying sensirion_gas_index_algorithm/version.py -> build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      copying sensirion_gas_index_algorithm/gas_index_algorithm.py -> build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      copying sensirion_gas_index_algorithm/nox_algorithm.py -> build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      copying sensirion_gas_index_algorithm/voc_algorithm.py -> build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      copying sensirion_gas_index_algorithm/__init__.py -> build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
      running build_ext
      building 'sensirion_gas_index_algorithm._sensirion_gas_index_algorithm_wrap' extension
      creating build/temp.linux-armv7l-3.10
      creating build/temp.linux-armv7l-3.10/swig
      arm-linux-gnueabihf-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iswig -I/usr/include/python3.10 -c swig/sensirion_gas_index_algorithm.c -o build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm.o
      arm-linux-gnueabihf-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iswig -I/usr/include/python3.10 -c swig/sensirion_gas_index_algorithm_wrap.c -o build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm_wrap.o
      arm-linux-gnueabihf-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm.o build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm_wrap.o -Lswig -o build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm/_sensirion_gas_index_algorithm_wrap.cpython-310-arm-linux-gnueabihf.so
      /usr/bin/ld: cannot find -lgcc: No such file or directory
      /usr/bin/ld: cannot find -lgcc: No such file or directory
      collect2: error: ld returned 1 exit status
      error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> sensirion-gas-index-algorithm

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I then tried to compile from source and got pretty must the same:

root@luckfox:~/gas-index-algorithm/python-wrapper# ./generate_swig_wrapper.sh
root@luckfox:~/gas-index-algorithm/python-wrapper# pip install -e.
Obtaining file:///root/gas-index-algorithm/python-wrapper
  Preparing metadata (setup.py) ... done
Installing collected packages: sensirion-gas-index-algorithm
  Running setup.py develop for sensirion-gas-index-algorithm
    error: subprocess-exited-with-error

    × python setup.py develop did not run successfully.
    │ exit code: 1
    ╰─> [27 lines of output]
        running develop
        /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
          warnings.warn(
        /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
          warnings.warn(
        running egg_info
        creating sensirion_gas_index_algorithm.egg-info
        writing sensirion_gas_index_algorithm.egg-info/PKG-INFO
        writing dependency_links to sensirion_gas_index_algorithm.egg-info/dependency_links.txt
        writing requirements to sensirion_gas_index_algorithm.egg-info/requires.txt
        writing top-level names to sensirion_gas_index_algorithm.egg-info/top_level.txt
        writing manifest file 'sensirion_gas_index_algorithm.egg-info/SOURCES.txt'
        reading manifest file 'sensirion_gas_index_algorithm.egg-info/SOURCES.txt'
        reading manifest template 'MANIFEST.in'
        adding license file 'LICENSE'
        writing manifest file 'sensirion_gas_index_algorithm.egg-info/SOURCES.txt'
        running build_ext
        building 'sensirion_gas_index_algorithm._sensirion_gas_index_algorithm_wrap' extension
        arm-linux-gnueabihf-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iswig -I/usr/include/python3.10 -c swig/sensirion_gas_index_algorithm.c -o build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm.o
        arm-linux-gnueabihf-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iswig -I/usr/include/python3.10 -c swig/sensirion_gas_index_algorithm_wrap.c -o build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm_wrap.o
        creating build/lib.linux-armv7l-3.10
        creating build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
        arm-linux-gnueabihf-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm.o build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm_wrap.o -Lswig -o build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm/_sensirion_gas_index_algorithm_wrap.cpython-310-arm-linux-gnueabihf.so
        /usr/bin/ld: cannot find -lgcc: No such file or directory
        /usr/bin/ld: cannot find -lgcc: No such file or directory
        collect2: error: ld returned 1 exit status
        error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [27 lines of output]
    running develop
    /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running egg_info
    creating sensirion_gas_index_algorithm.egg-info
    writing sensirion_gas_index_algorithm.egg-info/PKG-INFO
    writing dependency_links to sensirion_gas_index_algorithm.egg-info/dependency_links.txt
    writing requirements to sensirion_gas_index_algorithm.egg-info/requires.txt
    writing top-level names to sensirion_gas_index_algorithm.egg-info/top_level.txt
    writing manifest file 'sensirion_gas_index_algorithm.egg-info/SOURCES.txt'
    reading manifest file 'sensirion_gas_index_algorithm.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    adding license file 'LICENSE'
    writing manifest file 'sensirion_gas_index_algorithm.egg-info/SOURCES.txt'
    running build_ext
    building 'sensirion_gas_index_algorithm._sensirion_gas_index_algorithm_wrap' extension
    arm-linux-gnueabihf-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iswig -I/usr/include/python3.10 -c swig/sensirion_gas_index_algorithm.c -o build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm.o
    arm-linux-gnueabihf-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Iswig -I/usr/include/python3.10 -c swig/sensirion_gas_index_algorithm_wrap.c -o build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm_wrap.o
    creating build/lib.linux-armv7l-3.10
    creating build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm
    arm-linux-gnueabihf-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm.o build/temp.linux-armv7l-3.10/swig/sensirion_gas_index_algorithm_wrap.o -Lswig -o build/lib.linux-armv7l-3.10/sensirion_gas_index_algorithm/_sensirion_gas_index_algorithm_wrap.cpython-310-arm-linux-gnueabihf.so
    /usr/bin/ld: cannot find -lgcc: No such file or directory
    /usr/bin/ld: cannot find -lgcc: No such file or directory
    collect2: error: ld returned 1 exit status
    error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

Platform info:

Board is the LuckFox Pico Ultra based on the RockChip RV1106

CPU Info:

# cat /proc/cpuinfo 
processor   : 0
model name  : ARMv7 Processor rev 5 (v7l)
BogoMIPS    : 17.47
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xc07
CPU revision    : 5

Hardware    : Generic DT based system
Revision    : 0000
Serial      : redacted

OS:

Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:    22.04
Codename:   jammy

gcc:

# gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Kernel:

Linux luckfox 5.10.110 #4 Mon Jul 8 21:32:12 CST 2024 armv7l armv7l armv7l GNU/Linux
qfisch commented 1 month ago

Hello @NetForces

We unfortunately do not have this exact platform around. However, from the logs it seems to be an error linked to your setup and more specifically your linker. You should search online for this specific line:
/usr/bin/ld: cannot find -lgcc: No such file or directory There seem to be people with similar issues.

Cheers Q