firoorg / cpuminer

cpuminer with mtp support
Other
38 stars 14 forks source link

Can't compile on Fedora 29: warning: command line option ‘-std=gnu++11’ is valid for C++/ObjC++ but not for C #8

Open agentpatience opened 5 years ago

agentpatience commented 5 years ago

Hello is there any support for this project? When I try to build this code on Fedora 29 I get a compile error that I don't know how to handle.

Steps to build: ./autogen.sh ./configure CFLAGS="-march=native" --with-crypto --with-curl make

during make I get this error: make[2]: Entering directory '/root/cpuminer' gcc -DHAVE_CONFIG_H -I. -fno-strict-aliasing -std=gnu++11 -Iyes/include -Iyes/include -fno-strict-aliasing -I./compat/bos-jansson -I. -Iyes/include -Iyes/include -Wno-pointer-sign -Wno-pointer-to-int-cast -march=native -Iyes/include -Iyes/include -MT cpuminer-cpu-miner.o -MD -MP -MF .deps/cpuminer-cpu-miner.Tpo -c -o cpuminer-cpu-miner.o test -f 'cpu-miner.c' || echo './'cpu-miner.c cc1: warning: command line option ‘-std=gnu++11’ is valid for C++/ObjC++ but not for C cpu-miner.c:27:10: fatal error: curl/curl.h: No such file or directory

include <curl/curl.h>

      ^~~~~~~~~~~~~

compilation terminated. make[2]: [Makefile:1388: cpuminer-cpu-miner.o] Error 1 make[2]: Leaving directory '/root/cpuminer' make[1]: [Makefile:2979: all-recursive] Error 1 make[1]: Leaving directory '/root/cpuminer' make: *** [Makefile:712: all] Error 2

djm34 commented 5 years ago

It seems you are missing curl package. make sure you have all the dependencies installed before trying to compile (also use the branch test2 which is the branch where all new developpement are going at the moment)

agentpatience commented 5 years ago

Hello djm, thanks very much for your reply. I found out it was the curl package but now I have a different error when I run the compiled bin: [2019-02-21 06:54:29] Starting Stratum on stratum+tcp://xzc.2miners.com:8080 [2019-02-21 06:54:29] 64 miner threads started, using 'mtp' algorithm. munmap_chunk(): invalid pointer Aborted (core dumped)

djm34 commented 5 years ago

hmm... strange... can you try to compile without "-march=native" (not sure it will help though)

agentpatience commented 5 years ago

Hi DJM, I'll try that tonight. I am not a programmer so I'm hoping you can help me solve this. I did a google search for the error and it seems like maybe it is a c programming issue: "Searching reveals that it is most likely due to free()-ing the memory twice. " dunno if this helps in the meantime... https://stackoverflow.com/questions/22817288/munmap-chunk-invalid-pointer-error

agentpatience commented 5 years ago

Hi djm, good news!

when I build without -march=native the binary runs without core dump! I will try to rebuild passing processor specific compiler flag "-march=bdver2" but even the compiler manual for these processors states that "-march=native" is sufficient to generate the optimized instructions.

I am using 4P HPC setup of 6386 AMD Opterons. I have 10 AMD 4p systems; each processor has 16 cores with aes, avx and sse instruction sets hopefully with your code I can mine with them!!. I hopefully would like to get it to work on Fedora 29 and FreeBSD 12.

Thanks for your support so very much appreciated.

agentpatience commented 5 years ago

./autogen.sh ./configure CFLAGS="-march=bdver2" --with-crypto --with-curl make

build competes and gives me an executable however when i run it I still get a core dump: [root@poweredge-miner1 cpuminer]# ./cpuminer -a mtp -o stratum+tcp://xzc.2miners.com:8080 -u a1jdNZbAdNKCh33VdJtCvdjnXc4V82FESe7h.6380 -p rudy cpuminer-multi 1.3.5 by djm34 BTC donation address: 1NENYmxwZGHsKFmyjTc5WferTn5VTFb7Ze (djm34) ZCoin donation address: aChWVb8CpgajadpLmiwDZvZaKizQgHxfh5 (djm34)

[2019-02-21 18:30:36] Starting Stratum on stratum+tcp://xzc.2miners.com:8080 [2019-02-21 18:30:36] 64 miner threads started, using 'mtp' algorithm. munmap_chunk(): invalid pointer Aborted (core dumped)

agentpatience commented 5 years ago

I can give you access to the hardware if needed.

agentpatience commented 5 years ago

so with no -march=native declared I can now mine without the bin core dumping... however its performance is not optimized Step 1 : Compute F(I) and store its T blocks X[1], X[2], ..., X[T] in the memory Step 2 : Compute the root Φ of the Merkle hash tree end Step 2 : Compute the root Φ of the Merkle hash tree end of init [2019-02-21 19:21:44] mtp block 138619, diff 0.000 [2019-02-21 19:21:44] CPU #7: 1.28 kH/s [2019-02-21 19:21:44] CPU #28: 1.06 kH/s [2019-02-21 19:21:44] CPU #25: 1.06 kH/s [2019-02-21 19:21:44] CPU #32: 1.20 kH/s [2019-02-21 19:21:44] CPU #41: 0.86 kH/s [2019-02-21 19:21:44] CPU #36: 1.20 kH/s [2019-02-21 19:21:44] CPU #63: 0.77 kH/s [2019-02-21 19:21:44] CPU #0: 1.28 kH/s [2019-02-21 19:21:44] CPU #62: 0.77 kH/s [2019-02-21 19:21:44] CPU #2: 1.28 kH/s [2019-02-21 19:21:44] CPU #1: 1.28 kH/s [2019-02-21 19:21:44] CPU #56: 0.77 kH/s [2019-02-21 19:21:44] CPU #5: 1.29 kH/s [2019-02-21 19:21:44] CPU #33: 1.20 kH/s [2019-02-21 19:21:44] CPU #12: 0.81 kH/s [2019-02-21 19:21:44] CPU #57: 0.77 kH/s [2019-02-21 19:21:44] CPU #58: 0.77 kH/s [2019-02-21 19:21:44] CPU #11: 0.81 kH/s [2019-02-21 19:21:44] CPU #39: 1.20 kH/s [2019-02-21 19:21:44] CPU #24: 1.06 kH/s [2019-02-21 19:21:44] CPU #13: 0.81 kH/s [2019-02-21 19:21:44] CPU #29: 1.06 kH/s [2019-02-21 19:21:44] CPU #3: 1.29 kH/s [2019-02-21 19:21:44] CPU #30: 1.06 kH/s [2019-02-21 19:21:44] CPU #42: 0.86 kH/s [2019-02-21 19:21:44] CPU #38: 1.20 kH/s [2019-02-21 19:21:44] CPU #55: 1.06 kH/s [2019-02-21 19:21:44] CPU #50: 1.06 kH/s [2019-02-21 19:21:44] CPU #27: 1.06 kH/s [2019-02-21 19:21:44] CPU #26: 1.06 kH/s [2019-02-21 19:21:44] CPU #8: 0.81 kH/s [2019-02-21 19:21:44] CPU #10: 0.81 kH/s [2019-02-21 19:21:44] CPU #14: 0.79 kH/s [2019-02-21 19:21:44] CPU #34: 1.20 kH/s [2019-02-21 19:21:44] CPU #54: 1.06 kH/s [2019-02-21 19:21:44] CPU #31: 1.06 kH/s [2019-02-21 19:21:44] CPU #40: 0.86 kH/s [2019-02-21 19:21:44] CPU #51: 1.06 kH/s [2019-02-21 19:21:44] CPU #4: 1.28 kH/s [2019-02-21 19:21:44] CPU #35: 1.20 kH/s [2019-02-21 19:21:44] CPU #16: 1.37 kH/s [2019-02-21 19:21:44] CPU #18: 1.37 kH/s [2019-02-21 19:21:44] CPU #48: 1.06 kH/s [2019-02-21 19:21:44] CPU #49: 1.06 kH/s [2019-02-21 19:21:44] CPU #53: 1.06 kH/s [2019-02-21 19:21:44] CPU #52: 1.06 kH/s [2019-02-21 19:21:44] CPU #60: 0.77 kH/s [2019-02-21 19:21:44] CPU #61: 0.77 kH/s [2019-02-21 19:21:44] CPU #44: 0.86 kH/s [2019-02-21 19:21:44] CPU #43: 0.86 kH/s [2019-02-21 19:21:44] CPU #15: 0.78 kH/s [2019-02-21 19:21:44] CPU #45: 0.86 kH/s [2019-02-21 19:21:44] CPU #46: 0.86 kH/s [2019-02-21 19:21:44] CPU #59: 0.77 kH/s [2019-02-21 19:21:44] CPU #47: 0.86 kH/s [2019-02-21 19:21:44] CPU #37: 1.20 kH/s [2019-02-21 19:21:44] CPU #9: 0.81 kH/s [2019-02-21 19:21:44] CPU #6: 1.28 kH/s [2019-02-21 19:21:44] CPU #21: 1.37 kH/s [2019-02-21 19:21:44] CPU #20: 1.37 kH/s [2019-02-21 19:21:44] CPU #19: 1.37 kH/s [2019-02-21 19:21:44] CPU #23: 1.37 kH/s [2019-02-21 19:21:44] CPU #17: 1.37 kH/s [2019-02-21 19:21:44] CPU #22: 1.37 kH/s cleaning stuff Step 1 : Compute F(I) and store its T blocks X[1], X[2], ..., X[T] in the memory Step 2 : Compute the root Φ of the Merkle hash tree end Step 2 : Compute the root Φ of the Merkle hash tree end of init

djm34 commented 5 years ago

actually for me, if I keep the march=native, it runs really slow... I changed sometimes ago the blake algo to one using optimized cpu instruction... may-be some tuning is needed here...

agentpatience commented 5 years ago

it crashes within an hour: [2019-02-22 08:46:16] CPU #44: 0.69 kH/s cleaning stuff Step 1 : Compute F(I) and store its T blocks X[1], X[2], ..., X[T] in the memory Step 2 : Compute the root Φ of the Merkle hash tree end Step 2 : Compute the root Φ of the Merkle hash tree Killed

djm34 commented 5 years ago

usually a "killed" is issued when the machine runs out of memory... can you check how much memory it is using ? (there is no memory leak per se... meaning it gets freed at some point, but large variation in memory usage can occur from time to time...

agentpatience commented 5 years ago

I have over 16gig. I will try again tonight with your new build. I will let you know how it goes.