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 :
For demonstration lets have fun and mine bitcoin with cpuminer. First download the source:
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:
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.
Well obviously it needs libcurl, but if we have had read README file it was mentioned there:
so its recommended to read README file, any how lets try to search and install libcurl:
Wow. That is a long list , Usually libraries with "-dev" on their tails are what we want, so we chose one and try:
Now run configure again and watch for any problems:
it seems every thing is okey, and it generates some file for compiling :
time to compile:
All required binary files have been created:
see minerd, it works but its not in the path:
Next step is installing compiled program. In this step PATHis modified and generated files are placed in /usr/local/bin
Okey lets start bitcoin mining:
Last updated