我正在努力让Caffe在我的Ubuntu 14.04系统上运行。下载Caffe并安装所有依赖项(无GPU)之后,我运行make all,它运行顺畅。当我进行make test时,我遇到了一大堆错误。
CXX/LD -o .build_release/test/test_all.testbin src/caffe/test/test_caffe_main.cpp
/usr/bin/ld: warning: libopencv_core.so.3.0, needed by /usr/local/lib/libopencv_imgcodecs.so, may conflict with libopencv_core.so.2.4
/usr/bin/ld: warning: libopencv_imgproc.so.3.0, needed by /usr/local/lib/libopencv_imgcodecs.so, may conflict with libopencv_imgproc.so.2.4
.build_release/src/caffe/test/test_data_transformer.o: In function `caffe::MakeTempDir(std::string*)':
test_data_transformer.cpp:(.text._ZN5caffe11MakeTempDirEPSs[_ZN5caffe11MakeTempDirEPSs]+0x4a): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'
test_data_transformer.cpp:(.text._ZN5caffe11MakeTempDirEPSs[_ZN5caffe11MakeTempDirEPSs]+0x60): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'
test_data_transformer.cpp:(.text._ZN5caffe11MakeTempDirEPSs[_ZN5caffe11MakeTempDirEPSs]+0xe0): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'
test_data_transformer.cpp:(.text._ZN5caffe11MakeTempDirEPSs[_ZN5caffe11MakeTempDirEPSs]+0x107): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
.build_release/src/caffe/test/test_data_transformer.o: In function `caffe::MakeTempFilename(std::string*)':
test_data_transformer.cpp:(.text._ZN5caffe16MakeTempFilenameEPSs[_ZN5caffe16MakeTempFilenameEPSs]+0x87): undefined reference to `boost::filesystem::path::codecvt()'
test_data_transformer.cpp:(.text._ZN5caffe16MakeTempFilenameEPSs[_ZN5caffe16MakeTempFilenameEPSs]+0x340): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'
.build_release/src/caffe/test/test_layer_factory.o: In function `caffe::LayerFactoryTest_TestCreateLayer_Test<caffe::CPUDevice<double> >::TestBody()':
test_layer_factory.cpp:(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv]+0x7eb): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'
test_layer_factory.cpp:(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv]+0x809): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'
test_layer_factory.cpp:(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv]+0x8a7): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'
test_layer_factory.cpp:(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIdEEE8TestBodyEv]+0x8d1): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
.build_release/src/caffe/test/test_layer_factory.o: In function `caffe::LayerFactoryTest_TestCreateLayer_Test<caffe::CPUDevice<float> >::TestBody()':
test_layer_factory.cpp:(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv]+0x7eb): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'
test_layer_factory.cpp:(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv]+0x809): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'
test_layer_factory.cpp:(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv]+0x8a7): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'
test_layer_factory.cpp:(.text._ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv[_ZN5caffe37LayerFactoryTest_TestCreateLayer_TestINS_9CPUDeviceIfEEE8TestBodyEv]+0x8d1): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
.build_release/src/caffe/test/test_upgrade_proto.o: In function `caffe::NetUpgradeTest_TestUpgradeV1LayerType_Test::TestBody()':
test_upgrade_proto.cpp:(.text+0xd8c): undefined reference to `boost::filesystem::detail::temp_directory_path(boost::system::error_code*)'
test_upgrade_proto.cpp:(.text+0xdaa): undefined reference to `boost::filesystem::path::operator/=(boost::filesystem::path const&)'
test_upgrade_proto.cpp:(.text+0xe47): undefined reference to `boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)'
test_upgrade_proto.cpp:(.text+0xe71): undefined reference to `boost::filesystem::detail::create_directory(boost::filesystem::path const&, boost::system::error_code*)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/test/test_all.testbin] Error 1
我发现我的系统上有多个版本的OpenCV。我尝试从bash文件中删除一个。我按照此处给出的说明(Caffe with OpenCV 3 and NVIDIA Digits: OpenCV version conflict (2.4 vs 3.0))修改了Makefile,但这不起作用。我得到另一组这样的错误
CXX/LD -o .build_release/test/test_all.testbin src/caffe/test/test_caffe_main.cpp
/usr/bin/ld: cannot find -llibopencv_core.so.2.4
/usr/bin/ld: cannot find -llibopencv_highgui.so.2.4
/usr/bin/ld: cannot find -llibopencv_imgproc.so.2.4
/usr/bin/ld: cannot find -llibopencv_imgcodecs.so.2.4
/usr/bin/ld: cannot find -llibopencv_core.so.2.4
/usr/bin/ld: cannot find -llibopencv_highgui.so.2.4
/usr/bin/ld: cannot find -llibopencv_imgproc.so.2.4
collect2: error: ld returned 1 exit status
make: *** [.build_release/test/test_all.testbin] Error 1.
如何纠正这些错误?