28

I'm trying to install Memcached on Mac using this tutorial: http://tugdualgrall.blogspot.de/2011/11/installing-memcached-on-mac-os-x-and.html but when I try ./configure it says: configure: error: no acceptable C compiler found in $PATH when I try make it says: make sh: make: command not found sh-3.2# yum install make sh: yum: command not found sh-3.2# apt-get install make sh: apt-get: command not found

I must mention that I have Xcode but it's still not working. I'm really new on Mac so please take that into consideration :) I would really appreciate your help Thanks!

4
  • Xcode should give you make and related tools. What does printenv PATH | tr ":" "\n" return? Jul 15, 2012 at 18:40
  • It gives: /opt/local/bin /opt/local/sbin /usr/bin /bin /usr/sbin /sbin /usr/local/bin /usr/X11/bin /usr/local/git/bin Jul 15, 2012 at 19:15
  • Recent versions of Xcode install their tools in the bundle itself, e.g. /Applications/Xcode.app/Contents/Developer/usr/bin. Try putting that in your $PATH. Jul 15, 2012 at 19:20

3 Answers 3

85

If you have Xcode 4.3 or newer the command line tools, such as make, are not installed by default. In Xcode preferences go to the "Downloads" tab and under "Components" push the "Install" button next to "Command Line Tools". After you have successfully downloaded and installed the command line tools you should also type the following command in the Terminal to make sure all your Xcode command line tools are switched to use the 4.3 versions:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

Once everything is successfully installed you should see make and other command line developer tools in /usr/bin.

5
  • Perfect! Thanks a lot torrey! Jul 15, 2012 at 22:08
  • why its not working for me? still its saying: -bash: make: command not found
    – itsazzad
    Dec 26, 2012 at 21:34
  • @SazzadTusharKhan - try this: daigo.org/2012/10/… - tl;dr: Xcode > Preferences > Downloads > click "install" next to Command Line Tools. I have Xcode 4.5.3 currently installed and needed to do this after i updated from Lion to Mountain Lion.
    – hellatan
    Dec 31, 2012 at 16:04
  • @torrey.lyons: My current make version on my mac is 3.81. How do I upgrade to 4.1? thx
    – Lion Lai
    Nov 24, 2017 at 15:10
  • @LionLai The latest make version distributed by Apple is 3.81, probably due to licensing issues. You'll have to install GNU Make for yourself to get 4.1. See this question for details stackoverflow.com/questions/43175529/…. Nov 28, 2017 at 19:48
3

From torrey.lyons's answer, in Xcode --> Preferences --> Downloads it says under Command Line Tools:

Before installing, note that from within Terminal you can use the XCRUN tool to launch compilers and other tools embedded within the Xcode application. Use the XCODE-SELECT tool to define which version of Xcode is active. Type "man xcrun" from within Terminal to find out more.

Therefore, I was able to run the make tool with the command xcrun make.

0

Things have changed in Mac OS 11 (Big Sur). There is now a command line tools package. Search for "Command Line Tools for Xcode 12.5.1" (or newer) on Apple's Developer Network.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.