Describe the bug
After upgrading to the latest version of MLX, building my project for the iOS Simulator (arm64) fails with the following linker errors:
Undefined symbols for architecture arm64:
"_MTLIOErrorDomain", referenced from:
___cxx_global_var_init.3775 in Cmlx.o
"_MTLTensorDomain", referenced from:
___cxx_global_var_init.3746 in Cmlx.o
This issue only occurs when building for the simulator. Real device builds succeed without errors.
To Reproduce
It should be easy to reproduce.
Desktop (please complete the following information):
- OS Version: MacOS 15.7.2, XCode 26.1.1
- Device: iPhone 17 Simulator
- Version 0.30.2
Additional context
There's an easy workaround:
#if TARGET_OS_SIMULATOR
#import <Foundation/Foundation.h>
NSErrorDomain MTLIOErrorDomain = @"MTLIOErrorDomain";
NSErrorDomain MTLTensorDomain = @"MTLTensorDomain";
#endif