OpenWrt Forum Archive

Topic: Installing pyaudio - mips-openwrt-linux-uclibc-gcc error crosscompile

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi, I want to put a microphone in a Chaos Calmer 15.05 through a usb sound card, to be able to measure noise levels.
I was thinking of using the python package soundmeter. But it depends on pyaudio, and when running the command "pip install pyaudio", it tries to compile the source file _portaudiomodule.c
throwing an error saying that it cannot find the file: mips-openwrt-linux-uclibc-gcc

So I thought I had to crosscompile it. But how do I do this? I have followed this guide with a ubuntu 14 wiki.openwrt.org/doc/howto/build and have built the general openwrt package, but in the toolchain folder, there is no file called mips-openwrt-linux-uclibc-gcc. There is only one called mips-openwrt-linux-gcc
Did I do something wrong in the menuconfig of the build?

Nevertheless, I tried using this file in the openwrt with the exported path variables with the command that is shown on the openwrt console
mips-openwrt-linux-uclibc-gcc -fno-strict-aliasing -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mno-mips16 -mno-interlink-mips16 -DNDEBUG -fno-inline -DNDEBUG -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mno-mips16 -mno-interlink-mips16 -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-mips-2.7/src/_portaudiomodule.o

and it just says:
"unable to execute 'mips-openwrt-linux-uclibc-gcc': Exec format error"
When I tried using it with the ubuntu, it throws errors like this:
"error unknown multiarch location for pyconfig.h"

I'm not sure where should I compile it, because even if I compile this single file in my ubuntu, where do I put it back in openwrt?, and how would I tell the openwrt not to build this file again? Because it will try to compile it again when I run the command "pip install pyaudio"?

Does anyone have a solution to this, or a simpler way to measure decibels from a microphone?

Hi para_cenas1, do you work out this issue, I encounter the same question, would you mind giving me some suggestions, many thanks!

para_cenas1 wrote:

Hi, I want to put a microphone in a Chaos Calmer 15.05 through a usb sound card, to be able to measure noise levels.
I was thinking of using the python package soundmeter. But it depends on pyaudio, and when running the command "pip install pyaudio", it tries to compile the source file _portaudiomodule.c
throwing an error saying that it cannot find the file: mips-openwrt-linux-uclibc-gcc

So I thought I had to crosscompile it. But how do I do this? I have followed this guide with a ubuntu 14 wiki.openwrt.org/doc/howto/build and have built the general openwrt package, but in the toolchain folder, there is no file called mips-openwrt-linux-uclibc-gcc. There is only one called mips-openwrt-linux-gcc
Did I do something wrong in the menuconfig of the build?

Nevertheless, I tried using this file in the openwrt with the exported path variables with the command that is shown on the openwrt console
mips-openwrt-linux-uclibc-gcc -fno-strict-aliasing -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mno-mips16 -mno-interlink-mips16 -DNDEBUG -fno-inline -DNDEBUG -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mno-mips16 -mno-interlink-mips16 -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-mips-2.7/src/_portaudiomodule.o

and it just says:
"unable to execute 'mips-openwrt-linux-uclibc-gcc': Exec format error"
When I tried using it with the ubuntu, it throws errors like this:
"error unknown multiarch location for pyconfig.h"

I'm not sure where should I compile it, because even if I compile this single file in my ubuntu, where do I put it back in openwrt?, and how would I tell the openwrt not to build this file again? Because it will try to compile it again when I run the command "pip install pyaudio"?

Does anyone have a solution to this, or a simpler way to measure decibels from a microphone?

The discussion might have continued from here.