tsiv / ccminer-cryptonight

GNU General Public License v3.0
278 stars 283 forks source link

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

Open ben-kuhn opened 8 years ago

ben-kuhn commented 8 years ago

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* __mempcpyinline(void, const void_, sizet)’: /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

paulomalvar commented 8 years ago

Same here!

ben-kuhn commented 8 years ago

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

paulomalvar commented 8 years ago

And where is elsewhere?

PsychicCat commented 8 years ago

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.

emkman commented 7 years ago

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?

PsychicCat commented 7 years ago

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

emkman commented 7 years ago

@PsychicCat excellent, thank you!

dj--alex commented 6 years ago

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

ghost commented 6 years ago
.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

Qiang-Yang-CN commented 6 years ago

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.

gldneagl commented 6 years ago

@comarius That worked. Thank you.

2018loveyyq commented 4 years ago

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 commented 4 years ago

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