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

Add notes on possible additional xcode setup for mac users #48

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

memco
Copy link

@memco memco commented Nov 17, 2023

When trying to install Orca on mac this message appeared: "xcrun: error: unable to find utility "metal", not a developer tool or in PATH" The instructions as explained here solve the issue: gfx-rs/gfx#2309 (comment)

When trying to install Orca on mac this message appeared: "xcrun: error: unable to find utility "metal", not a developer tool or in PATH" The instructions as explained here solve the issue: gfx-rs/gfx#2309 (comment)
@martinfouilleul
Copy link
Collaborator

I was a little confused at first by what the switch command does (the last sentence can sound like the command makes sure Xcode.app is installed). I would maybe reword it in a more verbose/explicit way, eg:

- Mac Only: both the Xcode app and the Xcode command-line tools must be installed:  
 	- Make sure the Xcode app is installed, or install it from the app store.
 	- The command line tools can be installed with `xcode-select --install`.
         - If xcode-select --print-path prints /Library/Developer/CommandLineTools, then run `sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer`

Is that correct? If so I can make that change myself when I'm back at my work computer, or you can do it and I'll merge it.
Anyway thanks for the PR!

@bvisness
Copy link
Collaborator

I'm confused by this because I'm pretty sure I have not installed full Xcode on my Mac, and yet have had no trouble running these utilities. Can we confirm what version of Mac you (the OP) are using and which Xcode-related utilities are installed when you don't download the full app?

@memco
Copy link
Author

memco commented Nov 21, 2023

As for system info, I have an M2 macbook air running MacOS 14.1.1 (23B81)

λ xcode-select --version
xcode-select version 2403.
λ xcodebuild -version                                                                                            
Xcode 15.0.1
Build version 15A507

I do not believe I had run xcode-select or installed xcode since updating to 14, but I am fairly sure I had at least run xcode-select on prior versions of MacOS.

I started with just trying to run xcode-select --install but that didn't solve the issue. I still had this error:

~/.pyenv/versions/3.10.7/bin/python orca dev build-runtime
Building Orca platform layer...
xcrun: error: unable to find utility "metal", not a developer tool or in PATH
ERROR: The following command failed with code 72:
xcrun -sdk macosx metal -fno-fast-math -c -o build/mtl_renderer.air src/graphics/mtl_renderer.metal

Task failed with 1 error:
ERROR: The following command failed with code 72:
xcrun -sdk macosx metal -fno-fast-math -c -o build/mtl_renderer.air src/graphics/mtl_renderer.metal

My search for that error led to the fix I linked in the PR description.

I have tried uninstalling both xcode and the xcode cli tools from and tried just reinstalling via xcode-select --install, but the above error returns. I then reinstalled xcode and tested both paths:

(*main) λ /Users/michael/.pyenv/versions/3.12.0/bin/python orca dev build-runtime
Building Orca platform layer...
xcrun: error: unable to find utility "metal", not a developer tool or in PATH
ERROR: The following command failed with code 72:
xcrun -sdk macosx metal -fno-fast-math -c -o build/mtl_renderer.air src/graphics/mtl_renderer.metal

Task failed with 1 error:
ERROR: The following command failed with code 72:
xcrun -sdk macosx metal -fno-fast-math -c -o build/mtl_renderer.air src/graphics/mtl_renderer.metal
(*main) λ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
(*main) λ /Users/michael/.pyenv/versions/3.12.0/bin/python orca dev build-runtime
Building Orca platform layer...
Building wasm3...
Building Orca runtime...
Task completed successfully.
sudo xcode-select --switch /Library/Developer/CommandLineTools
Password:
(*main) λ /Users/michael/.pyenv/versions/3.12.0/bin/python orca dev build-runtime
Building Orca platform layer...
xcrun: error: unable to find utility "metal", not a developer tool or in PATH
ERROR: The following command failed with code 72:
xcrun -sdk macosx metal -fno-fast-math -c -o build/mtl_renderer.air src/graphics/mtl_renderer.metal

Task failed with 1 error:
ERROR: The following command failed with code 72:
xcrun -sdk macosx metal -fno-fast-math -c -o build/mtl_renderer.air src/graphics/mtl_renderer.metal

Using the xcode-select --switch ... is only needed if the xcrun command fails to find metal so maybe it would be better to put this note in the after the python orca dev build-runtime instruction:

Install the Orca dev tools. If on Windows, the tool can automatically add orca to your PATH. Otherwise, you must manually add the Orca install directory to your PATH, e.g. by updating .zshrc or .bashrc.

If on MacOS the above command fails with the error:

xcrun: error: unable to find utility "metal", not a developer tool or in PATH
ERROR: The following command failed with code 72:
xcrun -sdk macosx metal -fno-fast-math -c -o build/mtl_renderer.air src/graphics/mtl_renderer.metal

And xcode-select --print-path prints /Library/Developer/CommandLineTools
Install the full xcode Application from the App Store and then run sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants