genhdr build error

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
adamk
Posts: 5
Joined: Thu Aug 20, 2015 7:01 am

genhdr build error

Post by adamk » Thu Aug 20, 2015 7:08 am

Hi all,

I have just started with trying to build uPython for the Pyboard. The forums have been very helpful so far. Unfortunately, as I am trying to build I get the following error:

16:58:41 **** Build of configuration Default for project uPython_build ****
make all
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build-PYBV10/genhdr
../py/mkrules.mk:75: recipe for target 'build-PYBV10/genhdr' failed
process_begin: CreateProcess(NULL, mkdir -p build-PYBV10/genhdr, ...) failed.
make (e=2): The system cannot find the file specified.

make: *** [build-PYBV10/genhdr] Error 2

16:58:41 Build Finished (took 279ms)

Does anyone know what this error message means? I have tried to find a genhdr folder but am not having much success.

Many thanks,

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: genhdr build error

Post by platforma » Thu Aug 20, 2015 1:32 pm

Code: Select all

process_begin: CreateProcess(NULL, mkdir -p build-PYBV10/genhdr, ...) failed.
Looks like your OS (probably Windows with MinGW/Cygwin) couldn't create a folder under the directory you ran make, I suppose it was stmhal?

What OS are you running and what permissions do you have inside that folder? Can you create a directory there manually?

adamk
Posts: 5
Joined: Thu Aug 20, 2015 7:01 am

Re: genhdr build error

Post by adamk » Thu Aug 20, 2015 1:56 pm

yes - I am using windows 10, though trying to build in Eclipse using the GNU ARM plug ins.
I am running as administrator so should have the permissions necessary. creating the folder there manually causes the following error message:

23:45:05 **** Build of configuration Default for project uPY_board_GNUARM ****
make all
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
Create build-PYBV10/genhdr/pins.h
GEN build-PYBV10/genhdr/qstrdefs.generated.h
Generating build-PYBV10/genhdr/mpversion.h
mkdir -p build-PYBV10/
../py/mkrules.mk:72: recipe for target 'build-PYBV10/' failed
process_begin: CreateProcess(NULL, mkdir -p build-PYBV10/, ...) failed.
make (e=2): The system cannot find the file specified.

make: *** [build-PYBV10/] Error 2

23:45:07 Build Finished (took 1s.831ms)

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: genhdr build error

Post by platforma » Fri Aug 21, 2015 1:35 pm

Okay, how is your build target configured in Eclipse? If I'm not mistaken, Eclipse might be bundling it's own make for building projects. You might well have ARM plugins and compiler installed, but that's not the issue here since it doesn't even get to the compilation process.

You need mkdir (although it still works from windows cmd) to make a directory, which is what's happening in:

Code: Select all

mkdir -p build-PYBV10
Can you run mkdir from the command line? Do you have MinGW or Cygwin installed? If you don't, I would recommend you getting either of them to get the majority of tools installed, gnumake, python and indeed basic tools like mkdir. Once you have that installed, you can try to build the project from the command line by issuing make in your stmhal directory.

adamk
Posts: 5
Joined: Thu Aug 20, 2015 7:01 am

Re: genhdr build error

Post by adamk » Sun Aug 23, 2015 10:57 am

Platforma - thanks for your suggestions. Yes I have make/mkdir etc installed and it does work from the command line - I think that what your saying about eclipse having its own make could be a likely possibility and possibly some conflicting stuff is happening?
I think I'm slowly figuring it out, have now progressed to getting errors which I'm sure are coming from the python parts in the makefile.
will let you know when I get the eclipse set up working :)

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: genhdr build error

Post by platforma » Mon Aug 24, 2015 11:49 am

Good to hear you're figuring it out!
Your Eclipse might not be aware of where your binaries are and your environment variables. A quick search with "eclipse mkdir not found" took me to a eclipse forum where someone else had a similar problem:
There is a difference between double-clicking on eclipse.exe in Windows
and launching it from a DOS-box or equivalent. The former doesn't have
the same environment as the latter. The latter works fine for me.
Look around for "eclipse environment variables" or similar!

adamk
Posts: 5
Joined: Thu Aug 20, 2015 7:01 am

Re: genhdr build error

Post by adamk » Fri Sep 11, 2015 3:43 am

Just an update - have been able to build for uPy board on Eclipse.

As of now have:
Installed MinGW, get basic packages of both mingw32-base and msys-base
Add msys/bin to PATH (need in order to use 'make')
Install gcc arm (https://launchpad.net/gcc-arm-embedded/+download)
Install Eclipse (C/C++)

If having problems, ensure that have msys/bin directory on path in File->Properties->C/C++ build/Environment, as well as python.

Now just need to get hardware debugging happening :)

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: genhdr build error

Post by platforma » Fri Sep 11, 2015 2:25 pm

Glad to hear you've figured it out! I'm not sure if folks here mark their threads as [solved] but it's probably good to do so :)

Post Reply