PCL 1.8 built failed in PX2 (Solved)

Hi All,

I suffered PCL buit failed in PX2 but no this error in my HOST, please refer below log. Any idea on it?

nvidia@nvidia:~/work/pcl/build$ make
[ 4%] Built target pcl_common
[ 5%] Built target pcl_octree
[ 6%] Built target pcl_io_ply
make[2]: *** No rule to make target ‘/usr/lib/aarch64-linux-gnu/libGL.so’, needed by ‘lib/libpcl_io.so.1.8.1.99’. Stop.
CMakeFiles/Makefile2:232: recipe for target ‘io/CMakeFiles/pcl_io.dir/all’ failed
make[1]: *** [io/CMakeFiles/pcl_io.dir/all] Error 2
Makefile:160: recipe for target ‘all’ failed
make: *** [all] Error 2
nvidia@nvidia:~/work/pcl/build$

Similar problem also was happened in TX1/TX2.
http://www.pcl-users.org/Problems-installing-on-Tegra-TX1-aarch64-td4044499.html

I have been googling any solution for it. Thanks!

Gary

Dear garywang,

Would you like to try the following method? Thanks.
There is a hack to enable libGL.so
You can rename libdrm.a into libdrm_static.a in /usr/lib/aarch64/…
And then link it with option -Wl,–whole-archive -ldrm_static -Wl,–no-whole-archive added.

There is not tegra’s libGL.so in my DRIVERWORK 0.6 w/ PX2. So I made link to mesa/libGL.so (sudo ln -sf mesa/libGL.so libGL.so
). Does PX2 need specific Tegra’s LibGL.so? I still suffered following error even mesa’s libgl.so linked,

/usr/lib/gcc/aarch64-linux-gnu/5/…/…/…/aarch64-linux-gnu/libGL.so: undefined reference to drmMap' /usr/lib/gcc/aarch64-linux-gnu/5/../../../aarch64-linux-gnu/libGL.so: undefined reference to drmCloseOnce’
/usr/lib/gcc/aarch64-linux-gnu/5/…/…/…/aarch64-linux-gnu/libGL.so: undefined reference to drmUnmap' /usr/lib/gcc/aarch64-linux-gnu/5/../../../aarch64-linux-gnu/libGL.so: undefined reference to drmOpenOnce’

Does
TX2’s similar solution (https://devtalk.nvidia.com/default/topic/1007290/jetson-tx2/building-opencv-with-opengl-support-/post/5141945/#5141945 ) is suitable for PX2? Thanks!

I list log for your reference,

/usr/lib/gcc/aarch64-linux-gnu/5/…/…/…/aarch64-linux-gnu/libGL.so: undefined reference to drmMap' /usr/lib/gcc/aarch64-linux-gnu/5/../../../aarch64-linux-gnu/libGL.so: undefined reference to drmUnmap’
/usr/lib/gcc/aarch64-linux-gnu/5/…/…/…/aarch64-linux-gnu/libGL.so: undefined reference to drmGetDevices2' /usr/lib/gcc/aarch64-linux-gnu/5/../../../aarch64-linux-gnu/libGL.so: undefined reference to drmFreeDevice’
/usr/lib/gcc/aarch64-linux-gnu/5/…/…/…/aarch64-linux-gnu/libGL.so: undefined reference to drmGetDeviceNameFromFd2' /usr/lib/gcc/aarch64-linux-gnu/5/../../../aarch64-linux-gnu/libGL.so: undefined reference to drmOpenOnce’
/usr/lib/gcc/aarch64-linux-gnu/5/…/…/…/aarch64-linux-gnu/libGL.so: undefined reference to drmGetDevice2' /usr/lib/gcc/aarch64-linux-gnu/5/../../../aarch64-linux-gnu/libGL.so: undefined reference to drmFreeDevices’
collect2: error: ld returned 1 exit status
tools/CMakeFiles/pcl_tiff2pcd.dir/build.make:291: recipe for target ‘bin/pcl_tiff2pcd’ failed
make[2]: *** [bin/pcl_tiff2pcd] Error 1
CMakeFiles/Makefile2:2247: recipe for target ‘tools/CMakeFiles/pcl_tiff2pcd.dir/all’ failed
make[1]: *** [tools/CMakeFiles/pcl_tiff2pcd.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
[ 31%] Linking CXX executable …/bin/pcl_vtk2ply
[ 31%] Built target pcl_vtk2ply
[ 31%] Linking CXX executable …/bin/pcl_pcd2vtk
[ 31%] Built target pcl_pcd2vtk
[ 31%] Linking CXX executable …/bin/pcl_compute_hausdorff
[ 31%] Built target pcl_compute_hausdorff
Makefile:160: recipe for target ‘all’ failed
make: *** [all] Error 2

nvidia@nvidia:~/work/pcl/build$ ls -l /usr/lib/aarch64-linux-gnu/mesa/libGL.so*
lrwxrwxrwx 1 root root 14 Jun 14 11:00 /usr/lib/aarch64-linux-gnu/mesa/libGL.so -> libGL.so.1.2.0
lrwxrwxrwx 1 root root 14 Jun 14 11:00 /usr/lib/aarch64-linux-gnu/mesa/libGL.so.1 -> libGL.so.1.2.0
-rw-r–r-- 1 root root 405904 Jun 14 11:00 /usr/lib/aarch64-linux-gnu/mesa/libGL.so.1.2.0
nvidia@nvidia:~/work/pcl/build$ ls -l /usr/lib/aarch64-linux-gnu/libGL.so
lrwxrwxrwx 1 root root 13 Oct 15 18:51 /usr/lib/aarch64-linux-gnu/libGL.so -> mesa/libGL.so
nvidia@nvidia:~/work/pcl/build$

Even link libGL.so* /usr/lib/aarch64-linux/gnu, it still suffers missing LibGL library,

nvidia@nvidia:~/work/pcl/build$ ls -l /usr/lib/libGL.so*
lrwxrwxrwx 1 root root 40 Oct 15 19:59 /usr/lib/libGL.so -> /usr/lib/aarch64-linux-gnu/mesa/libGL.so
lrwxrwxrwx 1 root root 40 Oct 15 19:59 /usr/lib/libGL.so.1 -> /usr/lib/aarch64-linux-gnu/mesa/libGL.so
nvidia@nvidia:~/work/pcl/build$

@SteveNV,
cd /usr/lib/aarch64-linux-gnu
sudo rm libGL.so
sudo ln -s /usr/lib/libGL.so libGL.so

It seems above fixing works for me. Is it the right 3D backend for my PCL in PX2?

Thanks!

Gary