make error buildung Micropython for RP2

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
cyrano1960
Posts: 39
Joined: Fri Mar 29, 2019 7:08 pm

make error buildung Micropython for RP2

Post by cyrano1960 » Fri Feb 26, 2021 7:30 pm

Hello there,

I have tried to build the RP2 port as described in the "Rapberry Pi Pico Python SDK" manual and I always get this error message:

Code: Select all

[ -d build ] || cmake -S . -B build -DPICO_BUILD_DOCS=0
CMake Error: The source directory "/home/werner/micropython/ports/rp2/build" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
Makefile:10: recipe for target 'all' failed
make: *** [all] Error 1
So I have manually created the build directory but I had little hope that this could be the error and after this I got a new error message:

Code: Select all

[ -d build ] || cmake -S . -B build -DPICO_BUILD_DOCS=0
make -s -C build
make[1]: *** No targets specified and no makefile found.  Stop.
Makefile:10: recipe for target 'all' failed
make: *** [all] Error 2
I am working with a WSL system and Debian on a Windows machine. Building the STM32 port works fine. I have cloned the Micropython repository again, and installed all the necessary tools again, but getting the same error. On another Windows machine with the same setup it works fine. Does anyone maybe have an idea what it could be, I just don't know anymore. Thanks in advance! :roll:

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: make error buildung Micropython for RP2

Post by jimmo » Wed Mar 03, 2021 5:28 am

cyrano1960 wrote:
Fri Feb 26, 2021 7:30 pm
So I have manually created the build directory but I had little hope that this could be the error
That line is supposed to create the build directory. the "[ -d build ] || ..." on the start means "if the build directory doesn't exist... ". cmake will create the build directory with the makefiles etc.

You should actually be able to invoke this directly by the Makefile... e.g.

Code: Select all

cd ports/rp2
make
But I don't think that's your problem. Sounds like something is going on with WSL.

Can you provide more details about your set up, exact commands you're running, etc.

cyrano1960
Posts: 39
Joined: Fri Mar 29, 2019 7:08 pm

Re: make error buildung Micropython for RP2

Post by cyrano1960 » Sun Mar 07, 2021 1:43 pm

Hi Jimmo,
sorry for the long delay, but I have been ill for some days... You're right, the WSL was corrupted, even on a Raspberry Pi 3B the build works fine. I have installed the WSL again and now it works perfect.
Thanks for your help!

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: make error buildung Micropython for RP2

Post by devnull » Sun Dec 19, 2021 8:54 am

I have identical issue:

Code: Select all

#micropython/ports/rp2# make clean
rm -f -rf build-PICO
#micropython/ports/rp2# make
[ -d build-PICO ] || cmake -S . -B build-PICO -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=PICO
CMake Error: The source directory "/usr/share/upydev/work/micropython/ports/rp2/build-PICO" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
Makefile:18: recipe for target 'all' failed
make: *** [all] Error 1
This is a fresh debian install, all other ports seem to be OK ??

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: make error buildung Micropython for RP2

Post by devnull » Sun Dec 19, 2021 8:56 am

So I thought I would add this folder, still no-go:

Code: Select all

# mkdir /usr/share/upydev/work/micropython/ports/rp2/build-PICO
root@26950a4e3ede:/usr/share/upydev/work/micropython/ports/rp2# make
[ -d build-PICO ] || cmake -S . -B build-PICO -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=PICO
make -s -C build-PICO
make[1]: *** No targets specified and no makefile found.  Stop.
Makefile:18: recipe for target 'all' failed
make: *** [all] Error 2
And so I tried the cmake command:

Code: Select all

root@26950a4e3ede:/usr/share/upydev/work/micropython/ports/rp2# cmake -S . -B build-PICO -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=PICO
CMake Error: The source directory "/usr/share/upydev/work/micropython/ports/rp2/build-PICO" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
root@26950a4e3ede:/usr/share/upydev/work/micropython/ports/rp2#
root@26950a4e3ede:/usr/share/upydev/work/micropython/ports/rp2#
And then I copied CMakeLists.txt into the build folder and:

Code: Select all

root@26950a4e3ede:/usr/share/upydev/work/micropython/ports/rp2# cmake -S . -B build-PICO -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=PICO
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 3.12 or higher is required.  You are running version 3.7.2
-- Configuring incomplete, errors occurred!
Solution:

Code: Select all

pip install --upgrade cmake
Done :-)

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: make error buildung Micropython for RP2

Post by devnull » Sun Dec 19, 2021 10:16 am

Uh oh, still fails:

Code: Select all

[ 94%] Building C object CMakeFiles/firmware.dir/usr/share/upydev/work/micropython/lib/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.c.obj
/usr/share/upydev/work/micropython/lib/pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp:22:1: error: identifier 'noexcept' is a keyword in C++11 [-Werror=c++0x-compat]
 void operator delete[](void *p) noexcept { std::free(p); }
 ^
/usr/share/upydev/work/micropython/lib/pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp:22:33: error: expected initializer before 'noexcept'
 void operator delete[](void *p) noexcept { std::free(p); }
                                 ^
cc1plus: all warnings being treated as errors
make[3]: *** [CMakeFiles/firmware.dir/usr/share/upydev/work/micropython/lib/pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp.obj] Error 1
CMakeFiles/firmware.dir/build.make:3980: recipe for target 'CMakeFiles/firmware.dir/usr/share/upydev/work/micropython/lib/pico-sdk/src/rp2_common/pico_standard_link/new_delete.cpp.obj' failed
make[3]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:1356: recipe for target 'CMakeFiles/firmware.dir/all' failed
make[2]: *** [CMakeFiles/firmware.dir/all] Error 2
Makefile:102: recipe for target 'all' failed
make[1]: *** [all] Error 2
make: *** [all] Error 2
Makefile:18: recipe for target 'all' failed

vtgearhead
Posts: 5
Joined: Thu Dec 30, 2021 7:51 pm

Re: make error buildung Micropython for RP2

Post by vtgearhead » Thu Dec 30, 2021 7:55 pm

I'm seeing the same failure on Ubuntu 18.04:

/net/src/platforms/raspberry_pi/rp2040/micropython/ports/rp2$ make
[ -d build-PICO ] || cmake -S . -B build-PICO -DPICO_BUILD_DOCS=0 -DMICROPY_BOARD=PICO
CMake Error: The source directory "/net/src/platforms/raspberry_pi/rp2040/micropython/ports/rp2/build-PICO" does not exist.

Followed all instructions in the RP2040 SDK document - 2x Same failure both times.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: make error buildung Micropython for RP2

Post by Roberthh » Thu Dec 30, 2021 8:01 pm

@vtgearhead What happens if you create rp2/build-Pico before yourself, using "mkdir build-PICO"? It should be created by the Makefile.

vtgearhead
Posts: 5
Joined: Thu Dec 30, 2021 7:51 pm

Re: make error buildung Micropython for RP2

Post by vtgearhead » Thu Dec 30, 2021 8:12 pm

Roberthh wrote:
Thu Dec 30, 2021 8:01 pm
@vtgearhead What happens if you create rp2/build-Pico before yourself, using "mkdir build-PICO"? It should be created by the Makefile.
It complains about missing target and missing makefile - from memory. I just deleted the entire thing in favor of attempting to install a prebuilt package.

Post Reply