How to install 'make' and GCC on a Mac
Asked Answered
G

4

38

I want to install Eclim on my MacBook Air (2011 version). But there are some problems I faced during the installation. It told me that I did not install make and GCC.

I tried to find the solution for it, but all solutions are talking about using Xcode. In fact, I installed Xcode.

But I still cannot install Eclim because there are no make and GCC installed.

How can I install them so that I can install Eclim?

Gallicanism answered 22/4, 2012 at 6:28 Comment(1)
Related (a canonical question): How can I compile and run C/C++ code in a Unix console or Mac terminal?Guyer
A
82

Update for newer versions:

The command line versions can now be installed straight from the command line itself;

  • Open "Terminal" (it is located in Applications/Utilities)
  • In the terminal window, run the command xcode-select --install
  • In the windows that pops up, click Install, and agree to the Terms of Service.

Once the installation is complete, the command line utilities should be set up property.


Older versions:

Installing recent Xcode versions confusingly enough does not automatically install the command line tools. To install the command line tools when they're not automatically installed;

  • Start Xcode.
  • Go to Xcode/Preferences.
  • Click the "Downloads" tab.
  • Click "Components".
  • Click "Install" on the command line tools line.

That will install the command line tools and make them accessible from a regular command line.

Apposite answered 22/4, 2012 at 6:33 Comment(2)
Not correct anymore. Please refresh for the new XCodeAllative
@JoachimIsaksson: My current make version on mac is 3.81. How do I upgrade to 4.1? thxBasic
Q
21

With Homebrew installed on my Mac, the installation was as simple as running the command

brew install make

It might require root permissions.

Quoits answered 1/6, 2019 at 3:36 Comment(1)
I guess the latest version of gcc can be installed with brew too, with the command brew install gcc. But then you may need to add a path to enable these installations to be picked up at runtime by your computer. Like export PATH="/usr/local/bin:$PATH" for gcc and export PATH="/usr/local/opt/make/libexec/gnubin:$PATH" for make.Tetrachord
A
3

You can also use this standalone GCC installed (got from Xcode).

Abijah answered 22/4, 2012 at 13:18 Comment(1)
Apple has their own officially supported version now too you can download from developer.apple.com/downloads with a free developer account. Kenneth details it hereLuxuriate
L
1

With modern Xcode (4.3) you will need to run the GUI and have it install the command line tools. I'll quote from the MacPorts ProblemHotList because I have it bookmarked:

Xcode 4.3 does not include a fully working set of command line tools by default. Nothing will build without it, despite the fact that xcode-select and which make may return correct values.

You must open Xcode, go to Preferences, and download this component from the Downloads section. You will require an Apple ID to download the component.

Languish answered 22/4, 2012 at 6:33 Comment(4)
Thx a lot, but it requires the developerID @@Gallicanism
Signing up as a developer for this purpose is free (not the $99 developer license for the Mac App Store or iTunes Store).Languish
There are also other reasons why it might not be possible to use the Apple version: /Users/uname/Documents/openwrt/include/toplevel.mk:29: *** Please use a newer version of GNU make. The version shipped by Apple is not supported. Stop.Noneffective
This post goes through GNU Make on macOS: #38902394Noneffective

© 2022 - 2024 — McMap. All rights reserved.