Error Installing R Packages from Source in Mac OSX - "make" command not found

I am having an issue with R that I cannot seem to figure out how to fix.

When trying to install an R package from source, I am running into the following error:

* installing *source* package ‘cthresh’ ...
** libs
*** arch - i386
sh: make: command not found
ERROR: compilation failed for package ‘cthresh’
* removing ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/cthresh’

Which would lead you to think that I do not have a compiler installed or that that $PATH is not set. Neither is true. I have installed XCode and echo $PATH gives me:

echo $PATH

So you can see that Developer shows up in /usr/bin

I have even made sure by:

export PATH=${PATH}:/Developer-3.2.5/usr/bin

If I call 'make' in bash or sh:

sh-3.2$ make make: * No targets specified and no makefile found. Stop.

bash-3.2$ make make: * No targets specified and no makefile found. Stop.

The compilers are there:

bash-3.2$ gcc i686-apple-darwin10-gcc-4.2.1: no input files

bash-3.2$ g++ i686-apple-darwin10-g++-4.2.1: no input files

So what gives? Why is R not able to 'make'? I'm really at a loss on this one and can't seem to find the answer anywhere! My guess is that R is not looking for the right compiler or something, but I can't figure out how to check where it is looking and why it fails on 'make'

I am on a MacBook Pro in OSX Lion. Please help!


Ok I've made some headway on this problem. Even though I had added


to my bash/sh .profile I needed to add it to the .Renviron file as well. I found that file in: /Library/Frameworks/R.framework/Versions/2.15/Resources/etc/

But now I'm getting this error:

  • installing source package ‘cthresh’ ... ** libs * arch - i386 make: * No rule to make target ._cthreb.o', needed'. Stop. ERROR: compilation failed for package ‘cthresh’

This makes me think there may be additional things to add to this .Renviron file? Any ideas on what?


You need to install "Command Line Tools" from preferences in Xcode 4 for Lion. Otherwise gcc is not available by just installing Xcode in Lion.

Need Your Help

cannot remove knockout observableArray item with SingalR knockout.js signalr

I am struggling with two issues. The first one is that after I pushed a new item into observableArray and try to refresh the accordion. The new item did not show up in the accordion. But the produc...

jQuery: why doesn't programmatic radio button selection work?

jquery radio-button

My task is really simple: given the set of 4 radio buttons, I need to programmatically check/select one of it on a click on an image. As simple as that.