ccminer-cryptonight icon indicating copy to clipboard operation
ccminer-cryptonight copied to clipboard

/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope

Open ben-kuhn opened this issue 8 years ago • 13 comments

Failed at compile time with the following error:

nvcc -g -O2 -I . -Xptxas "-abi=no -v" -gencode=arch=compute_20,code="sm_20,compute_20" -gencode=arch=compute_30,code="sm_30,compute_30" -gencode=arch=compute_35,code="sm_35,compute_35" --maxrregcount=80 --ptxas-options=-v -I./compat/jansson -o cryptonight/cryptonight.o -c cryptonight/cryptonight.cu ptxas warning : 'option -abi=no' might get deprecated in future ptxas warning : Too big maxrregcount value specified 80, will be ignored ptxas info : 0 bytes gmem ptxas info : Compiling entry function 'cuda_dummy_entry' for 'sm_20' ptxas info : Used 0 registers ptxas warning : 'option -abi=no' might get deprecated in future ptxas warning : Too big maxrregcount value specified 80, will be ignored ptxas info : 0 bytes gmem ptxas info : Compiling entry function 'cuda_dummy_entry' for 'sm_30' ptxas info : Used 0 registers ptxas warning : 'option -abi=no' might get deprecated in future ptxas info : 0 bytes gmem ptxas info : Compiling entry function 'cuda_dummy_entry' for 'sm_35' ptxas info : Used 0 registers /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:1155: recipe for target 'cryptonight/cryptonight.o' failed make[2]: ** [cryptonight/cryptonight.o] Error 1

ben-kuhn avatar Aug 31 '16 02:08 ben-kuhn

Same here!

paulomalvar avatar Sep 13 '16 21:09 paulomalvar

Well, considering it's been almost 2 years since the last commit, it may be time to look elsewhere...

ben-kuhn avatar Sep 13 '16 23:09 ben-kuhn

And where is elsewhere?

paulomalvar avatar Sep 13 '16 23:09 paulomalvar

Solution is to add -D_FORCE_INLINES in the Makefile when compiling.

example: NVCC_GENCODE = -D_FORCE_INLINES -gencode=arch=compute_20,code="sm_20,compute

Although I did not have this issue when using CUDA 8, but with CUDA 7.5 I needed to add the flag.

PsychicCat avatar Sep 23 '16 20:09 PsychicCat

After making @PsychicCat change, compile was succesful but now when running I get:

*** stack smashing detected ***: ./ccminer terminated Aborted (core dumped)

Ubuntu 16.04 Xenial with Cuda 8 drivers. Any ideas?

emkman avatar Jan 05 '17 02:01 emkman

@emkman haven't seen that issue myself but first try https://github.com/KlausT/ccminer-cryptonight, this fork is being actively maintained.

PsychicCat avatar Jan 05 '17 03:01 PsychicCat

@PsychicCat excellent, thank you!

emkman avatar Jan 05 '17 03:01 emkman

GTX 1060, Nv 387, cuda 9 , Linux Mint 18.2 x64 , Ryzen 5 i use this manual. http://fucking-it.com/ru/2016-01-21-14-35-44/bitcoin/854-monero-ccminer-cryptonight-gpu-miner-na-linux

/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;

anybody knows how to do with it?

Somewhere in internet i found method , but this is not work NVCCFLAGS - are not exist. (nvcc of course inalled)

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

dj--alex avatar Nov 13 '17 22:11 dj--alex

.cu.o:
        $(NVCC) -g -O2 -I . -Xptxas "-abi=no -v" $(NVCC_GENCODE) --maxrregcount=80 --ptxas-options=-v -D_FORCE_INLINES $(JANSSON_INCLUDES) -o $@ -c $<

added: -D_FORCE_INLINES in Makefile

ghost avatar Jan 05 '18 04:01 ghost

For anybody who had this error shown on his/her terminal while running cuIBM (Immersed Boundary Method Solver developed by the Lorena Barba group) When running "make" as it says in the tutorial https://github.com/barbagroup/cuIBM An error massage may jump out saying /usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope This can be solved adding -D_FORCE_INLINES at the end of the line 10 of the "make" file in the cuIBM folder, so it would look like this: CCFLAGS = -arch=sm_21 -O3 -D_FORCE_INLINES On the other hand, its important to modify the compute capability to your nvdia version see: https://developer.nvidia.com/cuda-gpus

I dont konw if its ok to write it here, if not please notify me.

Qiang-Yang-CN avatar Mar 29 '18 12:03 Qiang-Yang-CN

@comarius That worked. Thank you.

gldneagl avatar Jul 03 '18 07:07 gldneagl

GTX 1060, Nv 387, cuda 9 , Linux Mint 18.2 x64 , Ryzen 5 i use this manual. http://fucking-it.com/ru/2016-01-21-14-35-44/bitcoin/854-monero-ccminer-cryptonight-gpu-miner-na-linux

/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;

anybody knows how to do with it?

Somewhere in internet i found method , but this is not work NVCCFLAGS - are not exist. (nvcc of course inalled)

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

where is Makefile

2018loveyyq avatar Apr 19 '20 06:04 2018loveyyq

can you tell me where is the Makefile,i dont know how to find it and modify it as you say

2018loveyyq avatar Apr 19 '20 06:04 2018loveyyq