2016-05-15 24 views
2

我試圖編譯朱古力本指南以下聲明:https://gist.github.com/wangruohui/679b05fcd1466bb0937f錯誤/usr/include/string.h:652:42:錯誤:「memcpy的」未在此範圍內,同時建立朱古力

然而,當我太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甚至沒有在朱古力代碼,這樣怎麼辦?這是在嚴格遵循16.04

看到的代碼的來源一個Ubuntu變種是一個衆所周知的回購協議,我認爲這個問題可能是在Makefile或Makefile.config

回答

7

後很長一段時間翻翻各種網絡資源我解決了這個問題,通過將Makefile文件和轉產

NVCCFLAGS += -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS) 

NVCCFLAGS += -D_FORCE_INLINES -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS) 

對於我來說,這是上行406

+0

這是由cmake生成的Makefile嗎?似乎有所不同 – thang