Developer Tools for Windows LLVM Error When Building iOS Metal Library

When trying to build a metal library from a shader with the Metal Developer Tools for Windows 1.2 i'm getting the following error:

Code Block
MetalDeveloperTools\ios\bin\metal -c test.metal -o test.air
MetalDeveloperTools\ios\bin\metallib test.air -o test.metallib
LLVM ERROR: Error opening 'MetalDeveloperTools\ios\bin\..\lib\clang\31001.138\lib\darwin\libmetal_rt_osx_air2.2.a': no such file or directory!


I noticed that libmetal_rt_osx_air2.2.a is a file in the macos folder, so I tried running the below command and it seems to build with no errors, but haven't had the opportunity to test the library yet.

Code Block
MetalDeveloperTools\macos\bin\metallib test.air -o test.metallib

Is this a bug? Is it okay to mix targets like this?

Accepted Reply

Please specify an iOS or tvOS deployment target when using the tools from the iOS directory. Similarly, use a macOS deployment target when using tools from the macOS directory.

For example the following would work:
Code Block
MetalDeveloperTools\ios\bin\metal -target air64-apple-ios14.0 -c test.metal -o test.air
MetalDeveloperTools\ios\bin\metallib test.air -o test.metallib

We recommend using the metal as a driver to do your linking as well as:
Code Block
MetalDeveloperTools\ios\bin\metal -target air64-apple-ios14.0 test.air -o test.metallib

Or you could do all this in a single line as:
Code Block
MetalDeveloperTools\ios\bin\metal -target air64-apple-ios14.0 test.metal -o test.metallib


You should not mix targets and tools in your workflow.

Replies

Please specify an iOS or tvOS deployment target when using the tools from the iOS directory. Similarly, use a macOS deployment target when using tools from the macOS directory.

For example the following would work:
Code Block
MetalDeveloperTools\ios\bin\metal -target air64-apple-ios14.0 -c test.metal -o test.air
MetalDeveloperTools\ios\bin\metallib test.air -o test.metallib

We recommend using the metal as a driver to do your linking as well as:
Code Block
MetalDeveloperTools\ios\bin\metal -target air64-apple-ios14.0 test.air -o test.metallib

Or you could do all this in a single line as:
Code Block
MetalDeveloperTools\ios\bin\metal -target air64-apple-ios14.0 test.metal -o test.metallib


You should not mix targets and tools in your workflow.