编译caffe报错:
CXX tools/convert_annoset.cpp
CXX tools/test_net.cpp
CXX tools/caffe.cpp
CXX tools/train_net.cpp
CXX tools/convert_imageset.cpp
CXX examples/cpp_classification/classification.cpp
CXX examples/cifar10/convert_cifar_data.cpp
CXX examples/siamese/convert_mnist_siamese_data.cpp
CXX examples/ssd/ssd_detect.cpp
CXX examples/mnist/convert_mnist_data.cpp
CXX .build_release/src/caffe/proto/caffe.pb.cc
AR -o .build_release/lib/libcaffe-nv.a
LD -o .build_release/lib/libcaffe-nv.so.0.17.0
/usr/bin/ld: 找不到 -lboost_python-py38
/usr/bin/ld: 找不到 -lpython3.8m
collect2: error: ld returned 1 exit status
Makefile:600: recipe for target '.build_release/lib/libcaffe-nv.so.0.17.0' failed
make: *** [.build_release/lib/libcaffe-nv.so.0.17.0] Error 1
make all -j4
LD -o .build_release/lib/libcaffe-nv.so.0.17.0
/usr/bin/ld: 找不到 -lboost_python-py38
/usr/bin/ld: 找不到 -lpython3.8m
collect2: error: ld returned 1 exit status
Makefile:600: recipe for target '.build_release/lib/libcaffe-nv.so.0.17.0' failed
make: *** [.build_release/lib/libcaffe-nv.so.0.17.0] Error 1
ldd正常的caffe
ldd caffe |grep boost
libboost_system.so.1.65.1 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1 (0x00007f4310532000)
libboost_filesystem.so.1.65.1 => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1 (0x00007f430fa69000)
libboost_python-py27.so.1.65.1 => /usr/lib/x86_64-linux-gnu/libboost_python-py27.so.1.65.1 (0x00007f430f4a0000)
libboost_thread.so.1.65.1 => /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.65.1 (0x00007f42ffa2a000)
可见,编译caffe的时候找错了boost_python库。
解决方案1:
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
不好使,还是一样
解决方案2:注释掉~/.bashrc conda
sudo vim ~/.bashrc
>>> conda initialize >>>
export PATH="/media/algo/data_1/software/anconda_install/bin:$PATH"
source ~/.bashrc
终端敲conda无反应代表关闭conda成功了。
然后继续make all -j4
就编译成功了