CPU mining on debian?

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

Albert Yang

Member
Oct 26, 2017
72
1
8
30
Hi,
I was wondering if someone else has accomplish on mining on a Debian machine? Currently for test reason want to test it out before going full out on GPU and buying the hardware. Currency have a server 24/7 and not using cpu so want to test it out.

This is what i got so far

Code:
apt-get install build-essential libcurl4-openssl-dev git automake libtool libjansson* libncurses5-dev libssl-dev
Then download the software

Code:
git clone --recursive https://github.com/tpruvot/cpuminer-multi.git
Then configure because its from git

Code:
./autogen.sh
Code:
./configure CFLAGS="-march=native" --with-crypto --with-curl
Code:
make
the issue is when i run

Code:
./cpuminer -help
it says no such directory not sure why i cd the folder cpuminer-multi

Thank you
 

Albert Yang

Member
Oct 26, 2017
72
1
8
30
Thanks for the reply, sorry forgot to mention i was going to give a go with zcoin which is algo lyra2z
 

xibo

New Member
Dec 25, 2017
13
5
3
39
The cpuminer-multi binary used to be called "minerd" in the past, I'm quite suprised to see they changed it.

It's usually built in the last command invoked by make. You can rebuild the miner by running either
Code:
make clean all
or
Code:
make clean && make all
in the build directory (the directory you where in when you ran "configure").

Over here (FreeBSD and another fork of the miner) it looks like this:
Code:
~/projects/cpuminer-multi % make clean all
Making clean in compat
Making clean in jansson
test -z "libjansson.a" || rm -f libjansson.a
rm -f *.o
test -z "minerd" || rm -f minerd
rm -f *.o
rm -f crypto/*.o
make  all-recursive
Making all in compat
Making all in jansson
cc -DHAVE_CONFIG_H -I. -I../..      -O2 -MT dump.o -MD -MP -MF .deps/dump.Tpo -c -o dump.o dump.c
mv -f .deps/dump.Tpo .deps/dump.Po
cc -DHAVE_CONFIG_H -I. -I../..      -O2 -MT hashtable.o -MD -MP -MF .deps/hashtable.Tpo -c -o hashtable.o hashtable.c
mv -f .deps/hashtable.Tpo .deps/hashtable.Po
cc -DHAVE_CONFIG_H -I. -I../..      -O2 -MT load.o -MD -MP -MF .deps/load.Tpo -c -o load.o load.c
mv -f .deps/load.Tpo .deps/load.Po
cc -DHAVE_CONFIG_H -I. -I../..      -O2 -MT strbuffer.o -MD -MP -MF .deps/strbuffer.Tpo -c -o strbuffer.o strbuffer.c
mv -f .deps/strbuffer.Tpo .deps/strbuffer.Po
cc -DHAVE_CONFIG_H -I. -I../..      -O2 -MT utf.o -MD -MP -MF .deps/utf.Tpo -c -o utf.o utf.c
mv -f .deps/utf.Tpo .deps/utf.Po
cc -DHAVE_CONFIG_H -I. -I../..      -O2 -MT value.o -MD -MP -MF .deps/value.Tpo -c -o value.o value.c
mv -f .deps/value.Tpo .deps/value.Po
rm -f libjansson.a
ar cru libjansson.a dump.o hashtable.o  load.o strbuffer.o utf.o  value.o
ar: `u' modifier ignored since `D' is the default (see `U')
ranlib libjansson.a
cc -DHAVE_CONFIG_H -I.  -pthread -I./compat/jansson -I/usr/local/include  -pipe  -mavx -mavx2 -maes  -O2 -MT minerd-cpu-miner.o -MD -MP -MF .deps/minerd-cpu-miner.Tpo -c -o minerd-cpu-miner.o `test -f 'cpu-miner.c' || echo './'`cpu-miner.c
cpu-miner.c:407:22: warning: passing 'char *' to parameter of type 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        if (!hex2bin(blob, hexblob, blobLen / 2)) {
                     ^~~~
./miner.h:228:36: note: passing argument to parameter 'p' here
extern bool hex2bin(unsigned char *p, const char *hexstr, size_t len);
                                   ^
cpu-miner.c:590:37: warning: passing 'char [32]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            char *hashhex = bin2hex(hash, 32);
                                    ^~~~
./miner.h:227:43: note: passing argument to parameter 'p' here
extern char *bin2hex(const unsigned char *p, size_t len);
                                          ^
cpu-miner.c:623:37: warning: passing 'char [32]' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            char *hashhex = bin2hex(hash, 32);
                                    ^~~~
./miner.h:227:43: note: passing argument to parameter 'p' here
extern char *bin2hex(const unsigned char *p, size_t len);
                                          ^
3 warnings generated.
mv -f .deps/minerd-cpu-miner.Tpo .deps/minerd-cpu-miner.Po
cc -DHAVE_CONFIG_H -I.  -pthread -I./compat/jansson -I/usr/local/include  -pipe  -mavx -mavx2 -maes  -O2 -MT minerd-util.o -MD -MP -MF .deps/minerd-util.Tpo -c -o minerd-util.o `test -f 'util.c' || echo './'`util.c
mv -f .deps/minerd-util.Tpo .deps/minerd-util.Po
cc -DHAVE_CONFIG_H -I.  -pthread -I./compat/jansson -I/usr/local/include  -pipe  -mavx -mavx2 -maes  -O2 -MT minerd-cryptonight_common.o -MD -MP -MF .deps/minerd-cryptonight_common.Tpo -c -o minerd-cryptonight_common.o `test -f 'cryptonight_common.c' || echo './'`cryptonight_common.c
mv -f .deps/minerd-cryptonight_common.Tpo .deps/minerd-cryptonight_common.Po
cc -DHAVE_CONFIG_H -I.  -pthread -I./compat/jansson -I/usr/local/include  -pipe  -mavx -mavx2 -maes  -O2 -MT crypto/minerd-c_keccak.o -MD -MP -MF crypto/.deps/minerd-c_keccak.Tpo -c -o crypto/minerd-c_keccak.o `test -f 'crypto/c_keccak.c' || echo './'`crypto/c_keccak.c
crypto/c_keccak.c:102:5: warning: implicitly declaring library function 'memset' with type 'void *(void *, int, unsigned long)' [-Wimplicit-function-declaration]
    memset(st, 0, sizeof(st));
    ^
crypto/c_keccak.c:102:5: note: include the header <string.h> or explicitly provide a declaration for 'memset'
crypto/c_keccak.c:111:5: warning: implicitly declaring library function 'memcpy' with type 'void *(void *, const void *, unsigned long)' [-Wimplicit-function-declaration]
    memcpy(temp, in, inlen);
    ^
crypto/c_keccak.c:111:5: note: include the header <string.h> or explicitly provide a declaration for 'memcpy'
2 warnings generated.
mv -f crypto/.deps/minerd-c_keccak.Tpo crypto/.deps/minerd-c_keccak.Po
cc -DHAVE_CONFIG_H -I.  -pthread -I./compat/jansson -I/usr/local/include  -pipe  -mavx -mavx2 -maes  -O2 -MT crypto/minerd-c_groestl.o -MD -MP -MF crypto/.deps/minerd-c_groestl.Tpo -c -o crypto/minerd-c_groestl.o `test -f 'crypto/c_groestl.c' || echo './'`crypto/c_groestl.c
mv -f crypto/.deps/minerd-c_groestl.Tpo crypto/.deps/minerd-c_groestl.Po
cc -DHAVE_CONFIG_H -I.  -pthread -I./compat/jansson -I/usr/local/include  -pipe  -mavx -mavx2 -maes  -O2 -MT crypto/minerd-c_blake256.o -MD -MP -MF crypto/.deps/minerd-c_blake256.Tpo -c -o crypto/minerd-c_blake256.o `test -f 'crypto/c_blake256.c' || echo './'`crypto/c_blake256.c
mv -f crypto/.deps/minerd-c_blake256.Tpo crypto/.deps/minerd-c_blake256.Po
cc -DHAVE_CONFIG_H -I.  -pthread -I./compat/jansson -I/usr/local/include  -pipe  -mavx -mavx2 -maes  -O2 -MT crypto/minerd-c_jh.o -MD -MP -MF crypto/.deps/minerd-c_jh.Tpo -c -o crypto/minerd-c_jh.o `test -f 'crypto/c_jh.c' || echo './'`crypto/c_jh.c
mv -f crypto/.deps/minerd-c_jh.Tpo crypto/.deps/minerd-c_jh.Po
cc -DHAVE_CONFIG_H -I.  -pthread -I./compat/jansson -I/usr/local/include  -pipe  -mavx -mavx2 -maes  -O2 -MT crypto/minerd-c_skein.o -MD -MP -MF crypto/.deps/minerd-c_skein.Tpo -c -o crypto/minerd-c_skein.o `test -f 'crypto/c_skein.c' || echo './'`crypto/c_skein.c
In file included from crypto/c_skein.c:15:
In file included from crypto/c_skein.h:30:
crypto/skein_port.h:96:11: warning: 'PLATFORM_BYTE_ORDER' macro redefined [-Wmacro-redefined]
#  define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
          ^
crypto/skein_port.h:92:11: note: previous definition is here
#  define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
          ^
1 warning generated.
mv -f crypto/.deps/minerd-c_skein.Tpo crypto/.deps/minerd-c_skein.Po
cc -DHAVE_CONFIG_H -I.  -pthread -I./compat/jansson -I/usr/local/include  -pipe  -mavx -mavx2 -maes  -O2 -MT minerd-cryptonight_aesni.o -MD -MP -MF .deps/minerd-cryptonight_aesni.Tpo -c -o minerd-cryptonight_aesni.o `test -f 'cryptonight_aesni.c' || echo './'`cryptonight_aesni.c
In file included from cryptonight_aesni.c:2:
In file included from ./cryptonight.h:6:
./miner.h:188:58: warning: declaration of 'struct cryptonight_ctx' will not be visible outside of this function [-Wvisibility]
                uint32_t max_nonce, unsigned long *hashes_done, struct cryptonight_ctx *persistentctx);
                                                                       ^
cryptonight_aesni.c:90:37: warning: incompatible pointer types passing 'union hash_state *' to parameter of type 'uint8_t *' (aka 'unsigned char *') [-Wincompatible-pointer-types]
        keccak((const uint8_t *)input, 76, &ctx->state.hs, 200);
                                           ^~~~~~~~~~~~~~
./cryptonight.h:64:52: note: passing argument to parameter 'md' here
void keccak(const uint8_t *in, int inlen, uint8_t *md, int mdlen);
                                                   ^
cryptonight_aesni.c:94:5: warning: implicitly declaring library function 'memcpy' with type 'void *(void *, const void *, unsigned long)' [-Wimplicit-function-declaration]
    memcpy(ctx->text, ctx->state.init, INIT_SIZE_BYTE);
    ^
cryptonight_aesni.c:94:5: note: include the header <string.h> or explicitly provide a declaration for 'memcpy'
cryptonight_aesni.c:96:21: warning: passing 'uint8_t [256]' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
    ExpandAESKey256(ExpandedKey);
                    ^~~~~~~~~~~
cryptonight_aesni.c:38:42: note: passing argument to parameter 'keybuf' here
static inline void ExpandAESKey256(char *keybuf)
                                         ^
cryptonight_aesni.c:172:12: warning: incompatible pointer types initializing 'uint64_t *' (aka 'unsigned long *') with an expression of type 'uint8_t *' (aka 'unsigned char *') [-Wincompatible-pointer-types]
        uint64_t *dst = &ctx->long_state[c[0] & 0x1FFFF0];
                  ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cryptonight_aesni.c:184:21: warning: passing 'uint8_t [256]' to parameter of type 'char *' converts between pointers to integer types with different sign [-Wpointer-sign]
    ExpandAESKey256(ExpandedKey);
                    ^~~~~~~~~~~
cryptonight_aesni.c:38:42: note: passing argument to parameter 'keybuf' here
static inline void ExpandAESKey256(char *keybuf)
                                         ^
cryptonight_aesni.c:215:10: warning: incompatible pointer types passing 'union hash_state *' to parameter of type 'uint64_t *' (aka 'unsigned long *') [-Wincompatible-pointer-types]
        keccakf(&ctx->state.hs, 24);
                ^~~~~~~~~~~~~~
./cryptonight.h:65:23: note: passing argument to parameter 'st' here
void keccakf(uint64_t st[25], int rounds);
                      ^
7 warnings generated.
mv -f .deps/minerd-cryptonight_aesni.Tpo .deps/minerd-cryptonight_aesni.Po
cc -pipe  -mavx -mavx2 -maes  -O2    -o minerd minerd-cpu-miner.o minerd-util.o  minerd-cryptonight_common.o  crypto/minerd-c_keccak.o  crypto/minerd-c_groestl.o  crypto/minerd-c_blake256.o  crypto/minerd-c_jh.o crypto/minerd-c_skein.o   minerd-cryptonight_aesni.o -L/usr/local/lib -lcurl compat/jansson/libjansson.a -lpthread
Just ignore all output other than the last line: The compiler (cc) is told to create a binary called "minerd" by specifying -o minerd in it's invokation. On your Debian installation the compiler is most likely called gcc instead of cc but the way to specify the output filename is -o <filename> nevertheless.
 
Last edited:
  • Like
Reactions: Albert Yang

Albert Yang

Member
Oct 26, 2017
72
1
8
30
@xibo
Thanks for the reply, right now i have 3 servers just sitting and wanted to test it out on centos running 5.9, freebsd running 10.1 and debian running 9.1. so the part im missing is
Code:
make clean && make all
also with these steps could i run also on freebsd and centos?

edit:
so i tried and got this error at the end

Code:
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
Makefile:900: recipe for target 'cpuminer' failed
make[2]: *** [cpuminer] Error 1
make[2]: Leaving directory '/root/cpuminer-multi'
Makefile:2530: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/cpuminer-multi'
Makefile:570: recipe for target 'all' failed
make: *** [all] Error 2
Thank you
 
Last edited:

xibo

New Member
Dec 25, 2017
13
5
3
39
the -lz reads "libz.so", which is a library file that cannot be found. The zlib1g package that can be installed via apt get should provide the missing library I think (package content)
 

Albert Yang

Member
Oct 26, 2017
72
1
8
30
@xibo
seems that i already have that packaged installed :(

@MiniKnight
been seeing lots of chatter of aeon coin seems pretty interesting could it also be mined on freebsd and centos?

@CryptoCurrencyFreak
going to test it out on centos ill let you know if im able to do it, the worst parts its elastix running 5.9 so finding repository pretty complicated for that version.
 

MiniKnight

Well-Known Member
Mar 30, 2012
3,073
974
113
NYC
FreeBSD mining is a pain. CentOS is easy but it's normally slower. Ubuntu is defacto standard because that's what most of the GPU miner devs use
 

Albert Yang

Member
Oct 26, 2017
72
1
8
30
@MiniKnight
Thanks for the reply, yes that is true but i have a cpu with pfSense on it and its on without using CPU, also the energy is very cheep so i have no worries on the bill
 

Albert Yang

Member
Oct 26, 2017
72
1
8
30
EDIT: FINALLY I NEEDED THIS
Code:
apt-get install \
    build-essential pkg-config libc6-dev m4 g++-multilib \
    autoconf libtool ncurses-dev unzip git python \
    zlib1g-dev wget bsdmainutils automake
and needed another cpu miner because it did not have lyra2z
Code:
git clone https://github.com/zcoinofficial/cpuminer-xzc.git
1 down 2 to go