-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Runtime error on iOS #1010
Comments
The error message describes the root cause. incompatible protobuf library are used in *.cc and *.h. I guess this library is built with non-standard way. Could you provide the details of how this SentencePiece library was built? |
I cloned the master branch, and generated the xcodeproj file via: That's it. I'm linking against the static library in my iOS project. |
I looked through the cmake file, by default sentencepiece uses the pre-built generated protobuf. It seems |
Right. SPM_PROTOBUF_PROVIDER=package will allow you to build the protobuf already installed on your system. |
@taku910 I'm not sure if I understand correctly. If I use |
It is possible that the linkage is mismatched: in the case of internal, sentencepiece is linking to the internal library. On the other hand, if the parent project (iPhone) is trying to link another version of the sentencepiece, duplication will occur. |
@l3utterfly were you able to find a work-around? I am seeing the same issue. Thank you! |
@iprovalo I believe the issue was with iOS minimum version. I recently upgraded to support minimum version iOS 15.5 and the problem went away |
@l3utterfly thank you very much! |
I am still running into this issue if I use a static xcframework. The way I am building it is by first adding this modification to CMakeList.txt (to avoid
Then creating both a dynamic and static xcframework like so (I tried the deployment target 15.5, same results):
|
I ended up wrapping the static sentencepiece lib in an XCode Framework, and it worked. |
After building for iOS 17, I get this error when loading a model:
Error:
The text was updated successfully, but these errors were encountered: