我尝试在实验室的Linux服务器上安装ceres-solver(https://github.com/ceres-solver/ceres-solver),因为我没有root权限,所以尝试下载Zip文件并解压缩后使用CMake进行构建。但是在执行make install
时出现了问题。
下面是我的所有 Linux 命令。
tar -zxf ceres-solver-2.0.0.tar.gz
cd ceres-solver-2.0.0/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/home/zhangzb/include/Ceres/ -DCMAKE_PREFIX_PATH=/home/zhangzb/include/Glog -DCMAKE_PREFIX_PATH=/home/zhangzb/include/eigen3/ -DCMAKE_PREFIX_PATH=/home/zhangzb/include/Gflags/ -Dglog_DIR=/home/zhangzb/include/Glog ..
make install
在执行cmake命令后,一切都正常进行。但在执行make install命令后,出现了以下问题
make[2]: *** No rule to make target '/tmp/build/80754af9/snappy_1649923748780/_build_env/x86_64-conda-linux-gnu/sysroot/usr/lib/librt.so', needed by 'bin/small_blas_gemv_benchmark'. Stop.
CMakeFiles/Makefile2:3192: recipe for target 'internal/ceres/CMakeFiles/small_blas_gemv_benchmark.dir/all' failed
make[1]: *** [internal/ceres/CMakeFiles/small_blas_gemv_benchmark.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2
我注意到它试图在/tmp/build/80754af9/snappy_1649923748780/_build_env/x86_64-conda-linux-gnu/sysroot/usr/lib/librt.so
中查找librt.so,但librt.so位于/usr/lib/x86_64-linux-gnu/
中。
zhangzb@master:~/include/ceres-solver-2.0.0/build$ ls -l /usr/lib/x86_64-linux-gnu/librt.so
lrwxrwxrwx 1 root root 32 5 3 2022 /usr/lib/x86_64-linux-gnu/librt.so -> /lib/x86_64-linux-gnu/librt.so.
我希望它可以在正确的位置(/usr/lib/x86_64-linux-gnu/librt.so)找到librt.so,这样我就可以成功安装Ceres Solver。