[ 93%] Linking CXX executable ../bin/mpi_test
/usr/bin/ld: CMakeFiles/mpi_test.dir/mpi/mpi_test.cc.o: undefined reference to symbol '_ZN3MPI8Datatype4FreeEv'
在caffe2\caffe2\CMakeLists.txt文件中添加
SET(CMAKE_C_COMPILER mpicc)
SET(CMAKE_CXX_COMPILER mpicxx)
include_directories(MPI_INCLUDE_PATH)
target_link_libraries(mpi_test ${MPI_LIBRARIES})
# ---[ Test binaries.
if (BUILD_TEST)
set(Caffe2_ALL_TEST_SRCS ${Caffe2_CPU_TEST_SRCS})
if (USE_CUDA)
list(APPEND Caffe2_ALL_TEST_SRCS ${Caffe2_GPU_TEST_SRCS})
endif()
foreach(test_src ${Caffe2_ALL_TEST_SRCS})
get_filename_component(test_name ${test_src} NAME_WE)
add_executable(${test_name} "${test_src}")
# For tests, some of the test code actually directly call the dependent
# libraries even if they are not part of the public dependency libs. As a
# result, we will explicitly link the test against the Caffe2 dependency
# libs.
target_link_libraries(${test_name} ${Caffe2_MAIN_LIBS} gtest_main)
if (USE_CUDA)
target_link_libraries(${test_name} ${Caffe2_CUDA_DEPENDENCY_LIBS})
endif()
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.0)
target_compile_features(${test_name} PRIVATE cxx_range_for)
endif()
add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
install(TARGETS ${test_name} DESTINATION test)
endforeach()
endif()
#--
SET(CMAKE_C_COMPILER mpicc)
SET(CMAKE_CXX_COMPILER mpicxx)
include_directories(MPI_INCLUDE_PATH)
target_link_libraries(mpi_test ${MPI_LIBRARIES})
[ 92%] Linking CXX executable ../bin/make_image_db
CMakeFiles/make_image_db.dir/make_image_db.cc.o:在函数‘caffe2::Converter::run()’中:
make_image_db.cc:(.text._ZN6caffe29Converter3runEv[_ZN6caffe29Converter3runEv]+0x2ce):对‘cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)’未定义的引用
collect2: error: ld returned 1 exit status
binaries/CMakeFiles/make_image_db.dir/build.make:102: recipe for target 'bin/make_image_db' failed
Opencv版本不匹配,为caffe2指定一个可用的版本
在caffe2\CMakeLists.txt文件中添加
# ---[ Project and semantic versioning.
project(Caffe2 CXX C)
#--
set(OpenCV_DIR "/home/jimmy/3d/ls/opencv-3.2.0/build")