BUG|pytorch编译错误

问题:

[ 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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容