Reputation: 21
When install make on Mac OX it shows:
Error when bootstrapping CMake: Cannot find appropriate C compiler on this system. Please specify one using environment variable CC.
However, I have Xcode on my MacBook and C/C++ are both able to run.
How can I solve it?
Upvotes: 2
Views: 11426
Reputation: 971
Cannot find appropriate C compiler on this system, make
sudo apt-get install build-essential
Upvotes: 1
Reputation: 11
When I typed ./bootstrap
that happened to me as well.
This worked for me:
env CC=gcc ./bootstrap
Upvotes: 1
Reputation: 2724
I’m guessing that, like me, you were doing this using homebrew - and on MacOS 10.12 Sierra which (at the time of writing) is tecnically not currently supported.
If you haven’t solved this yet, here’s what I did...
TL;DR- Moral of the tale: when using homebrew with XCode provided clang compiler tooling always make sure you are up-to-date (and have installed and accepted the T&C’s for using the command line tools).
I was trying to upgrade CMake and I got the same error during its bootstrap:
Error when bootstrapping CMake: Cannot find appropriate C compiler on this system. Please specify one using environment variable CC
So I realised (as did @Jonathan Leffler) that this is probably required:
xcode-select --install
Which fixed it (I also suspect providing an alternative compiler with brew install gcc** might have worked…)
But then I got:
==> ./bootstrap --prefix=/usr/local/Cellar/cmake/3.6.1 --no-system-libs --parallel=4 --datadir=/share/cmake --docdir=/share/doc/cmake --ma
Last 15 lines from /Users/tim/Library/Logs/Homebrew/cmake/01.bootstrap:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
Please set CMAKE_OSX_DEPLOYMENT_TARGET to 10.11 or lower.
Call Stack (most recent call first):
Modules/CMakeSystemSpecificInformation.cmake:36 (include)
CMakeLists.txt:19 (project)
Then of course I have to upgrade to the latest XCode (8.1) to update the SDK. This takes ages. Groan.
Followed (on the command line) by acceptance of licence:
sudo xcodebuild -license
But once that was done, everything worked - i.e. brew upgrade cmake
!
Upvotes: 4