pyA13 with python 3?

Started by Fluxxy, March 10, 2016, 08:32:04 PM

Previous topic - Next topic

Fluxxy

Hi,

I will use python3 with my A13.
When I use pip install pyA13 everything works fine.

I get these output when i use pip3 install pyA13:


Collecting pyA13
  Using cached pyA13-0.2.2.tar.gz
Building wheels for collected packages: pyA13
  Running setup.py bdist_wheel for pyA13 ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b4b9khyo/pyA13/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp3l_uol2fpip-wheel- --python-tag cp35:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
 
  error: invalid command 'bdist_wheel'
 
  ----------------------------------------
  Failed building wheel for pyA13
  Running setup.py clean for pyA13
Failed to build pyA13
Installing collected packages: pyA13
  Running setup.py install for pyA13 ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b4b9khyo/pyA13/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hgi17sgy-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-3.5
    creating build/lib.linux-armv7l-3.5/pyA13
    copying pyA13/__init__.py -> build/lib.linux-armv7l-3.5/pyA13
    creating build/lib.linux-armv7l-3.5/pyA13/gpio
    copying pyA13/gpio/__init__.py -> build/lib.linux-armv7l-3.5/pyA13/gpio
    running build_ext
    Detected processor:  sun5i (Probably Allwinner A13)
    building 'pyA13.gpio.gpio' extension
    creating build/temp.linux-armv7l-3.5
    creating build/temp.linux-armv7l-3.5/pyA13
    creating build/temp.linux-armv7l-3.5/pyA13/gpio
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c pyA13/gpio/gpio_lib.c -o build/temp.linux-armv7l-3.5/pyA13/gpio/gpio_lib.o
    cc1: error: unrecognized command line option '-Wdate-time'
    cc1: error: unrecognized command line option '-fstack-protector-strong'
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
   
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-b4b9khyo/pyA13/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hgi17sgy-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-b4b9khyo/pyA13/


Did anyone solve that problem to use pyA13 in pyhton3?

Thanks

Gerrit

#1
pip install wheel

find -fstack-protector-strong and replace it with -fstack-protector

I don't know where the option -Wdate-time comes from can't find any reference to it, best remove it

Fluxxy

Hi Gerrit,

it works!  :D

1. pip3 install wheel
2. find -fstack-protector-strong and -Wdate-time in
/usr/lib/python3.5/plat-arm-linux-gnueabihf/_sysconfigdata_m.py
and comment out and change these lines:


# 'CONFIGURE_CFLAGS': '-g -fstack-protector-strong -Wformat '
'CONFIGURE_CFLAGS': '-g -fstack-protector -Wformat '
                     '-Werror=format-security',
'CONFIGURE_CFLAGS_NODIST': '-Werror=declaration-after-statement',
# 'CONFIGURE_CPPFLAGS': '-Wdate-time -D_FORTIFY_SOURCE=2',
'CONFIGURE_CPPFLAGS': ' -D_FORTIFY_SOURCE=2',


And python3 blink_led.py works fine  8)

Thanks Gerrit!