microbit-foundation / micropython-microbit-v2

Temporary home for MicroPython for micro:bit v2 as we stablise it before pushing upstream
MIT License
45 stars 25 forks source link

Errors while compiling on Ubuntu 20.04 #43

Closed FalconDQ closed 3 years ago

FalconDQ commented 3 years ago

When compiling on UBUNTU I get these errors: [ 0%] Building CXX object libraries/codal-core/CMakeFiles/codal-core.dir/source/core/CodalCompat.cpp.o c++: warning: ‘-mcpu=’ is deprecated; use ‘-mtune=’ or ‘-march=’ instead c++: error: unrecognized command line option ‘-mthumb’ c++: error: unrecognized command line option ‘-mfpu=fpv4-sp-d16’ c++: error: unrecognized command line option ‘-mfloat-abi=softfp’

microbit-carlos commented 3 years ago

Hi @FalconDQ, Have you got installed gcc-arm-none-eabi?

FalconDQ commented 3 years ago

thank you or the reply! I checked, it is: gcc-arm-none-eabi is already the newest version (15:9-2019-q4-0ubuntu1). Maybe the complete output tells you more:

c++: warning: ‘-mcpu=’ is deprecated; use ‘-mtune=’ or ‘-march=’ instead c++: error: unrecognized command line option ‘-mthumb’ c++: error: unrecognized command line option ‘-mfpu=fpv4-sp-d16’ c++: error: unrecognized command line option ‘-mfloat-abi=softfp’ make[3]: [libraries/codal-core/CMakeFiles/codal-core.dir/build.make:63: libraries/codal-core/CMakeFiles/codal-core.dir/source/core/CodalCompat.cpp.o] Error 1 make[3]: Leaving directory '/home/falcon/micropython-microbit-v2/src/build' make[2]: [CMakeFiles/Makefile2:276: libraries/codal-core/CMakeFiles/codal-core.dir/all] Error 2 make[2]: Leaving directory '/home/falcon/micropython-microbit-v2/src/build' make[1]: [Makefile:84: all] Error 2 make[1]: Leaving directory '/home/falcon/micropython-microbit-v2/src/build' make: [Makefile:36: codal_build] Error 2

microbit-carlos commented 3 years ago

Thanks @FalconDQ. It still sounds like it might not be using the arm version of gcc. It would be quite useful if you could start from 0 and copy/paste here every single command and output (all of it, including the commands).

FalconDQ commented 3 years ago

Thanks for your support! I fixed it because of your help! I'm not that great with Linux and C and make and compiling stuff, let alone cross-compiling. I installed Linux in a virtual machine just for the purpose of compiling Micropython. I think somewhere along the way I installed Cmake because of an error I got. Later on I installed gcc-arm-none-eabi on top of that. All based on Google "research". Only after removing both Cmake and gcc-arm-none-eabi and
cloning this Git repository again and then redoing all the steps, it compiled without errors. Maybe it's worth mentioning in the README that installing gcc-arm-none-eabi compiler is required to compile this. Just to make it more NOOB proof! ;-). Thanks again!