Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

mpy-cross build error on MacOS
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

mpy-cross build error on MacOS

by Tavda3172 on Fri Apr 17, 2020 5:34 pm

Hello,
I am trying to convert some .py files to .mpy in order to reduce their size to fit on my Itsy Bitsy M0 Express. I have followed along with the instructions here:
https://learn.adafruit.com/building-circuitpython/macos
and here:
https://learn.adafruit.com/building-circuitpython/build-circuitpython

The problem is when I try to build mpy-cross I get the following error:
"make: msgfmt: No such file or directory
make: *** [build/genhdr/en_US.mo] Error 1
"

I am a little out of my element with all of this and using the command line, but if I try using MicroPython's mpy-cross (https://github.com/micropython/micropython/tree/master/mpy-cross) it works just fine. However, it seems that those .mpy files are not compatible with the latest version of CircuitPython.

I'm not sure if this is a bug or if I am doing something wrong but any help would be greatly appreciated. This seems like an important piece of using CircuiPython effectively so I hope there is an easy solution. Thank you in advance,
Kevin

Tavda3172
 
Posts: 16
Joined: Sat Nov 26, 2016 8:08 pm

Re: mpy-cross build error on MacOS

by FutureTechLab on Fri Apr 17, 2020 7:42 pm

I too am experiencing this issue and would like to find a solution.

FutureTechLab
 
Posts: 2
Joined: Fri Apr 15, 2016 11:23 pm

Re: mpy-cross build error on MacOS

by tannewt on Fri Apr 17, 2020 7:46 pm

Hi! Please make sure gettext is installed. It includes msgfmt which seems to be what you are missing. This is a CircuitPython-only thing because we support translated error messages and MicroPython doesn't.

tannewt
 
Posts: 1685
Joined: Thu Oct 06, 2016 8:48 pm

Re: mpy-cross build error on MacOS

by Tavda3172 on Fri Apr 17, 2020 8:09 pm

Hi, thanks for the quick response! Ok, so I just tried to add gettext using:
Code: Select all | TOGGLE FULL SIZE
brew upgrade gettext
and I got "Warning: gettext 0.20.2 already installed". Could it be in the wrong place? How do I go about checking for it?

Tavda3172
 
Posts: 16
Joined: Sat Nov 26, 2016 8:08 pm

Re: mpy-cross build error on MacOS

by Tavda3172 on Fri Apr 17, 2020 8:33 pm

Ok, I've confirmed that I have gettext installed and I still get the "make: msgfmt: No such file or directory
make: *** [build/genhdr/en_US.mo] Error 1"
error.

Tavda3172
 
Posts: 16
Joined: Sat Nov 26, 2016 8:08 pm

Re: mpy-cross build error on MacOS

by FutureTechLab on Fri Apr 17, 2020 8:55 pm

I have resolved the issue by doing the following

$ brew install gettext

$ sudo nano /etc/paths

add the following path

/usr/local/Cellar/gettext/0.20.2/bin

ctrl + X, y, Return

Restart terminal

cd to the mpy-cross folder

make

FutureTechLab
 
Posts: 2
Joined: Fri Apr 15, 2016 11:23 pm

Re: mpy-cross build error on MacOS

by tannewt on Mon Apr 20, 2020 12:48 pm

Glad you got it going! Thanks for posting the solution.

tannewt
 
Posts: 1685
Joined: Thu Oct 06, 2016 8:48 pm

Re: mpy-cross build error on MacOS

by Tavda3172 on Mon Apr 20, 2020 8:35 pm

That worked! Woohoo:) Thank you for figuring that out. Now to get that code to fit... :)

Tavda3172
 
Posts: 16
Joined: Sat Nov 26, 2016 8:08 pm

Please be positive and constructive with your questions and comments.