mbientlab / PyWarble

MetaWear Python SDK - Linux / Windows - Wrapper for Warble C library
https://mbientlab.com
Other
6 stars 2 forks source link

pip install fails on aarch64 #6

Closed abferm closed 4 years ago

abferm commented 4 years ago

This line incorrectly identifies aarch64 machines as x86 resulting in failed pip installations. https://github.com/mbientlab/PyWarble/blob/607030061355e8802440b6dd856c02439cc660ff/setup.py#L15

root@6fae1cfdd167:/# uname -a
Linux 6fae1cfdd167 4.15.0-1045-aws #47-Ubuntu SMP Fri Aug 2 13:51:14 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux
root@6fae1cfdd167:/# pip install warble
Collecting warble
  Using cached https://files.pythonhosted.org/packages/5e/ac/56e3b66c494c367de6ac2a78524e67dc536b16352350e35565955a799464/warble-1.2.0.tar.gz
Building wheels for collected packages: warble
  Running setup.py bdist_wheel for warble ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-L0xP_3/warble/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpNQV4Dmpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  make: Entering directory '/tmp/pip-build-L0xP_3/warble/clibs/warble'
  mkdir -p build/arm/release/src/warble/cpp
  g++ -MMD -MP -MF "build/arm/release/src/warble/cpp/gattchar.d" -c -o build/arm/release/src/warble/cpp/gattchar.o -std=c++14 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -DWARBLE_DLL -DWARBLE_DLL_EXPORT -Isrc  -O3 -DAPI_BLEPP -Ideps/libblepp -marm src/warble/cpp/gattchar.cpp
  g++ -MMD -MP -MF "build/arm/release/src/warble/cpp/blepp_utils.d" -c -o build/arm/release/src/warble/cpp/blepp_utils.o -std=c++14 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -DWARBLE_DLL -DWARBLE_DLL_EXPORT -Isrc  -O3 -DAPI_BLEPP -Ideps/libblepp -marm src/warble/cpp/blepp_utils.cpp
  g++ -MMD -MP -MF "build/arm/release/src/warble/cpp/blepp_scanner.d" -c -o build/arm/release/src/warble/cpp/blepp_scanner.o -std=c++14 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -DWARBLE_DLL -DWARBLE_DLL_EXPORT -Isrc  -O3 -DAPI_BLEPP -Ideps/libblepp -marm src/warble/cpp/blepp_scanner.cpp
  g++ -MMD -MP -MF "build/arm/release/src/warble/cpp/win10_scanner.d" -c -o build/arm/release/src/warble/cpp/win10_scanner.o -std=c++14 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -DWARBLE_DLL -DWARBLE_DLL_EXPORT -Isrc  -O3 -DAPI_BLEPP -Ideps/libblepp -marm src/warble/cpp/win10_scanner.cpp
  g++ -MMD -MP -MF "build/arm/release/src/warble/cpp/gatt.d" -c -o build/arm/release/src/warble/cpp/gatt.o -std=c++14 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -DWARBLE_DLL -DWARBLE_DLL_EXPORT -Isrc  -O3 -DAPI_BLEPP -Ideps/libblepp -marm src/warble/cpp/gatt.cpp
  g++ -MMD -MP -MF "build/arm/release/src/warble/cpp/blepp_api.d" -c -o build/arm/release/src/warble/cpp/blepp_api.o -std=c++14 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -DWARBLE_DLL -DWARBLE_DLL_EXPORT -Isrc  -O3 -DAPI_BLEPP -Ideps/libblepp -marm src/warble/cpp/blepp_api.cpp
  g++ -MMD -MP -MF "build/arm/release/src/warble/cpp/lib.d" -c -o build/arm/release/src/warble/cpp/lib.o -std=c++14 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -DWARBLE_DLL -DWARBLE_DLL_EXPORT -Isrc  -O3 -DAPI_BLEPP -Ideps/libblepp -marm src/warble/cpp/lib.cpp
  g++ -MMD -MP -MF "build/arm/release/src/warble/cpp/scanner.d" -c -o build/arm/release/src/warble/cpp/scanner.o -std=c++14 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -DWARBLE_DLL -DWARBLE_DLL_EXPORT -Isrc  -O3 -DAPI_BLEPP -Ideps/libblepp -marm src/warble/cpp/scanner.cpp
  g++ -MMD -MP -MF "build/arm/release/src/warble/cpp/win10_api.d" -c -o build/arm/release/src/warble/cpp/win10_api.o -std=c++14 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -DWARBLE_DLL -DWARBLE_DLL_EXPORT -Isrc  -O3 -DAPI_BLEPP -Ideps/libblepp -marm src/warble/cpp/win10_api.cpp
  cd deps/libblepp; LDFLAGS=-marm ./configure
  checking for g++... g++
  checking whether the C++ compiler works... yes
  checking for C++ compiler default output file name... a.out
  checking for suffix of executables...
  checking whether we are cross compiling... no
  checking for suffix of object files... o
  checking whether we are using the GNU C++ compiler... yes
  checking whether g++ accepts -g... yes
  checking if compiler flag -Wall works... yes
  checking if compiler flag -Wextra works... yes
  checking if compiler flag -W works... yes
  checking if compiler flag -O3 works... yes
  checking if compiler flag -ggdb works... yes
  checking whether g++ supports C++14 features by default... yes
  checking for pkg-config... /usr/bin/pkg-config
  checking for sed... sed
  checking for pkg-config library dir... ${exec_prefix}/lib/pkgconfig
  checking how to run the C++ preprocessor... g++ -E
  checking for grep that handles long lines and -e... /bin/grep
  checking for egrep... /bin/grep -E
  checking for ANSI C header files... yes
  checking for sys/types.h... yes
  checking for sys/stat.h... yes
  checking for stdlib.h... yes
  checking for string.h... yes
  checking for memory.h... yes
  checking for strings.h... yes
  checking for inttypes.h... yes
  checking for stdint.h... yes
  checking for unistd.h... yes
  checking bluetooth/bluetooth.h usability... yes
  checking bluetooth/bluetooth.h presence... yes
  checking for bluetooth/bluetooth.h... yes
  checking for library containing hci_open_dev... -lbluetooth
  checking boost/optional.hpp usability... yes
  checking boost/optional.hpp presence... yes
  checking for boost/optional.hpp... yes
  checking if compiler flag -fPIC works... yes
  configure: creating ./config.status
  config.status: creating libblepp.pc
  config.status: creating Makefile
  make -C deps/libblepp -j
  make[1]: Entering directory '/tmp/pip-build-L0xP_3/warble/clibs/warble/deps/libblepp'
  g++ -o src/att.o -c src/att.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF src/att.d
  g++ -o src/uuid.o -c src/uuid.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF src/uuid.d
  g++ -o src/bledevice.o -c src/bledevice.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF src/bledevice.d
  g++ -o src/att_pdu.o -c src/att_pdu.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF src/att_pdu.d
  g++ -o src/pretty_printers.o -c src/pretty_printers.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF src/pretty_printers.d
  g++ -o src/blestatemachine.o -c src/blestatemachine.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF src/blestatemachine.d
  g++ -o src/float.o -c src/float.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF src/float.d
  g++ -o src/logging.o -c src/logging.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF src/logging.d
  g++ -o src/lescan.o -c src/lescan.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF src/lescan.d
  g++ -o examples/lescan.o -c examples/lescan.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF examples/lescan.d
  g++ -o examples/blelogger.o -c examples/blelogger.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF examples/blelogger.d
  g++ -o examples/bluetooth.o -c examples/bluetooth.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF examples/bluetooth.d
  g++ -o examples/lescan_simple.o -c examples/lescan_simple.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF examples/lescan_simple.d
  g++ -o examples/temperature.o -c examples/temperature.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF examples/temperature.d
  g++ -o examples/read_device_name.o -c examples/read_device_name.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF examples/read_device_name.d
  g++ -o examples/write.o -c examples/write.cc -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. -MMD -MP -MF examples/write.d
  src/att.cc: In function 'uint16_t BLEPP::enc_write_resp(uint8_t*, size_t)':
  src/att.cc:657:47: warning: unused parameter 'len' [-Wunused-parameter]
    uint16_t enc_write_resp(uint8_t *pdu, size_t len)
                                                 ^~~
  examples/bluetooth.cc: In function 'int main(int, char**)':
  examples/bluetooth.cc:266:9: warning: unused variable 'result' [-Wunused-variable]
       int result = select(gatt.socket() + 1, &read_set, &write_set, NULL, & tv);
           ^~~~~~
  g++ -shared -o libble++.so.0.5 src/att.o src/uuid.o src/bledevice.o src/att_pdu.o src/pretty_printers.o src/blestatemachine.o src/float.o src/logging.o src/lescan.o -marm -lbluetooth
  ar crvs libble++.a src/att.o src/uuid.o src/bledevice.o src/att_pdu.o src/pretty_printers.o src/blestatemachine.o src/float.o src/logging.o src/lescan.o
  g++ -g -O2 -Wall -Wextra -W -O3 -ggdb -fPIC -I. tests/test_scan.cc src/att.o src/uuid.o src/bledevice.o src/att_pdu.o src/pretty_printers.o src/blestatemachine.o src/float.o src/logging.o src/lescan.o -o tests/test_scan.test -I . -marm -lbluetooth  || {  echo "echo 'Compile error!' ; return 126" > tests/test_scan.test ; chmod +x tests/test_scan.test; }
  a - src/att.o
  a - src/uuid.o
  a - src/bledevice.o
  a - src/att_pdu.o
  a - src/pretty_printers.o
  a - src/blestatemachine.o
  a - src/float.o
  a - src/logging.o
  a - src/lescan.o
  ranlib libble++.a
  rm -f libble++.so.0
  ln -s libble++.so.0.5 libble++.so.0
  rm -f libble++.so
  ln -s libble++.so.0 libble++.so
  g++ -o examples/lescan examples/lescan.o  -L. -lble++
  g++ -o examples/blelogger examples/blelogger.o  -L. -lble++
  g++ -o examples/bluetooth examples/bluetooth.o  -L. -lble++
  g++ -o examples/lescan_simple examples/lescan_simple.o  -L. -lble++
  g++ -o examples/temperature examples/temperature.o  -L. -lble++
  g++ -o examples/read_device_name examples/read_device_name.o  -L. -lble++
  g++ -o examples/write examples/write.o  -L. -lble++
  tests/test_scan.test > tests/test_scan.result_ 2>&1 ; \
  a=$? ;\
  if [ $a != 0 ]; \
  then \
     if [ $a -ge 128 ] ; \
     then \
         echo Crash!! > tests/test_scan.result_ ; \
     elif [ $a -ne 126 ] ;\
     then \
         echo Failed > tests/test_scan.result_ ; \
     fi;\
  else\
      echo OK >> tests/test_scan.result_;\
  fi
  echo test_scan: `tail -1 tests/test_scan.result_` > tests/test_scan.result
  cat tests/test_scan.result > tests/results
  -------------- Test Results ---------------
  test_scan: OK
  -------------------------------------------
  make[1]: Leaving directory '/tmp/pip-build-L0xP_3/warble/clibs/warble/deps/libblepp'
  mkdir -p dist/release/lib/arm
  g++ -o dist/release/lib/arm/libwarble.so.1.1.5 -s -shared -Wl,--soname,libwarble.so.1 -marm build/arm/release/src/warble/cpp/gattchar.o build/arm/release/src/warble/cpp/blepp_utils.o build/arm/release/src/warble/cpp/blepp_scanner.o build/arm/release/src/warble/cpp/win10_scanner.o build/arm/release/src/warble/cpp/gatt.o build/arm/release/src/warble/cpp/blepp_api.o build/arm/release/src/warble/cpp/lib.o build/arm/release/src/warble/cpp/scanner.o build/arm/release/src/warble/cpp/win10_api.o deps/libblepp/libble++.a -lbluetooth -lpthread
  ln -sf libwarble.so.1.1.5 dist/release/lib/arm/libwarble.so.1
  ln -sf libwarble.so.1 dist/release/lib/arm/libwarble.so
  make: Leaving directory '/tmp/pip-build-L0xP_3/warble/clibs/warble'
  error: [Errno 2] No such file or directory: '/tmp/pip-build-L0xP_3/warble/clibs/warble/dist/release/lib/x86'

  ----------------------------------------
  Failed building wheel for warble
  Running setup.py clean for warble
Failed to build warble
Installing collected packages: warble
  Running setup.py install for warble ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-L0xP_3/warble/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-kjDa4g-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    make: Entering directory '/tmp/pip-build-L0xP_3/warble/clibs/warble'
    make: Nothing to be done for 'build'.
    make: Leaving directory '/tmp/pip-build-L0xP_3/warble/clibs/warble'
    error: [Errno 2] No such file or directory: '/tmp/pip-build-L0xP_3/warble/clibs/warble/dist/release/lib/x86'

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-L0xP_3/warble/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-kjDa4g-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-L0xP_3/warble/