× This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install.
Ensure there is enough space in /tmp and that the installation package is not corrupt
刚开始安装./cuda_12.1.1_530.30.02_linux.run时, /所在的/dev/sdb7所剩空间越来越小,最终安装失败,提示 Ensure there is enough space in /tmp and that the installation package is not corrupt。 所以必须先扩展/所在的硬盘容量
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) # OMIT Could NOT find LIBUSB_1 (missing: LIBUSB_1_LIBRARY LIBUSB_1_INCLUDE_DIR) # OMIT Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
修改project-config.jam文件,把using gcc部分修改为 using gcc : arm : /home/user/toolschain/gcc-ubuntu-9.3.0-2020.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc ;
找到gcc.jam文件,在430行左右,增加一行
1 2 3 4 5 6
# On Windows, fPIC is the default, and specifying -fPIC explicitly leads # to a warning. local non-windows = [ set.difference $(all-os) : cygwin windows ] ; compile-link-flags <link>shared/<target-os>$(non-windows) : -fPIC ; # 增加下面这行 compile-link-flags <link>static/<target-os>$(non-windows) : -fPIC ;
此步骤的主要目的是打开-fPIC,避免PCL在编译时找不到boost库的.a文件
进行编译并安装boost:
1
sudo ./b2 cxxflags=-fPIC cflags=-fPIC -a install
编译时可能会报错: error while loading shared libraries: libisl.so.22: cannot open shared object file: No such file
编译结束,我把生成的Boost库的文件都放到了/usr/local/lib。也就是/usr/lib/x86_64-linux-gnu中的libboost开头的库文件仍是x86的,/usr/local/lib中的libboost开头的库文件是AArch64架构。对于ARM的so库文件,在x86上用ldd命令查看会出现 not a dynamic executable
make CC=/home/user/toolschain/gcc-ubuntu-9.3.0-2020.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc mkdir lz4_arm make install PREFIX=$(pwd)/lz4_arm
运行ldconfig, 出现 /sbin/ldconfig.real: /lib/x86_64-linux-gnu/liblz4.so.1 is not a symbolic link
运行file /lib/liblz4.so,出现liblz4.so: broken symbolic link to liblz4.s
/home/user/toolschain/gcc-ubuntu-9.3.0-2020.03-x86_64-aarch64-linux-gnu/bin/../lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: /usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so: error adding symbols: file in wrong format
PCL交叉编译得到的so文件特别大,有的到了800M。使用strip瘦身,结果报错 strip: Unable to recognise the format of the input file ,因为so文件是aarch64的,应当使用gcc-ubuntu-9.3.0-2020.03-x86_64-aarch64-linux-gnu/aarch64-linux-gnu/bin/strip,结果让libpcl_features.so.1.10.0从797M 下降到 39M。