3

I'm trying to compile caffe following this guide: https://gist.github.com/wangruohui/679b05fcd1466bb0937f

However when I get too make all I get the error

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

But /usr/include/string.h isn't even in the caffe code so what gives? This is in an ubuntu variant that closely follows 16.04

Seeing as the source of the code is a well known repo I think the problem is probably in the Makefile or the Makefile.config

10

After a long time looking through various internet sources I solved this problem by going to the Makefile and changing the line

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

into

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

For me this was on line 406

1
  • is this the Makefile generated by cmake? seems to be different – thang Jun 15 '16 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.