Building Min on MacOS: No CMAKE_C_COMPILER could be found.
Joe Kaplan
4月 04 2022 | 6:58 午後
Greetings all,
I've made such great progress on my externals that I'm ready to try some cross platform support! First step, get Min to build on MacOS. I'm very unfamiliar with MacOS ecosystems, so I was hoping the initial steps here would be easy. That doesn't seem to be the case.
I'm on a MacBook Pro, 2020, Apple M1, maxOS Monterey 12.2.1
Basically a fresh install.
Here's what I've tried so far:
* Install Xcode from the Appstore. Done. (whew)
* Go to the Package Manager in Max and install Min-Devkit. Done
* Launch Min-Devkit from Package Manager, click Create a Package, press the big button, enter a name.
Reports an error in the Max Console: min.project: A problem occurred trying to create the new package
So... let's try cloning from github, and following the directions there.
* Delete the min-devkit folder that Package Manager installed.
* run git clone https://github.com/Cycling74/min-devkit.git --recursive. Done.
* mkdir build -> cd build -> cmake -G Xcode .. -> "error. unknown command Cmake."
* install homebrew. Done.
* brew install cmake . Done.
* cmake -G Xcode .. -> This time it tries do do something. But it fails per the image below.
I have attached the two logs suggested as well.
Any advise would be much appreciated. Looking forward to be able to share my work with my Mac-using colleagues. Thanks!
The system is: Darwin - 21.3.0 - arm64
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Joe Kaplan
4月 04 2022 | 7:07 午後
Nevermind! I searched some of the errors in the log and found this page:
https://github.com/nodejs/node-gyp/issues/569
after i ran the command below min built happily.
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Laurent Clercq-Roques
10月 04 2023 | 8:38 午前
Thank you Joe!
Lukas Haas
4月 03 2024 | 4:04 午後
i second Laurent, Joe's command line solved my problem with the CMake error as well. Thanks :)