Help cross-compiling grpcio #137
-
Hello, I'm desperately trying to cross compile grpcio from ubuntu (x86_64) to android (aarch64).
So, evidently, the compiler is complaining because of the '-std=c++14' used for a C source file. The question is: how can I remove that flag for C source files ONLY, leaving it for C++ files? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This seems like an upstream issue. From their setup.py, it looks like they're building a ton of C and C++ with identical flags. For gcc, compiling a C file with It seems like you're using NDK r25b, so switching to gcc probably isn't an option. Maybe you can just remove the I'm looking at this part of their setup.py, and it looks like you might be able to set the environment variable |
Beta Was this translation helpful? Give feedback.
-
It took some hours of "compile - get error - find solution" looping, but I've finally managed to cross-compile grpcio using crossenv. Thanks for pointing me in the right direction. I'll leave my findings here for future reference. |
Beta Was this translation helpful? Give feedback.
It took some hours of "compile - get error - find solution" looping, but I've finally managed to cross-compile grpcio using crossenv. Thanks for pointing me in the right direction. I'll leave my findings here for future reference.
Python version (for both build and host): 3.10.5
grpcio source code version: 1.49.1
COMPILE_ARGS: I removed "-std=c++14", nothing else.
LINK_ARGS: I removed "-lpthread" and "-lrt" (they don't have an Android counterpart as they are integrated in libc), and I added "-llog" and "-static-libstdc++" (without those two, I was getting runtime "cannot locate symbol" errors).
Then, I had to set the "GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY" flag to true to get past other …