You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CMake cross compilation assumes a host build of the compiler is needed #4520
CMAKE_CROSSCOMPILING (docs) can be set by toolchain files under a variety of circumstances.
#4512 builds IREE's Java bindings using CMake under Gradle. This invokes a runtime-only build using an Android NDK toolchain.
However, we have this code in our root CMakeLists.txt that assumes cross compilation builds will always want a host build of the compiler parts of the project:
Lei and I were chatting about some of this yesterday - the goal of resolving #4323 is to remove the split-transition style single-command-to-build-both-host-compiler-and-target-runtime. If you want to build the compiler you should have to configure and make for the host, and if you want to build the runtime for a different target you should have to configure again. That removes a tremendous amount of the deps in here and simplifies things a lot: pip install of compiler + configure/make for target runtime should work naturally, etc.
Agreed that getting to a state where configure+make for host and configure+make for target are separate steps will be a natural solution. For this particular case, we could either put up with the weirdness as it affects the Java bindings or add some special handling (like our own IREE_CROSS_COMPILING that makes it explicit or consider IREE_BUILD_JAVA_BINDINGS when deciding how to treat cross compilation).
I'm not sure we should do anything for the java bindings until we clean things up - I'm honestly still not sure we even want anyone using these bindings at all (and instead using tflite via java) - which may require some of the same infra - but we should only add complexity where we need it - things are already too confusing/broken :/
Activity
benvanik commentedon Jan 14, 2021
Lei and I were chatting about some of this yesterday - the goal of resolving #4323 is to remove the split-transition style single-command-to-build-both-host-compiler-and-target-runtime. If you want to build the compiler you should have to configure and make for the host, and if you want to build the runtime for a different target you should have to configure again. That removes a tremendous amount of the deps in here and simplifies things a lot: pip install of compiler + configure/make for target runtime should work naturally, etc.
Basically, instead of any of the IREE_HOST_* flags we should just use the cmake standard toolchain variables - and once we do that we should be able to invoke cmake for a bajillion targets just like ncnn https://github.com/Tencent/ncnn/tree/master/.github/workflows
ScottTodd commentedon Jan 14, 2021
Agreed that getting to a state where configure+make for host and configure+make for target are separate steps will be a natural solution. For this particular case, we could either put up with the weirdness as it affects the Java bindings or add some special handling (like our own
IREE_CROSS_COMPILINGthat makes it explicit or considerIREE_BUILD_JAVA_BINDINGSwhen deciding how to treat cross compilation).benvanik commentedon Jan 14, 2021
I'm not sure we should do anything for the java bindings until we clean things up - I'm honestly still not sure we even want anyone using these bindings at all (and instead using tflite via java) - which may require some of the same infra - but we should only add complexity where we need it - things are already too confusing/broken :/
Remove custom CMake cross compilation for Android. (#4584)