Problem building with ulab on Mac OSX

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
ryanGT
Posts: 24
Joined: Fri Jan 28, 2022 12:15 am

Problem building with ulab on Mac OSX

Post by ryanGT » Fri Jan 28, 2022 12:40 am

This might be a ulab specific question, but I am not sure.

I just started using micropython yesterday. I have been using python and the numpy stack for many years. My python is pretty good, my C skills are fairly weak. I have recently been trying to use Raspberry Pi + Arduino to allow real-time execution of python code, but I am hoping micropython will make this easier and also lead to better performance. I have my first micropython file working well, but I now want to use ulab to save data into an array.

So, I have a pyboard v1.1 and need ulab. I was able to flash a pre-compiled .dfu file, but it is for micropython 1.12 and ulab 0.54 or something. So, I need to compile it myself, I guess. I have a Mac, a chromebook with linux (intel i3), and raspberry pi 4 that I could use for the compiling. I have never cross-compiled anything before. I tried with my chromebook and had some errors involving hal, so I decided to try my mac.

I used homebrew to install micropython to get libffi. I then used the command
brew install --cask gcc-arm-embedded
to get the arm tools.

I cloned micropython and ulab from git.

I then tried to make with the command

make BOARD=PYBV11 USER_C_MODULES=../../../ulab all

from the folder micropython/ports/stm32 in the git repo.

Things seem to be compiling along and then I got this linking error:

LINK build-PYBV11/firmware.elf
arm-none-eabi-ld: build-PYBV11/code/numpy/io/io.o: in function `io_save':
io.c:(.text.io_save+0xd0): undefined reference to `sprintf'
arm-none-eabi-ld: io.c:(.text.io_save+0x124): undefined reference to `sprintf'
arm-none-eabi-ld: io.c:(.text.io_save+0x1dc): undefined reference to `sprintf'
make: *** [build-PYBV11/firmware.elf] Error 1

Since it is under numpy, I assume it is brought in by ulab. I assume I am doing something wrong, but I don't know what.

Thanks,
Ryan

ryanGT
Posts: 24
Joined: Fri Jan 28, 2022 12:15 am

Re: Problem building with ulab on Mac OSX [SOLVED]

Post by ryanGT » Fri Jan 28, 2022 4:57 pm

FYI, I posted this question as an issue on the ulab github site and got things resolved. In case anyone else has this problem, here is the discussion and solution:

https://github.com/v923z/micropython-ulab/issues/497

Post Reply