Hi All,
I need to convert a PIL Image to RGB565 for my LCD but it's too slow in python. Since the Omega2+ I'm using has no floating point unit I'm also not able to install numpy that speeds this conversion up by 10x.
I wrote a little extension in C that is doing the conversion almost as fast as numpy. However my issue is that the setup.py I use can't be linked to the Mipsel gcc compiler.
setup.py:
from setuptools import setup, Extension
module = Extension("WallControllerUtils", sources = ["WallControllerUtils.c"])
setup(name="PackageName",
version = "1.0.0",
description="Utility Functions in C for Speed",
ext_modules = [module])
I'm building successfully on my PC with:
python3 setup.py build
I then added a setup.cfg with following line:
[build]
compiler = /home/thomas/Downloads/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin/mipsel-openwrt-linux-gcc-8.4.0
Following error ocus:
error: don't know how to compile C/C++ code on platform 'posix' with '/home/thomas/Downloads/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin/mipsel-openwrt-linux-gcc-8.4.0' compiler
I was able to follow the cross compile example and create a little hello world programm in c that runs on the omega. I'm not sure how to handle this Python C program though. Any help would be greatly appreciated.