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

Xcode refuses to build or do anything after adding https://github.com/ml-explore/mlx-swift-examples/ as dependency #145

Open
coratype opened this issue Oct 18, 2024 · 6 comments

Comments

@coratype
Copy link

coratype commented Oct 18, 2024

created a new project in Xcode, completely blank slate, added the

https://github.com/ml-explore/mlx-swift-examples/

dependency as the readme says, and the build just refuses to build. no error or anything, just doesnt do anything?

edit: randomly decides to build, but when i try to "import LLM" it says no such module LLM

@davidkoski
Copy link
Collaborator

You will need to set up targets in your project and set dependencies on the libraries provided by mlx-swift-examples. S something like this:

image

@davedelong
Copy link

I'm also hitting the "no such module 'LLM'" error and am quite baffled as to why.

@davidkoski
Copy link
Collaborator

If you are getting it via the swiftpm file (Package.swift) then it is called MLXLLM (to better match the mlx-swift libraries):

        .library(
            name: "LLM",
            targets: ["MLXLLM"]),

I am working on VLM support in #151 and part of that will make this much more consistent.

@davedelong
Copy link

davedelong commented Nov 14, 2024

I've added it as a package dependency in my xcodeproj using Xcode 15.4. Xcode recognizes the LLM product and can add it as a dependency to my other targets, but when I compile it has the missing module error. I think this might be flaw in the Xcode build system related to the mismatch between the library name ("LLM") and the target name ("MLXLLM"). I'm continuing to investigate.

@davidkoski
Copy link
Collaborator

OK, let me know what you find out -- I think we should probably make the directory/target/library/module all match. The mismatch was from the Project.swift but I think whoever set that up had the better idea.

@davedelong
Copy link

ok, so I just tried a private fork of mlx-swift-examples that only changed the library name from LLM to MLXLLM and Xcode 15.4 had no problems.

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

No branches or pull requests

3 participants