问题:
[ 92%] Built target caffe2_gpu
Scanning dependencies of target stream_test
[ 92%] Building CXX object caffe2/CMakeFiles/stream_test.dir/__/aten/src/ATen/test/stream_test.cpp.o
[ 93%] Linking CXX executable ../bin/stream_test
/home/weishu/pytorch/build/lib/libcaffe2_gpu.so: undefined reference to `caffe2::GlobalMPIComm()'
/home/weishu/pytorch/build/lib/libcaffe2_gpu.so: undefined reference to `caffe2::MPIMutex()'
collect2: error: ld returned 1 exit status
caffe2/CMakeFiles/stream_test.dir/build.make:108: recipe for target 'bin/stream_test' failed
make[2]: *** [bin/stream_test] Error 1
CMakeFiles/Makefile2:1407: recipe for target 'caffe2/CMakeFiles/stream_test.dir/all' failed
make[1]: *** [caffe2/CMakeFiles/stream_test.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
解决方案1:
cmake .. -DUSE_MPI=OFF
解决方案2:
更新:https://github.com/pytorch/pytorch/blob/10322d92c9ceea02d693696235e45e6adda4a999/caffe2/mpi/mpi_common.h
