libopencm3 / libopencm3-template

Simple empty template to base your poject on
Other
88 stars 63 forks source link

Initial make fails with error about Python #15

Open riban-bw opened 10 months ago

riban-bw commented 10 months ago

Following the build instructions in the README I get the following error:

make: Entering directory '/home/brian/projects/libopencm3_test/libopencm3'
  GENHDR  include/libopencm3/stm32/f0/irq.json
/usr/bin/env: ‘python’: No such file or directory
make: *** [Makefile:59: include/libopencm3/stm32/f0/irq.json.genhdr] Error 127
make: Leaving directory '/home/brian/projects/libopencm3_test/libopencm3'

I wonder whether this is due to the build process depending on Python2 which is now obsolute. Python3 executables tend to be called python3 whereas Python2 were just called python. (It is a shame that distros haven't yet changed the default name / alias for python=>python3.)

I see there are many scripts that have #!/usr/bin/env python. Updating each of these to use python3 advances the build but still failures:

make[1]: arm-none-eabi-gcc: No such file or directory

It looks like the cross compiler installed on my system differs (in location?) from that expected by the build system. Maybe the README should describe this dependancy?

karlp commented 10 months ago

libopencm3 (still) supports both python2 and python3, and followed the python PEPs for doing so, using a "python" name. If you're on a debian style distro, there's a "python-is-python3" package you can install. (you can also of course actually install python2 again, though I don't really recommend that)

arm-none-eabi-gcc is not in your path. That's something only you can fix, but you're right, this template repository doesn't have a full library readme, as it's more intended as a template for your own project readme. You can try following the upstream library readme instead: https://github.com/libopencm3/libopencm3/ I'm leaving this open to link better to the expected initial situation.