ml-explore / mlx-swift

Swift API for MLX
https://ml-explore.github.io/mlx-swift/
MIT License
526 stars 40 forks source link

please support namespace in the Package.swift #110

Closed shuhongwu closed 1 month ago

shuhongwu commented 1 month ago

If the Xcode proj has both llama.cpp and mlx.swift. we will get duplicate symbol errors:

` duplicate symbol '_gguf_get_key' in: /Users/alex/Library/Developer/Xcode/DerivedData/xxxxx-eljaqnyrtudtxpgvajsemjrllabz/Build/Products/Debug-iphonesimulator/llama.o /Users/alex/Library/Developer/Xcode/DerivedData/xxxxx-eljaqnyrtudtxpgvajsemjrllabz/Build/Products/Debug-iphonesimulator/Cmlx.o ld: 1 duplicate symbols clang: error: linker command failed with exit code 1 (use -v to see invocation)

`

davidkoski commented 1 month ago

That comes from https://github.com/antirez/gguf-tools/. mlx certainly uses it and I suppose llama.cpp must too. You can only link it once because it has public symbols.

@awni any thoughts here? Cmlx (the wrapper around mlx core) looks like it re-exports it. I don't think we have any control over that on the swiftpm side. Do other people try this and run into problems?

shuhongwu commented 1 month ago

Oh,that's make sense~ I will close this issue.

awni commented 1 month ago

Hmm, we should build without GGUF support in MLX Swift / MLX C (MLX_BUILD_GGUF=OFF). We don't support it in the API anyway so it doesn't make sense to include it right?

davidkoski commented 1 month ago

Ah, interesting! Filed an issue for that, yes we can simplify the build by removing that.