Open zouzhe1 opened 9 months ago
use this to create 2G of extra swap memory...
sudo fallocate -l 2G /swapfile # Adjust size as needed (2G in this example)
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
Since lely_core_libraries is generated for x86 architecture, you need to modify the CMakeLists.txt of this package.
if(CMAKE_CROSSCOMPILING) set(CONFIGURE_COMMAND_PREFIX . ${CMAKE_CURRENT_SOURCE_DIR}/arm64_toolchain.sh &&) set(CONFIGURE_HOST_OPTION --host=aarch64-linux-gnu) else() set(CONFIGURE_COMMAND_PREFIX "") set(CONFIGURE_HOST_OPTION "") endif()
CONFIGURE_COMMAND ${CONFIGURE_COMMAND_PREFIX} autoreconf -i
export CC=/usr/bin/aarch64-linux-gnu-gcc export CXX=/usr/bin/aarch64-linux-gnu-g++ export AR=/usr/bin/aarch64-linux-gnu-ar export AS=/usr/bin/aarch64-linux-gnu-as export LD=/usr/bin/aarch64-linux-gnu-ld export STRIP=/usr/bin/aarch64-linux-gnu-strip export RANLIB=/usr/bin/aarch64-linux-gnu-ranlib
Probably not the most logical thing to do, but it worked for me so I could compile x86 and arm64 separately.
Target Device: Raspberry Pi 4B with Ubuntu 22, Local Device: x86_64 with Ubuntu 22.
Due to the limited memory on my Raspberry Pi 4B, the compilation speed of ROS 2 CANopen is extremely slow, and it often freezes.
Therefore, I intend to perform cross-compilation on my PC.
How should I proceed with cross-compilation?
It would be preferable if you could provide a binary version that can be installed using sudo.