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。
So, go ahead and install distcc on the server computer (in my case, the desktop)
And then spin up the server. (The following assumes I’m on the 10.8.33.0 subnet, and I’m allowing all hosts on that subnet to send jobs)
1
sudo distccd --log-file=/tmp/distccd.log --daemon -a 10.8.33.0/24
Setting up distcc (client) So, now you have to tell ccache to use the distcc distributed compilation servers. To do this, just add the following line to your ~/.bashrc file.
1
export CCACHE_PREFIX=distcc
Next, we have to tell distcc where to go to find the server. This also, just add to the bottom of your ~/.bashrc (my desktop is at 10.8.33.182 and it has 8 cores, my laptop is at localhost and has 4)
1
export DISTCC_HOSTS='localhost/4 10.8.33.182/8'
在另一个终端,使用下面命令检验ccache的运行效果
1
watch -n1 'ccache -s -v'
或者watch -n1 'ccache --show-stats -v'
编译时,使用top看 distcc process starts spooling up its threads.
/* * @tparam T point type * @param first Given the starting point of a line segment * @param last The endpoint of a given line segment * @param third Given point * @return T Distance from point to line */ template <typename T> static T PointToLineDistance(const Point<T>& first, const Point<T>& last, const Point<T>& third){ float dis_suqare = ((first.y - last.y) * third.x + (last.x - first.x) * third.y + (first.x * last.y - last.x * first.y)) * ((first.y - last.y) * third.x + (last.x - first.x) * third.y + (first.x * last.y - last.x * first.y)) / ((last.x - first.x) * (last.x - first.x) + (last.y - first.y) * (last.y - first.y)); return std::sqrt(dis_suqare); }