I have what I would call more of a specific question.
I’m currently working on an iOS app in Swift, using the Swift Package “Python-iOS” (https://github.com/kewlbear/Python-iOS). The developer of this package also released another package called “NumPy-iOS”, enabling developers to use numpy in their Swift projects.
My next steps for my project involve implementing matplotlib. To do that, I decided to dig deeper into how the package NumPy-iOS was created. In the process, I found out that the libary is compiled using a toolchain from a project called “kivy-ios”, that basically lets you create kivy applications inside of Xcode. So I tried to compile both numpy (as a dependency of matplotlib) and matplotlib and tried to recreate the package structure of NumPy-iOS. I managed to get the package to build but my plans failed when I tried to implement it into my project.
I constantly get errors like
Undefined symbols for architecture arm64:
"_PyDescr_IsData", referenced from:
___Pyx_Coroutine_Send in libnumpy.a(_common.cpython-310-darwin.so.o)
"_PyIter_Send", referenced from:
___Pyx_Generator_Next in libnumpy.a(_common.cpython-310-darwin.so.o)
___Pyx_Coroutine_Send in libnumpy.a(_common.cpython-310-darwin.so.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I think this is because the compiled packages are not properly linked to Swift but I don’t really have a clue how to really do that.
Does anyone know how to properly compile a python package using kivy-ios’s recipes and using them in a native Swift project? It would already help if someone could explain to me where exactly the “Undefined symbol” error comes from.
Thanks in advance and best regards