206.1. Make and install programs from source

206.1 Make and install programs from source

Weight: 2
Description: Candidates should be able to build and install an executable program from source. This objective includes being able to unpack a file of sources.
Key Knowledge Areas:
    Unpack source code using common compression and archive utilities
    Understand basics of invoking make to compile programs
    Apply parameters to a configure script
    Know where sources are stored by default
Terms and Utilities:
    /usr/src/
    gunzip
    gzip
    bzip2
    xz
    tar
    configure
    make
    uname
    install
    patch

Make and install programs from source

As you know any modern linux distribution has its own repository, where we can easily search for a program , get info and install from it. Although installing a program from repository is easy and make kind of security, but it limits that program source to a specific distribution. So many developers prefer to publish a program source code it self, and let other people to configure and compile it base on their distribution and needs.
3 basic steps to install a program from source code are:
before beginning We need to install some developers tool. in redhat useyum groupinstall "Development Tools" and in debian based and ubuntu run apt-get install build-essentia :
1
[email protected]:~# apt install build-essential
2
Reading package lists... Done
3
Building dependency tree
4
Reading state information... Done
5
build-essential is already the newest version (12.1ubuntu2).
6
0 upgraded, 0 newly installed, 0 to remove and 172 not upgraded.
Copied!
For demonstration lets have fun and mine bitcoin with cpuminer. First download the source:
1
[email protected]:~# wget https://sourceforge.net/projects/cpuminer/files/pooler-cpuminer-2.5.0.tar.gz
2
--2018-02-04 02:37:14-- https://sourceforge.net/projects/cpuminer/files/pooler-cpuminer-2.5.0.tar.gz
3
Resolving sourceforge.net (sourceforge.net)... 216.34.181.60
4
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:443... connected.
5
HTTP request sent, awaiting response... 302 Found
6
Location: https://sourceforge.net/projects/cpuminer/files/pooler-cpuminer-2.5.0.tar.gz/download [following]
7
--2018-02-04 02:37:19-- https://sourceforge.net/projects/cpuminer/files/pooler-cpuminer-2.5.0.tar.gz/download
8
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:443... connected.
9
HTTP request sent, awaiting response... 302 Found
10
Location: https://downloads.sourceforge.net/project/cpuminer/pooler-cpuminer-2.5.0.tar.gz?r=&ts=1517740642&use_mirror=jaist [following]
11
--2018-02-04 02:37:22-- https://downloads.sourceforge.net/project/cpuminer/pooler-cpuminer-2.5.0.tar.gz?r=&ts=1517740642&use_mirror=jaist
12
Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59
13
Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.34.181.59|:443... connected.
14
HTTP request sent, awaiting response... 302 Found
15
Location: https://jaist.dl.sourceforge.net/project/cpuminer/pooler-cpuminer-2.5.0.tar.gz [following]
16
--2018-02-04 02:37:28-- https://jaist.dl.sourceforge.net/project/cpuminer/pooler-cpuminer-2.5.0.tar.gz
17
Resolving jaist.dl.sourceforge.net (jaist.dl.sourceforge.net)... 150.65.7.130, 2001:df0:2ed:feed::feed
18
Connecting to jaist.dl.sourceforge.net (jaist.dl.sourceforge.net)|150.65.7.130|:443... connected.
19
HTTP request sent, awaiting response... 200 OK
20
Length: 257872 (252K) [application/x-gzip]
21
Saving to: ‘pooler-cpuminer-2.5.0.tar.gz’
22
23
pooler-cpuminer-2.5 100%[===================>] 251.83K 21.3KB/s in 12s
24
25
2018-02-04 02:37:43 (21.3 KB/s) - ‘pooler-cpuminer-2.5.0.tar.gz’ saved [257872/257872]
26
28
total 252
29
drwxr-xr-x 2 root root 0 Feb 3 23:53 mynfs
30
-rw-r--r-- 1 root root 257872 Jun 22 2017 pooler-cpuminer-2.5.0.tar.gz
Copied!
and now lets uncompress the source, as a quick review:
uncompress commands
Description
tar -xvf filename.tar
uncompress tar file
tar -xvf filename.tar.gz
uncompress gzip file
tar -xvf filename.tar.bz2
uncompress bzip2 file
gunzip filename.gz
uncompress gzip file
okey:
1
[email protected]:~# mkdir cpuminer
2
[email protected]:~# cd cpuminer/
3
[email protected]:~/cpuminer# tar -zxvf ../pooler-cpuminer-2.5.0.tar.gz
4
cpuminer-2.5.0/
5
cpuminer-2.5.0/compat.h
6
cpuminer-2.5.0/ChangeLog
7
cpuminer-2.5.0/INSTALL
8
cpuminer-2.5.0/compat/
9
cpuminer-2.5.0/compat/jansson/
10
cpuminer-2.5.0/compat/jansson/hashtable.c
11
cpuminer-2.5.0/compat/jansson/strbuffer.h
12
cpuminer-2.5.0/compat/jansson/jansson_private.h
13
cpuminer-2.5.0/compat/jansson/hashtable.h
14
cpuminer-2.5.0/compat/jansson/Makefile.in
15
cpuminer-2.5.0/compat/jansson/dump.c
16
cpuminer-2.5.0/compat/jansson/jansson.h
17
cpuminer-2.5.0/compat/jansson/utf.h
18
cpuminer-2.5.0/compat/jansson/Makefile.am
19
cpuminer-2.5.0/compat/jansson/strbuffer.c
20
cpuminer-2.5.0/compat/jansson/config.h
21
cpuminer-2.5.0/compat/jansson/load.c
22
cpuminer-2.5.0/compat/jansson/util.h
23
cpuminer-2.5.0/compat/jansson/value.c
24
cpuminer-2.5.0/compat/jansson/utf.c
25
cpuminer-2.5.0/compat/Makefile.in
26
cpuminer-2.5.0/compat/Makefile.am
27
cpuminer-2.5.0/config.sub
28
cpuminer-2.5.0/miner.h
29
cpuminer-2.5.0/sha2.c
30
cpuminer-2.5.0/minerd.1
31
cpuminer-2.5.0/aclocal.m4
32
cpuminer-2.5.0/cpu-miner.c
33
cpuminer-2.5.0/Makefile.in
34
cpuminer-2.5.0/missing
35
cpuminer-2.5.0/depcomp
36
cpuminer-2.5.0/example-cfg.json
37
cpuminer-2.5.0/util.c
38
cpuminer-2.5.0/scrypt-x64.S
39
cpuminer-2.5.0/AUTHORS
40
cpuminer-2.5.0/compile
41
cpuminer-2.5.0/elist.h
42
cpuminer-2.5.0/README
43
cpuminer-2.5.0/sha2-x64.S
44
cpuminer-2.5.0/configure
45
cpuminer-2.5.0/Makefile.am
46
cpuminer-2.5.0/configure.ac
47
cpuminer-2.5.0/cpuminer-config.h.in
48
cpuminer-2.5.0/NEWS
49
cpuminer-2.5.0/install-sh
50
cpuminer-2.5.0/scrypt-x86.S
51
cpuminer-2.5.0/sha2-arm.S
52
cpuminer-2.5.0/config.guess
53
cpuminer-2.5.0/sha2-x86.S
54
cpuminer-2.5.0/COPYING
55
cpuminer-2.5.0/nomacro.pl
56
cpuminer-2.5.0/scrypt-ppc.S
57
cpuminer-2.5.0/scrypt.c
58
cpuminer-2.5.0/scrypt-arm.S
59
cpuminer-2.5.0/sha2-ppc.S
Copied!
Before being able to compile our source code, we need to prepare all its requirements and dependencies. To do that use configure command. The configure command is NOT a standard Linux command. configure is a script that is generally provided with the source of most standardized type Linux packages.
1
[email protected]:~/cpuminer# ls
2
cpuminer-2.5.0
3
[email protected]:~/cpuminer# cd cpuminer-2.5.0/
4
[email protected]:~/cpuminer/cpuminer-2.5.0# ls
5
aclocal.m4 configure INSTALL nomacro.pl sha2.c
6
AUTHORS configure.ac install-sh README sha2-ppc.S
7
ChangeLog COPYING Makefile.am scrypt-arm.S sha2-x64.S
8
compat cpu-miner.c Makefile.in scrypt.c sha2-x86.S
9
compat.h cpuminer-config.h.in minerd.1 scrypt-ppc.S util.c
10
compile depcomp miner.h scrypt-x64.S
11
config.guess elist.h missing scrypt-x86.S
12
config.sub example-cfg.json NEWS sha2-arm.S
13
14
[email protected]:~/cpuminer/cpuminer-2.5.0# ./configure
15
checking build system type... x86_64-unknown-linux-gnu
16
checking host system type... x86_64-unknown-linux-gnu
17
checking target system type... x86_64-unknown-linux-gnu
18
checking for a BSD-compatible install... /usr/bin/install -c
19
checking whether build environment is sane... yes
20
checking for a thread-safe mkdir -p... /bin/mkdir -p
21
checking for gawk... no
22
checking for mawk... mawk
23
checking whether make sets $(MAKE)... yes
24
checking whether make supports nested variables... yes
25
checking whether to enable maintainer-specific portions of Makefiles... no
26
checking for style of include used by make... GNU
27
checking for gcc... gcc
28
checking whether the C compiler works... yes
29
checking for C compiler default output file name... a.out
30
checking for suffix of executables...
31
checking whether we are cross compiling... no
32
checking for suffix of object files... o
33
checking whether we are using the GNU C compiler... yes
34
checking whether gcc accepts -g... yes
35
checking for gcc option to accept ISO C89... none needed
36
checking whether gcc understands -c and -o together... yes
37
checking dependency style of gcc... gcc3
38
checking for gcc option to accept ISO C99... none needed
39
checking how to run the C preprocessor... gcc -E
40
checking for grep that handles long lines and -e... /bin/grep
41
checking for egrep... /bin/grep -E
42
checking whether gcc needs -traditional... no
43
checking dependency style of gcc... gcc3
44
checking for ranlib... ranlib
45
checking for ANSI C header files... yes
46
checking for sys/types.h... yes
47
checking for sys/stat.h... yes
48
checking for stdlib.h... yes
49
checking for string.h... yes
50
checking for memory.h... yes
51
checking for strings.h... yes
52
checking for inttypes.h... yes
53
checking for stdint.h... yes
54
checking for unistd.h... yes
55
checking sys/endian.h usability... no
56
checking sys/endian.h presence... no
57
checking for sys/endian.h... no
58
checking sys/param.h usability... yes
59
checking sys/param.h presence... yes
60
checking for sys/param.h... yes
61
checking syslog.h usability... yes
62
checking syslog.h presence... yes
63
checking for syslog.h... yes
64
checking for sys/sysctl.h... yes
65
checking whether be32dec is declared... no
66
checking whether le32dec is declared... no
67
checking whether be32enc is declared... no
68
checking whether le32enc is declared... no
69
checking for size_t... yes
70
checking for working alloca.h... yes
71
checking for alloca... yes
72
checking for getopt_long... yes
73
checking whether we can compile AVX code... yes
74
checking whether we can compile XOP code... yes
75
checking whether we can compile AVX2 code... yes
76
checking for json_loads in -ljansson... no
77
checking for pthread_create in -lpthread... yes
78
checking for gawk... (cached) mawk
79
checking for curl-config... no
80
checking whether libcurl is usable... no
81
configure: error: Missing required libcurl >= 7.15.2
Copied!
Well obviously it needs libcurl, but if we have had read README file it was mentioned there:
1
Dependencies:
2
libcurl http://curl.haxx.se/libcurl/
3
jansson http://www.digip.org/jansson/
4
(jansson is included in-tree)
Copied!
so its recommended to read README file, any how lets try to search and install libcurl:
1
[email protected]:~/cpuminer/cpuminer-2.5.0# apt search libcurl
2
Sorting... Done
3
Full Text Search... Done
4
fp-units-net/xenial 3.0.0+dfsg-2 amd64
5
Free Pascal - networking units dependency package
6
7
fp-units-net-3.0.0/xenial 3.0.0+dfsg-2 amd64
8
Free Pascal - networking units
9
10
gnupg/xenial-updates,xenial-security,now 1.4.20-1ubuntu3.1 amd64 [installed]
11
GNU privacy guard - a free PGP replacement
12
13
gnupg-curl/xenial-updates,xenial-security 1.4.20-1ubuntu3.1 amd64
14
GNU privacy guard - a free PGP replacement (cURL)
15
16
libcupt4-1-downloadmethod-curl/xenial 2.9.4ubuntu1 amd64
17
flexible package manager -- libcurl download method
18
19
libcurl-ocaml/xenial 0.5.3-2build5 amd64
20
OCaml curl bindings (Runtime Library)
21
22
libcurl-ocaml-dev/xenial 0.5.3-2build5 amd64
23
OCaml libcurl bindings (Development package)
24
25
libcurl3/xenial-updates,xenial-security 7.47.0-1ubuntu2.6 amd64 [upgradable from: 7.47.0-1ubuntu2.5]
26
easy-to-use client-side URL transfer library (OpenSSL flavour)
27
28
libcurl3-dbg/xenial-updates,xenial-security 7.47.0-1ubuntu2.6 amd64
29
debugging symbols for libcurl (OpenSSL, GnuTLS and NSS flavours)
30
31
libcurl3-gnutls/xenial-updates,xenial-security 7.47.0-1ubuntu2.6 amd64 [upgradable from: 7.47.0-1ubuntu2.5]
32
easy-to-use client-side URL transfer library (GnuTLS flavour)
33
34
libcurl3-nss/xenial-updates,xenial-security 7.47.0-1ubuntu2.6 amd64
35
easy-to-use client-side URL transfer library (NSS flavour)
36
37
libcurl4-doc/xenial-updates,xenial-updates,xenial-security,xenial-security 7.47.0-1ubuntu2.6 all
38
documentation for libcurl
39
40
libcurl4-gnutls-dev/xenial-updates,xenial-security 7.47.0-1ubuntu2.6 amd64
41
development files and documentation for libcurl (GnuTLS flavour)
42
43
libcurl4-nss-dev/xenial-updates,xenial-security 7.47.0-1ubuntu2.6 amd64
44
development files and documentation for libcurl (NSS flavour)
45
46
libcurl4-openssl-dev/xenial-updates,xenial-security 7.47.0-1ubuntu2.6 amd64
47
development files and documentation for libcurl (OpenSSL flavour)
48
49
libcurlpp-dev/xenial 0.7.3-6 amd64
50
c++ wrapper for libcurl (development files)
51
52
libcurlpp0/xenial 0.7.3-6 amd64
53
c++ wrapper for libcurl
54
55
libghc-curl-dev/xenial 1.3.8-7 amd64
56
GHC libraries for the libcurl Haskell bindings
57
58
libghc-curl-doc/xenial,xenial 1.3.8-7 all
59
Documentation for the libcurl Haskell bindings; documentation
60
61
libghc-curl-prof/xenial 1.3.8-7 amd64
62
Profiling libraries for the libcurl Haskell bindings; profiling libraries
63
64
libghc-hxt-curl-dev/xenial 9.1.1.1-4build1 amd64
65
LibCurl interface for HXT
66
67
libghc-hxt-curl-doc/xenial,xenial 9.1.1.1-4build1 all
68
LibCurl interface for HXT; documentation
69
70
libghc-hxt-curl-prof/xenial 9.1.1.1-4build1 amd64
71
LibCurl interface for HXT; profiling libraries
72
73
libjsonrpccpp-client0/xenial 0.6.0-2build1 amd64
74
library implementing json-rpc C++ clients
75
76
libjsonrpccpp-client0-dbg/xenial 0.6.0-2build1 amd64
77
debugging symbols for libjsonrpccpp-client0
78
79
libresource-retriever-dev/xenial 1.11.6-2 amd64
80
Robot OS resource_retriever library - development files
81
82
libresource-retriever0d/xenial 1.11.6-2 amd64
83
Robot OS resource_retriever library
84
85
libstrongswan-extra-plugins/xenial-updates 5.3.5-1ubuntu3.5 amd64
86
strongSwan utility and crypto library (extra plugins)
87
88
libwww-curl-perl/xenial 4.17-2build1 amd64
89
Perl bindings to libcurl
90
91
lua-curl/xenial 0.3.0-9 amd64
92
libcURL bindings for the Lua language
93
94
lua-curl-dev/xenial 0.3.0-9 amd64
95
libcURL development files for the Lua language
96
97
python-pycurl/xenial 7.43.0-1ubuntu1 amd64
98
Python bindings to libcurl
99
100
python-pycurl-dbg/xenial 7.43.0-1ubuntu1 amd64
101
Python bindings to libcurl (debug extension)
102
103
python-pycurl-doc/xenial,xenial 7.43.0-1ubuntu1 all
104
Python bindings to libcurl (documentation)
105
106
python-resource-retriever/xenial,xenial 1.11.6-2 all
107
Robot OS resource_retriever library - Python
108
109
python3-pycurl/xenial,now 7.43.0-1ubuntu1 amd64 [installed]
110
Python bindings to libcurl (Python 3)
111
112
python3-pycurl-dbg/xenial 7.43.0-1ubuntu1 amd64
113
Python bindings to libcurl (debug extension, Python 3)
114
115
ruby-curb/xenial 0.8.8-1build5 amd64
116
Ruby libcurl bindings
117
118
ruby-ethon/xenial,xenial 0.8.0-1 all
119
libcurl wrapper using ffi
120
121
ruby-typhoeus/xenial,xenial 0.8.0-2 all
122
parallel HTTP library on top of ethon
123
124
strongswan-plugin-curl/xenial-updates,xenial-updates 5.3.5-1ubuntu3.5 all
125
strongSwan plugin for the libcurl based HTTP/FTP fetcher
126
127
tclcurl/xenial 7.22.0+hg20151017-1 amd64
128
Tcl bindings to libcurl
129
130
wmget/xenial 0.6.1-1 amd64
131
Background download manager in a Window Maker dock app
Copied!
Wow. That is a long list , Usually libraries with "-dev" on their tails are what we want, so we chose one and try:
1
[email protected]:~/cpuminer/cpuminer-2.5.0# apt search libcurl | grep dev
2
3
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
4
5
libcurl-ocaml-dev/xenial 0.5.3-2build5 amd64
6
libcurl4-gnutls-dev/xenial-updates,xenial-security 7.47.0-1ubuntu2.6 amd64
7
development files and documentation for libcurl (GnuTLS flavour)
8
libcurl4-nss-dev/xenial-updates,xenial-security 7.47.0-1ubuntu2.6 amd64
9
development files and documentation for libcurl (NSS flavour)
10
libcurl4-openssl-dev/xenial-updates,xenial-security 7.47.0-1ubuntu2.6 amd64
11
development files and documentation for libcurl (OpenSSL flavour)
12
libcurlpp-dev/xenial 0.7.3-6 amd64
13
c++ wrapper for libcurl (development files)
14
libghc-curl-dev/xenial 1.3.8-7 amd64
15
libghc-hxt-curl-dev/xenial 9.1.1.1-4build1 amd64
16
libresource-retriever-dev/xenial 1.11.6-2 amd64
17
Robot OS resource_retriever library - development files
18
lua-curl-dev/xenial 0.3.0-9 amd64
19
libcURL development files for the Lua language
20
21
[email protected]:~/cpuminer/cpuminer-2.5.0# apt install libcurl4-openssl-dev
Copied!
Now run configure again and watch for any problems:
1
[email protected]:~/cpuminer/cpuminer-2.5.0# ./configure
2
checking build system type... x86_64-unknown-linux-gnu
3
checking host system type... x86_64-unknown-linux-gnu
4
checking target system type... x86_64-unknown-linux-gnu
5
checking for a BSD-compatible install... /usr/bin/install -c
6
checking whether build environment is sane... yes
7
checking for a thread-safe mkdir -p... /bin/mkdir -p
8
checking for gawk... no
9
checking for mawk... mawk
10
checking whether make sets $(MAKE)... yes
11
checking whether make supports nested variables... yes
12
checking whether to enable maintainer-specific portions of Makefiles... no
13
checking for style of include used by make... GNU
14
checking for gcc... gcc
15
checking whether the C compiler works... yes
16
checking for C compiler default output file name... a.out
17
checking for suffix of executables...
18
checking whether we are cross compiling... no
19
checking for suffix of object files... o
20
checking whether we are using the GNU C compiler... yes
21
checking whether gcc accepts -g... yes
22
checking for gcc option to accept ISO C89... none needed
23
checking whether gcc understands -c and -o together... yes
24
checking dependency style of gcc... gcc3
25
checking for gcc option to accept ISO C99... none needed
26
checking how to run the C preprocessor... gcc -E
27
checking for grep that handles long lines and -e... /bin/grep
28
checking for egrep... /bin/grep -E
29
checking whether gcc needs -traditional... no
30
checking dependency style of gcc... gcc3
31
checking for ranlib... ranlib
32
checking for ANSI C header files... yes
33
checking for sys/types.h... yes
34
checking for sys/stat.h... yes
35
checking for stdlib.h... yes
36
checking for string.h... yes
37
checking for memory.h... yes
38
checking for strings.h... yes
39
checking for inttypes.h... yes
40
checking for stdint.h... yes
41
checking for unistd.h... yes
42
checking sys/endian.h usability... no
43
checking sys/endian.h presence... no
44
checking for sys/endian.h... no
45
checking sys/param.h usability... yes
46
checking sys/param.h presence... yes
47
checking for sys/param.h... yes
48
checking syslog.h usability... yes
49
checking syslog.h presence... yes
50
checking for syslog.h... yes
51
checking for sys/sysctl.h... yes
52
checking whether be32dec is declared... no
53
checking whether le32dec is declared... no
54
checking whether be32enc is declared... no
55
checking whether le32enc is declared... no
56
checking for size_t... yes
57
checking for working alloca.h... yes
58
checking for alloca... yes
59
checking for getopt_long... yes
60
checking whether we can compile AVX code... yes
61
checking whether we can compile XOP code... yes
62
checking whether we can compile AVX2 code... yes
63
checking for json_loads in -ljansson... no
64
checking for pthread_create in -lpthread... yes
65
checking for gawk... (cached) mawk
66
checking for curl-config... /usr/bin/curl-config
67
checking for the version of libcurl... 7.47.0
68
checking for libcurl >= version 7.15.2... yes
69
checking whether libcurl is usable... yes
70
checking for curl_free... yes
71
checking that generated files are newer than configure... done
72
configure: creating ./config.status
73
config.status: creating Makefile
74
config.status: creating compat/Makefile
75
config.status: creating compat/jansson/Makefile
76
config.status: creating cpuminer-config.h
77
config.status: executing depfiles commands
Copied!
it seems every thing is okey, and it generates some file for compiling :
1
-rwxr-xr-x 1 root root 35K Feb 4 04:08 config.status
2
-rw-r--r-- 1 root root 52K Feb 4 04:08 Makefile
3
drwxr-xr-x 3 payam payam 4.0K Feb 4 04:08 compat
4
-rw-r--r-- 1 root root 5.3K Feb 4 04:08 cpuminer-config.h
5
-rw-r--r-- 1 root root 32 Feb 4 04:08 stamp-h1
6
-rw-r--r-- 1 root root 33K Feb 4 04:08 config.log
Copied!
time to compile:
1
[email protected]:~/cpuminer/cpuminer-2.5.0# make
2
make all-recursive
3
make[1]: Entering directory '/root/cpuminer/cpuminer-2.5.0'
4
Making all in compat
5
make[2]: Entering directory '/root/cpuminer/cpuminer-2.5.0/compat'
6
Making all in jansson
7
make[3]: Entering directory '/root/cpuminer/cpuminer-2.5.0/compat/jansson'
8
gcc -DHAVE_CONFIG_H -I. -I../.. -g -O2 -MT dump.o -MD -MP -MF .deps/dump.Tpo -c -o dump.o dump.c
9
mv -f .deps/dump.Tpo .deps/dump.Po
10
gcc -DHAVE_CONFIG_H -I. -I../.. -g -O2 -MT hashtable.o -MD -MP -MF .deps/hashtable.Tpo -c -o hashtable.o hashtable.c
11
mv -f .deps/hashtable.Tpo .deps/hashtable.Po
12
gcc -DHAVE_CONFIG_H -I. -I../.. -g -O2 -MT load.o -MD -MP -MF .deps/load.Tpo -c -o load.o load.c
13
mv -f .deps/load.Tpo .deps/load.Po
14
gcc -DHAVE_CONFIG_H -I. -I../.. -g -O2 -MT strbuffer.o -MD -MP -MF .deps/strbuffer.Tpo -c -o strbuffer.o strbuffer.c
15
mv -f .deps/strbuffer.Tpo .deps/strbuffer.Po
16
gcc -DHAVE_CONFIG_H -I. -I../.. -g -O2 -MT utf.o -MD -MP -MF .deps/utf.Tpo -c -o utf.o utf.c
17
mv -f .deps/utf.Tpo .deps/utf.Po
18
gcc -DHAVE_CONFIG_H -I. -I../.. -g -O2 -MT value.o -MD -MP -MF .deps/value.Tpo -c -o value.o value.c
19
mv -f .deps/value.Tpo .deps/value.Po
20
rm -f libjansson.a
21
ar cru libjansson.a dump.o hashtable.o load.o strbuffer.o utf.o value.o
22
ar: `u' modifier ignored since `D' is the default (see `U')
23
ranlib libjansson.a
24
make[3]: Leaving directory '/root/cpuminer/cpuminer-2.5.0/compat/jansson'
25
make[3]: Entering directory '/root/cpuminer/cpuminer-2.5.0/compat'
26
make[3]: Nothing to be done for 'all-am'.
27
make[3]: Leaving directory '/root/cpuminer/cpuminer-2.5.0/compat'
28
make[2]: Leaving directory '/root/cpuminer/cpuminer-2.5.0/compat'
29
make[2]: Entering directory '/root/cpuminer/cpuminer-2.5.0'
30
gcc -DHAVE_CONFIG_H -I. -I./compat/jansson -pthread -fno-strict-aliasing -g -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
31
mv -f .deps/minerd-cpu-miner.Tpo .deps/minerd-cpu-miner.Po
32
gcc -DHAVE_CONFIG_H -I. -I./compat/jansson -pthread -fno-strict-aliasing -g -O2 -MT minerd-util.o -MD -MP -MF .deps/minerd-util.Tpo -c -o minerd-util.o `test -f 'util.c' || echo './'`util.c
33
mv -f .deps/minerd-util.Tpo .deps/minerd-util.Po
34
gcc -DHAVE_CONFIG_H -I. -I./compat/jansson -pthread -fno-strict-aliasing -g -O2 -MT minerd-sha2.o -MD -MP -MF .deps/minerd-sha2.Tpo -c -o minerd-sha2.o `test -f 'sha2.c' || echo './'`sha2.c
35
mv -f .deps/minerd-sha2.Tpo .deps/minerd-sha2.Po
36
gcc -DHAVE_CONFIG_H -I. -I./compat/jansson -pthread -fno-strict-aliasing -g -O2 -MT minerd-scrypt.o -MD -MP -MF .deps/minerd-scrypt.Tpo -c -o minerd-scrypt.o `test -f 'scrypt.c' || echo './'`scrypt.c
37
mv -f .deps/minerd-scrypt.Tpo .deps/minerd-scrypt.Po
38
gcc -DHAVE_CONFIG_H -I. -I./compat/jansson -pthread -g -O2 -MT minerd-sha2-x64.o -MD -MP -MF .deps/minerd-sha2-x64.Tpo -c -o minerd-sha2-x64.o `test -f 'sha2-x64.S' || echo './'`sha2-x64.S
39
mv -f .deps/minerd-sha2-x64.Tpo .deps/minerd-sha2-x64.Po
40
gcc -DHAVE_CONFIG_H -I. -I./compat/jansson -pthread -g -O2 -MT minerd-scrypt-x64.o -MD -MP -MF .deps/minerd-scrypt-x64.Tpo -c -o minerd-scrypt-x64.o `test -f 'scrypt-x64.S' || echo './'`scrypt-x64.S
41
mv -f .deps/minerd-scrypt-x64.Tpo .deps/minerd-scrypt-x64.Po
42
gcc -fno-strict-aliasing -g -O2 -pthread -o minerd minerd-cpu-miner.o minerd-util.o minerd-sha2.o minerd-scrypt.o minerd-sha2-x64.o minerd-scrypt-x64.o -L/usr/lib/x86_64-linux-gnu -lcurl compat/jansson/libjansson.a -lpthread
43
make[2]: Leaving directory '/root/cpuminer/cpuminer-2.5.0'
44
make[1]: Leaving directory '/root/cpuminer/cpuminer-2.5.0'
Copied!
All required binary files have been created:
1
-rw-r--r-- 1 root root 261K Feb 4 04:18 minerd-cpu-miner.o
2
-rw-r--r-- 1 root root 164K Feb 4 04:18 minerd-util.o
3
-rw-r--r-- 1 root root 43K Feb 4 04:18 minerd-sha2.o
4
-rw-r--r-- 1 root root 112K Feb 4 04:18 minerd-scrypt.o
5
-rw-r--r-- 1 root root 138K Feb 4 04:18 minerd-sha2-x64.o
6
-rw-r--r-- 1 root root 71K Feb 4 04:18 minerd-scrypt-x64.o
7
-rwxr-xr-x 1 root root 664K Feb 4 04:18 minerd
Copied!
see minerd, it works but its not in the path:
1
[email protected]:~/cpuminer/cpuminer-2.5.0# ./minerd
2
./minerd: no URL supplied
3
Try `minerd --help' for more information.
4
5
[email protected]:~/cpuminer/cpuminer-2.5.0# minerd
6
minerd: command not found
Copied!
Next step is installing compiled program. In this step PATHis modified and generated files are placed in /usr/local/bin
1
[email protected]:~/cpuminer/cpuminer-2.5.0# make install
2
Making install in compat
3
make[1]: Entering directory '/root/cpuminer/cpuminer-2.5.0/compat'
4
Making install in jansson
5
make[2]: Entering directory '/root/cpuminer/cpuminer-2.5.0/compat/jansson'
6
make[3]: Entering directory '/root/cpuminer/cpuminer-2.5.0/compat/jansson'
7
make[3]: Nothing to be done for 'install-exec-am'.
8
make[3]: Nothing to be done for 'install-data-am'.
9
make[3]: Leaving directory '/root/cpuminer/cpuminer-2.5.0/compat/jansson'
10
make[2]: Leaving directory '/root/cpuminer/cpuminer-2.5.0/compat/jansson'
11
make[2]: Entering directory '/root/cpuminer/cpuminer-2.5.0/compat'
12
make[3]: Entering directory '/root/cpuminer/cpuminer-2.5.0/compat'
13
make[3]: Nothing to be done for 'install-exec-am'.
14
make[3]: Nothing to be done for 'install-data-am'.
15
make[3]: Leaving directory '/root/cpuminer/cpuminer-2.5.0/compat'
16
make[2]: Leaving directory '/root/cpuminer/cpuminer-2.5.0/compat'
17
make[1]: Leaving directory '/root/cpuminer/cpuminer-2.5.0/compat'
18
make[1]: Entering directory '/root/cpuminer/cpuminer-2.5.0'
19
make[2]: Entering directory '/root/cpuminer/cpuminer-2.5.0'
20
/bin/mkdir -p '/usr/local/bin'
21
/usr/bin/install -c minerd '/usr/local/bin'
22
/bin/mkdir -p '/usr/local/share/man/man1'
23
/usr/bin/install -c -m 644 minerd.1 '/usr/local/share/man/man1'
24
make[2]: Leaving directory '/root/cpuminer/cpuminer-2.5.0'
25
make[1]: Leaving directory '/root/cpuminer/cpuminer-2.5.0'
26
27
[email protected]:~/cpuminer/cpuminer-2.5.0# minerd
28
minerd: no URL supplied
29
Try `minerd --help' for more information.
Copied!
Okey lets start bitcoin mining:
1
[email protected]:~/cpuminer/cpuminer-2.5.0# minerd -a sha256d -o stratum+tcp://stratum.antpool.com:3333 -u MyName.1 -p 123
2
[2018-02-04 04:44:03] Starting Stratum on stratum+tcp://stratum.antpool.com:3333
3
[2018-02-04 04:44:03] Binding thread 0 to cpu 0
4
[2018-02-04 04:44:03] 4 miner threads started, using 'sha256d' algorithm.
5
[2018-02-04 04:44:03] Binding thread 1 to cpu 1
6
[2018-02-04 04:44:03] Binding thread 3 to cpu 3
7
[2018-02-04 04:44:03] Binding thread 2 to cpu 2
Copied!
Last modified 2yr ago