Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build Node on macOS: "No acceptable C compiler found!" #17238

Closed
mgol opened this issue Nov 22, 2017 · 4 comments
Closed

Cannot build Node on macOS: "No acceptable C compiler found!" #17238

mgol opened this issue Nov 22, 2017 · 4 comments
Labels
build Issues and PRs related to build files or the CI. macos Issues and PRs related to the macOS platform / OSX.

Comments

@mgol
Copy link
Contributor

mgol commented Nov 22, 2017

  • Version: master
  • Platform: macOS 10.13.1 (17B48) (Darwin mgol-mbpro.local 17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64)
  • Subsystem:

I have latest XCode (9.1 (9B55))& Command Line Tools installed on a fully updated High Sierra. python resolves to a version 2.7.10; I have make 3.81. This fulfills all requirements at https://github.com/nodejs/node/blob/master/BUILDING.md#unix--macos and yet when I run ./configure I get the following:

WARNING: failed to autodetect C++ compiler version (CXX=ccache clang++ -Qunused-arguments)
WARNING: failed to autodetect C compiler version (CC=ccache clang -Qunused-arguments)
Node.js configure error: No acceptable C compiler found!

        Please make sure you have a C compiler installed on your system and/or
        consider adjusting the CC environment variable if you installed
        it in a non-standard prefix.
        
@aqrln
Copy link
Contributor

aqrln commented Nov 22, 2017

If you have run xcode-select --install, the command line tools are installed and clang works from the command line, I'd suspect something might be wrong with ccache (since, as far as I can see, your $CC and $CXX env variables contain ccache clang -Qunused-arguments and ccache clang++ -Qunused-arguments). Maybe try to run something like ccache clang --version.

@aqrln aqrln added build Issues and PRs related to build files or the CI. macos Issues and PRs related to the macOS platform / OSX. labels Nov 22, 2017
@mgol
Copy link
Contributor Author

mgol commented Nov 22, 2017

I don't seem to have the ccache command available. 🤔 Weird, I definitely have XCode & CLT installed. Homebrew doesn't complain and I've been able to install native Node deps that weren't pre-compiled (like node-sass) and it worked.

@aqrln
Copy link
Contributor

aqrln commented Nov 22, 2017

ccache isn't a part of XCode and CLT, nor even a part of what one would call a "standard" C/C++ toolchain. If you haven't modified your CC and CXX environment variables yourself on purpose to use ccache, it's kinda weird how it got there. I'd suggest you to check your .bashrc/.bash_profile/.zshrc.

@mgol
Copy link
Contributor Author

mgol commented Nov 22, 2017

You're right, I had CC etc. redefined in ~/.zshrc; a byproduct of trying to compile Chromium in the past...

Sorry for taking your time and thanks for help! I'm closing the issue.

@mgol mgol closed this as completed Nov 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. macos Issues and PRs related to the macOS platform / OSX.
Projects
None yet
Development

No branches or pull requests

2 participants