Solved: Can't compile MidiPal code (depends.mk files missing)
  • While eagerly awaiting my new MidPal box i’m already trying to develop some new sequencing code. Therefore i first have to compile the AVR code.

    So I cloned the midipal code to my local PC (running Win7 64bit) using git. I had to use the http protocol instead of git.
    Afterwards i changed to the new midipal root directory and ran git submodule init git submodule update
    With the latter one i received an “fatal: write error: Invalid argument” and
    “Clone of ‘git://github.com/pichenettes/avril.git’ into submodule path ‘avrlib’ failed” error.
    So I downloaded the avrlib and tool directories manual (pichenettes-avril-firmware_tools-5a24857.zip and pichenettes-avril-8bf4e30.zip) and extracted them to accoring directories. After re-running the update command i got a
    “fatal: Needed a single revision
    Unable to find current revision in submodule path ‘avrlib’ “ error.

    As i’d already installed WinAVR i changed the two path entries in the midipal/makefile and ran make – midipal/makefile

    Finally i received the following error:
    avrlib/makefile.mk:165: build/midipal/depends.mk: No such file or directory
    midipal/makefile:30: build/midipal/depends.mk: No such file or directory

    I thought these dependencies file should have been created by the git submodule command. Unfortunately something went wrong.

    Can anybody help me with this issue?

  • These files are created by gcc (the depends.mk file is the concatenation of .d files built by gcc).

    Has the “build” directory been created?

  • Yes, that’s the strange thing. The build directory has been created during the compilation process.
    Hmm, strange. Any other ideas?

    So you think it’s somehow related to the gcc compilation, right? Then i will try to investigate a little bit more in that direction. Maybe it’s because of some wrong paths in the makefile (even if i checked it all several times).

  • There’s a build and a build/midipal directory? You should have the following hierarcy:

    • midipal/
    • midipal/build
    • midipal/build/midipal
    • ...
    • midipal/avrlib
    • midipal/midipal
    • ...

    This might be confusing, but the “midipal” project contains several subprojects (the midipal firmware, the bootloader, a simple test program for the LCD...). You should be in the first level (midipal/) to run make

  • Wow, that’s what i call a fast reply! ;-)

    O.K., regarding the dirs: yes, there is an “midipal/build/midipal” directory which has been created during the compilation.

    You are right, at the beginning it’s a little bit confusing but it becomes clear very fast.
    So i still had no luck. Hopefully it’s not related to any directory permissions under win7, but i don’t think so.

  • I did some more investigation and it seems the problem is not related to the dependency files as they will be recreated but by something adc related.
    Here is the debug output from my last run:
    ———————————————————————————————————————————————-
    >make -d -f midipal/makefile

    GNU Make 3.81
    Copyright© 2006 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.

    This program built for i386-pc-mingw32
    find_and_set_shell path search set default_shell = C:/Program Files (x86)/WinAVR/utils/bin/sh.exe
    Reading makefiles…
    avrlib/makefile.mk:163: build/midipal/depends.mk: No such file or directory
    midipal/makefile:30: build/midipal/depends.mk: No such file or directory
    Reading makefile `midipal/makefile’...
    Reading makefile `avrlib/makefile.mk’ (search path) (no ~ expansion)...
    Reading makefile `build/midipal/depends.mk’ (search path) (no ~ expansion)...
    Reading makefile `build/midipal/depends.mk’ (search path) (no ~ expansion)...
    Updating makefiles…. Considering target file `build/midipal/depends.mk’. File `build/midipal/depends.mk’ does not exist. Considering target file `build/midipal/’. File `build/midipal/’ does not exist. Finished prerequisites of target file `build/midipal/’. Must remake target `build/midipal/’.
    mkdir -p build/midipal/
    CreateProcess(C:\Program Files (x86)\WinAVR\utils\bin\mkdir.exe,mkdir -p build/midipal/,...)
    Putting child 0x004704a0 (build/midipal/) PID 4644192 on the chain.
    Live child 0x004704a0 (build/midipal/) PID 4644192
    Main thread handle = 0x00000074
    Reaping winning child 0x004704a0 PID 4644192
    Removing child 0x004704a0 PID 4644192 from chain.

    Successfully remade target file `build/midipal/’. Considering target file `build/midipal/adc.d’. File `build/midipal/adc.d’ does not exist. Looking for an implicit rule for `build/midipal/adc.d’. Trying pattern rule with stem `adc’. Trying implicit prerequisite `adc.cc’. Found prerequisite `adc.cc’ as VPATH `avrlib/adc.cc’ Found an implicit rule for `build/midipal/adc.d’. Considering target file `adc.cc’. Looking for an implicit rule for `adc.cc’. Trying pattern rule with stem `adc.cc’. Trying implicit prerequisite `adc.cc,v’. Trying pattern rule with stem `adc.cc’. Trying implicit prerequisite `RCS/adc.cc,v’. Trying pattern rule with stem `adc.cc’. Trying implicit prerequisite `RCS/adc.cc’. Trying pattern rule with stem `adc.cc’. Trying implicit prerequisite `s.adc.cc’. Trying pattern rule with stem `adc.cc’. Trying implicit prerequisite `SCCS/s.adc.cc’. No implicit rule found for `adc.cc’. Finished prerequisites of target file `adc.cc’. No need to remake target `adc.cc’; using VPATH name `avrlib/adc.cc’. Finished prerequisites of target file `build/midipal/adc.d’. Must remake target `build/midipal/adc.d’.

    Unhandled exception filter called from program make
    ExceptionCode = c00000fd
    ExceptionFlags = 0
    ExceptionAddress = 4217b3
    ————————————————————————————————————————————-

    If i check the adc.h i can see references to “avr/io.h”. Unfortunately i do not have this “avr” directory (just avrlib). May this be the cause for the problem?

  • avr/io.h is a system header that comes with avr-gcc, this should not be the part of the problem… Missing header files cause gcc errors, not make errors anyway.

    Seems to be a crash of make. Try an updated version of make – see this

  • I tried the new version 3.8.2 of make. It worked better but i still got an error. Due to the better debug output of this make version i recognized, that i made a mistake when changing the AVR paths in the makefile. The directory name contained a space character (“Program Files”). So i replaced the path with the Windows 8.3 shortnames.
    Unfortunately i still got an error. So i used the old make version and… yes at least it started the compilation process and created all the files in the build directory. Unfortunately when creating the “depends.mk” files it chrashed with the same exception code (“c00000fd”) as before :-(

    So i looked at the error message from the new make executeable (3.8.2) which was jus a simple “Syntaxfehler”. This means it a error message from my windows command line interpreter, not from the make/compiler.
    I recognized that the created CMD-command to create the build directory was “mkdir build/midipal/” instead of “mkdir build\midipal”. So i modified the makefile a little bit and again the compilation process started with the new make version.
    O.K., of course it did not finish. I receive the following error:
    ———————————————————————————
    Unhandled exception filter called from program make
    ExceptionCode = c0000005
    ExceptionFlags = 0
    ExceptionAddress = 0x00426450
    Access violation: write operation at address 0x00000000
    ——————————————————————————

    So for now i will give up. Maybe some other user will have more success, escpecially as i can imagine that a lot of people will order the built version of the MidiPal now.
    Anyway, thanks a lot for your help.

  • Some people have successfully built the Shruthi-1 code on windows machines, so they should be able to point you to which version of make they used.

  • O.K., problem solved now. Was very simple.
    As make 3.82 should have been able to detect the shell automatically i always used the windows command line to call make.
    Now i tried “sh” which is the shell which comes with WinAVR and: voilà – it went through without any further problems.

    So to all newbies: USE THE WINAVR SHELL TO MAKE/COMPILE!