Skip to content

Conversation

jhen0409
Copy link
Collaborator

@jhen0409 jhen0409 commented Feb 4, 2025

This reverts #10525 and make swift package works at latest commit.

Reasons:

  • The swift package can't run cmake if llama.cpp is imported from SPM by any Xcode project. For example, we should able to use llama package by add to Package Dependencies:
Screenshot 2025-02-04 at 16 22 10
  • If we want to build llama-swiftui example for other platform like visionOS or tvOS, the building process will being complicated.

We may can include dylib or xcframework to the package, but we would need upload binaries to other places and use binaryTarget.

@jhen0409 jhen0409 requested a review from slaren February 4, 2025 08:37
@github-actions github-actions bot added the devops improvements to build systems and github actions label Feb 4, 2025
@jhen0409 jhen0409 marked this pull request as ready for review February 4, 2025 08:46
@slaren
Copy link
Member

slaren commented Feb 4, 2025

The problem is still that duplicating the build process in Package.swift is not reasonable. The build script is updated continuously, and it is simply not reasonable to duplicate all the behavior of the cmake build scripts in the Package.swift. The solution must be able to use cmake to build llama.cpp.

I don't know anything about Swift, that was just the solution that I found after a quick search, but I am sure that a experienced Swift programmer could come up with a solution that satisfies all the requirements.

@VJHack
Copy link
Contributor

VJHack commented Feb 12, 2025

@jhen0409 I tested llama.swiftui off of your branch and I was able to build and run the application on my iOS device. However, when I load a model and send a prompt, the app crashes. Are you experiencing the same thing?

I tested this on a previous commit way before CMake was added and it worked. This issue might not necessarily be related to your PR, but I'm just curious if you've tested llama.swiftui on iOS yet. Thanks!

@jhen0409
Copy link
Collaborator Author

@jhen0409 I tested llama.swiftui off of your branch and I was able to build and run the application on my iOS device. However, when I load a model and send a prompt, the app crashes. Are you experiencing the same thing?

I tested this on a previous commit way before CMake was added and it worked. This issue might not necessarily be related to your PR, but I'm just curious if you've tested llama.swiftui on iOS yet. Thanks!

Some fixes has been pushed into master, but not included in this branch.

@ggerganov
Copy link
Member

Superseded by #11996

@ggerganov ggerganov closed this Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops improvements to build systems and github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants