Hi,
I am trying to compile the runtime only for aarch64. I would like to use the runtime on a aarch64 qemu vm (for the time being before testing on the actual hardware - for this “question” the target device is irrelevant since i want to cross compile (on a x86 host) the runtime for aarch64.
In this thread https://discuss.tvm.apache.org/t/why-do-we-need-to-build-tvm-runtime-on-remote-device-for-auto-tvm/2866/10 it is suggested to use a bunch of flags at the cmake level. The compiler that i am using is aarch64-linux-gnu-gcc-8 and I am working in a docker container that is an instance of the following image https://github.com/apache/tvm/blob/main/docker/Dockerfile.ci_cpu.
Inside the container, i clone the tvm source code and i execute
mkdir build cd build cp …/cmake/config.cmake . cmake …
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_VERSION=1
-DCMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc-8
-DCMAKE_CXX_COMPILER=/usr/bin/aarch64-linux-gnu-g+±8
-DCMAKE_FIND_ROOT_PATH=/usr/aarch64-linux-gnu
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY
all goes well until the linking part
It looks like there is an issue linking with libbacktrace, any clue why this is happening? maybe some flags should be passed when compiling libbacktrace?
as a workaround, i did the following to disable linking against libbacktrace to disable linking against libbacktrace (i am not sure what consequences this has, but the runtime .so was produced and i did not get any errors:
cmake …
-DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_VERSION=1
-DCMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc-8
-DCMAKE_CXX_COMPILER=/usr/bin/aarch64-linux-gnu-g+±8
-DCMAKE_FIND_ROOT_PATH=/usr/aarch64-linux-gnu
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY
-DCMAKE_C_FLAGS="-DTVM_USE_LIBBACKTRACE=0" \
-DCMAKE_CXX_FLAGS="-DTVM_USE_LIBBACKTRACE=0"
are there up to date instructions on cross compiling the runtime for aarch64 (and riscv [didn’t try that yet])
tnx,