When dependencies are installed with qemu-chroot, the root file system may contain symlinks similar to the following: /usr/lib/aarch64-linux-gnu/libXXXX.so -> /lib/aarch64-linux-gnu/libXXXX.so.versio.no.
These symlinks resolve on the arm64 platform but are broken on the host system. Attempts to link libXXXX.so are unsuccessful.To correct broken symlinks
The broken symlinks can be fixed temporarily with overlays, using commands similar to the following:
Thank you for your kind guidance, it’s very helpful for me. After the step of “Preparing a Cross-Compilation Sysroot” and “Fixing Broken Symlinks”, I tried to install ROS Melodic using the following command sudo apt install ros-melodic-desktop instead of using python, folloing error of unmet dependencies was encountered. BTW, my host PC has installed DRIVE Software 10.0 via SDK Manager.
sophia@ZBook:~/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_E3550/DRIVEOS/drive-t186ref-linux/targetfs_a$ sudo apt install ros-melodic-desktop
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ros-melodic-desktop : Depends: ros-melodic-common-tutorials but it is not going to be installed
Depends: ros-melodic-geometry-tutorials but it is not going to be installed
Depends: ros-melodic-robot but it is not going to be installed
Depends: ros-melodic-ros-tutorials but it is not going to be installed
Depends: ros-melodic-urdf-tutorial but it is not going to be installed
Depends: ros-melodic-visualization-tutorials but it is not going to be installed
Depends: ros-melodic-viz but it is not going to be installed
As for the error, I have tried several methods to solve it,like update package, all didn’t work. But when I tried to install ROS Melodic in emulated Root command line, no errors similar with upper unmet dependencies occur. I feel confused and want to figure it out what the difference is. And if there’s better method to solve the unmet dependencies problem.
I have the same issue as pan.zhang – I can’t install ROS melodic or any of its dependencies while in the chroot.
Also, the /etc/apt/sources.list inside targetfs_a is empty, so I’m not sure how apt-get would be able to find any dependencies anyway.
I don’t think this is a ROS installation issue because of the empty sources.list, and because I could install ROS melodic just fine on my host machine.
Why do you need to install ROS melodic in chroot? This topic is about source installation of cross compilation. You can scp them to the target after cross compiling. Thanks!
These are the contents of that file now – I was just finishing a fresh install of the DriveWorks target tools after previous failures, which must be why it’s no longer empty:
# deb cdrom:[Ubuntu 18.04.4 LTS _Bionic Beaver_ - Release amd64 (20200203.1)]/ bionic main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner
deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb [arch=amd64,i386] http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
On my fresh SDK Drive AGX install. I notice I dont have the DRIVE_Software_10.0_Linux_OS_E3550 but I do have the DRIVE_Software_10.0_Linux_OS_DDPX folder which matches the same contents.
Going further down on the procedure. I am getting the following messages:
root@obelisk:/# mkdir /lib/aarch64-linux-gnu
/bin/mkdir: cannot create directory ‘/lib/aarch64-linux-gnu’: File exists
root@obelisk:/# mkdir /tmp/ros-cc-overlayfs
/bin/mkdir: cannot create directory ‘/tmp/ros-cc-overlayfs’: File exists
root@obelisk:/# mount -t overlay -o lowerdir=$SYSROOT/lib/aarch64-linux-gnu,upperdir=/lib/aarch64-linux-gnu,workdir=/tmp/ros-cc-overlayfs overlay /lib/aarch64-linux-gnu
mount: /lib/aarch64-linux-gnu: mount(2) system call failed: Too many levels of symbolic links.
Following with ROS steps: got also another error:
root@obelisk:/# apt --fix-broken install
Reading package lists… Done
Building dependency tree
Reading state information… Done
Correcting dependencies… Done
The following packages were automatically installed and are no longer required:
cuda-command-line-tools-10-2 cuda-compiler-10-2 cuda-cudart-dev-10-2
cuda-cuobjdump-10-2 cuda-cupti-10-2 cuda-driver-dev-10-2 cuda-gdb-10-2
cuda-gpu-library-advisor-10-2 cuda-memcheck-10-2 cuda-misc-headers-10-2
cuda-nvcc-10-2 cuda-nvdisasm-10-2 cuda-nvprof-10-2 cuda-nvprune-10-2
cuda-nvrtc-dev-10-2 cuda-nvtx-10-2 libcublas-dev libcublas10
Use ‘sudo apt autoremove’ to remove them.
The following additional packages will be installed:
python-catkin-pkg-modules python-rospkg-modules
The following NEW packages will be installed:
python-catkin-pkg-modules python-rospkg-modules
0 upgraded, 2 newly installed, 0 to remove and 302 not upgraded.
44 not fully installed or removed.
Need to get 0 B/65.9 kB of archives.
After this operation, 390 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
debconf: delaying package configuration, since apt-utils is not installed
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such device)
(Reading database … 93408 files and directories currently installed.)
Preparing to unpack …/python-catkin-pkg-modules_0.4.22-1_all.deb …
Unpacking python-catkin-pkg-modules (0.4.22-1) …
dpkg: error processing archive /var/cache/apt/archives/python-catkin-pkg-modules_0.4.22-1_all.deb (–unpack):
trying to overwrite ‘/usr/lib/python2.7/dist-packages/catkin_pkg/init.py’, which is also in package python-catkin-pkg 0.3.9-1
Preparing to unpack …/python-rospkg-modules_1.2.8-1_all.deb …
Unpacking python-rospkg-modules (1.2.8-1) …
dpkg: error processing archive /var/cache/apt/archives/python-rospkg-modules_1.2.8-1_all.deb (–unpack):
trying to overwrite ‘/usr/lib/python2.7/dist-packages/rospkg/init.py’, which is also in package python-rospkg 1.1.4-1
Errors were encountered while processing:
/var/cache/apt/archives/python-catkin-pkg-modules_0.4.22-1_all.deb
/var/cache/apt/archives/python-rospkg-modules_1.2.8-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Not sure if it is related to QEMU or mounting procedure. Can you advise?
Without “sudo”, you don’t see messages like “Unknown host QEMU_IFLA type: 50” anymore, right?
I haven’t seen the issue before. Please try with run all the steps in my initial post with non root user (using sudo as my command lines) and “export SYSROOT=~/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_DDPX/DRIVEOS/drive-t186ref-linux/targetfs_a” (matching your path after DRIVE Software 10.0 installation).
Correct. Without sudo I don’t see the QEMU_XXX messages anymore. I am going to try again the steps in couple systems where the SDK is installed and provide feedback.
I tried to start another cross-compilation attempt on a third system but I am getting an error related " cannot find -lpthreads". I grep the source and I couldn’t find anything that points to directly use -lpthreads.so .
Attaching CMAKE error log but wondering what could change since my previous attempt which worked fine.
jvilela@soads-gpu-4:/opt/nvidia/nvidia_sdk/DRIVE_Software_10.0_Linux_OS_DDPX/DRIVEOS/drive-t186ref-linux/targetfs_a$ sudo mount -t overlay -o lowerdir=$SYSROOT/lib/aarch64-linux-gnu,upperdir=/lib/aarch64-linux-gnu,workdir=/tmp/ros-cc-overlayfs overlay /lib/aarch64-linux-gnu
mount: /lib/aarch64-linux-gnu: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.