You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would love to use MLX Swift inside an Xcode playground, to get an environment similar to Jupyter notebooks. However when I try to do this, I get an error:
libc++abi: terminating due to uncaught exception of type std::runtime_error: library not found
Failed to load device library from <default.metallib> or </Users/rounak/Library/Developer/Xcode/DerivedData/FooTest-bkqaiyzcinmaprfeeunnqmandcdl/Build/Intermediates.noindex/Playgrounds/Products/Debug/PackageFrameworks/Cmlx.framework/Versions/A/mlx.metallib>.
I think the problem is that mlx-swift isn't a framework, it is a SPM library. I tried making a new framework in your Xcode project:
I also switched mlx-swift to the main branch -- the 0.1 tag is quite old and we haven't been making new tags (maybe we (I) should).
OK, once the framework is created then we can set up a scheme for the playground and tell it to link against that framework. I was looking at this page as I wasn't familiar with how to do that:
Anyway, the error comes from the fact that there was no place to attach the resources. You have a command line program and it can link to frameworks but can't contain them.
I was unable to run the playground, but that is because my environment isn't set up properly (with multiple Xcode versions), but I think this might work.
I would love to use MLX Swift inside an Xcode playground, to get an environment similar to Jupyter notebooks. However when I try to do this, I get an error:
You can try to reproduce by cloning this repo: https://github.com/rounak/TestRepoMLXPlayground
The text was updated successfully, but these errors were encountered: