Compiling Fails with 0013 on OS X 10.5

I can't seem to get sketches to compile on OS X. It gives me this error:

hardware/tools/avr/bin/avr-g++: line 4: dirname: command not found
hardware/tools/avr/bin/avr-g++: line 4: readlink: command not found
hardware/tools/avr/bin/avr-g++: line 7: dirname: command not found
hardware/tools/avr/bin/avr-g++: line 7: /../avr-4/bin/g++: No such file or directory
hardware/tools/avr/bin/avr-g++: line 7: exec: /../avr-4/bin/g++: cannot execute: No such file or directory

Those files (dirname and readlink) specifically, exists, but they seem not to be in the path for bash when the compiler runs. The path is set properly if I open a terminal manually...

So I'm not sure where/how to point the arduino to the '/usr/bin' directory.


I've got 0013 on OS X 10.5 and my sketches compile correctly. Have you tried reinstalling 0013.

You could edit ARDUINO/tools/avr/bin/avr-g++ and replace the dirname $0/.. with the path to your Arduino directory.

@cyberheater As far as installing goes, I've done nothing except for unpack the zip file. Should files be copied somewhere as part of an installation procedure?

@mellis I started to look at the avr-g++ file and some of the others. the relative paths seem to be okay, but it's calling 'dirname' and 'readlink' specifically that are giving me problems. I could change all the files, but it seems like there should be something that fixes the root problem.

0013 and 0012 exhibit the same symptoms. I finally tried 0011 and sketches compile, but i'd much rather be running the latest release.

Any other thoughts?

I don't have this kind of problem on my Mac 10.5, but some "compilation scripts" fail when you have a space in your path, is it the case? I'm thinking of something like "/Users/foo/My Arduino/" which is technically valid and allowed, but parsed incorrectly by some tools...

I'm just trying to compile one of the sample sketches, like Blink.

hi-- i had 2 of the same problems. the avrdude.conf was missing from the path - where that path was defined i couldn't find. so i found the file and copied it to where it was being looked for... it might be a hack, but it worked for me. fix the path, or copy in the missing file...

oh and i moved the folder so that there were no spaces anywhere from root-->compiler. having a space in the path caused a problem also.
ex. /computer/arduino 0013/hardware/tools/avr... didn't work

/computer/arduino-0013/hardware/tools/avr... this did

good luck

Try doing:

which dirname

from the Terminal. Is that directory in your path? You can check your path with:

echo $PATH


Therein lies the problem. If I check the path from the terminal, I see all the necessary paths. However, if I redirect the output from the 'set' command to a text file from within the 'avr-g++' executable, the only thing in my path is '/opt/local/bin'.

Helllllllp! ;D I've been able to use 0011 in the meantime, but I find it odd that nobody else is having this problem.

i'm using 0014 on OS X 10.5.6 and i found that by adding an export path to the top of two files i managed to get these errors to go away

i added

export PATH="/usr/bin:/usr/local/bin:/usr/local/sbin:/opt/local/bin:$PATH"

to both


in the hardware/tools/avr/bin folder of arduino-0014

i imagine doing this will get 0013 to work as well

And there it is...thanks r sherman!