我正尝试按照本指南编译 caffe:https://gist.github.com/wangruohui/679b05fcd1466bb0937f
但是,当我太make all
时,我得到了错误
NVCC src/caffe/layers/hdf5_data_layer.cu
/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char *) memcpy (__dest, __src, __n) + __n;
^
Makefile:585: recipe for target '.build_release/cuda/src/caffe/layers/hdf5_data_layer.o' failed
但是/usr/include/string.h 甚至不在 caffe 代码中,所以给出了什么?这是紧随 16.04 的 ubuntu 变体
鉴于代码的来源是一个众所周知的 repo,我认为问题可能出在 Makefile 或 Makefile.config 中
最佳答案
经过很长时间浏览各种互联网资源后,我通过转到 Makefile 并更改行解决了这个问题
NVCCFLAGS += -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS)
进入
NVCCFLAGS += -D_FORCE_INLINES -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS)
对我来说,这是在线 406
关于c++ - 错误/usr/include/string.h :652:42: error: ‘memcpy’ was not declared in this scope while building caffe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37241510/