I use OS X El Capitan. I installed Xcode 7 from AppStore and macports from an official website.

When I'm trying to install something using macports: sudo port install nodejs4, I'm getting the following warning: Warning: The Xcode Command Line Tools don't appear to be installed; most ports will likely fail to build.. But compiler (cc) works, make works, and I actually installed few macports packages without any problems.

Now if I run xcode-select --install, I'm getting dialog to install Developer Tools. But I think that Xcode already has all those tools:

$ xcode-select -p

So the question is: is it some bug in macports or is there some tools not included with Xcode 7 which must be installed separately using xcode-select --install? I don't want to introduce unnecessary clutter.

  • 1
    If you open Xcode and go to Preferences, does it show command line tools installed? They aren't installed by default, just because you downloaded Xcode (in my experience). – ruddfawcett Aug 7 '16 at 20:33
  • @ruddfawcett I wasn't able to find anything about command line tools in Xcode 7. I remember that they were there in old versions, but now I can only see emulators and documentation for downloading. I think that Xcode now installs command-line tools automatically. – vbezhenar Aug 7 '16 at 21:23
  • @user3439894 I will use Xcode regardless, I just don't want to install additional packages if it's not necessary. Command line tools seem to work fine, unless I missing some. But macports complain and I don't understand, why. – vbezhenar Aug 7 '16 at 21:25

So I've inspected macports sources and it turns out that this warning is displayed, when directory /usr/include or executable /usr/bin/make is missing. While I have working /usr/bin/make, directory /usr/include was indeed missing. Installing command-line tools using xcode-select --install fixed it.

| improve this answer | |
  • If that was indeed what solved your problem, consider accepting your own answer so that this question no longer shows up in the "unanswered" lists. – jstarek Aug 8 '16 at 14:22

You have to install the developer tools to run the C compiler and other build tools (e.g. linker, make) from the command line and provide support files e.g. include and libraries

The command line tools are in places like /usr/bin and so installing via the AppStore cannot put the tools in the correct place. This a separate install step has to be done.

| improve this answer | |
  • But those tools are working from terminal right now. There's /usr/bin/clang and it works, I can compile C programs. Same about /usr/bin/make, /usr/bin/xcrun, etc. – vbezhenar Aug 7 '16 at 21:20

As a comment on the original question said, you must go to Xcode's settings, then to the last tab, Locations. The options for which command line toolset to use is there.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .