However, even this second set will fail to make properly, which leads us to another blog (fsanmartin.co), with another fix. This time, we will need to use Sublime Text to make the fix.
Open up Sublime text and select open file from the file menu. Then find the file db-4.8.30.NC/dbinc/atomic.h by selecting "Home" from the quick locations on the left side of the file browser, and then db-4.8.30.NC then dbinc, then atomic.h
Sublime Text will automatically show you the line number, so all you have to do is go to line 147 and find: __atomic_compare_exchange((p), (o), (n)) and replace it with __atomic_compare_exchange_db((p), (o), (n)). Then head to line 179 and find static inline int __atomic_compare_exchange( and replace it with static inline int __atomic_compare_exchange_db(. Once you do this, save the file and you should be able to run the sequence of commands from Crypto and Coffee above without issue.
Note: You can run the "make" command with the modifier -j # and it will run multiple tasks at a time based on how many processor cores you specify. For example if you have a dual-core processor, you can run make twice as fast by running sudo make -j 2.
Qt is a GUI (graphical user interface) toolkit for building out GUI's for software binaries. There are actually a couple qt packages we will want to install so we will just download the base package which should put all of them on our computer for us.
$ sudo apt install qtbase5-dev
Protobuf is short for protocol buffers. These are used in the context of cryptocurrencies as a way to run transactions from the GUI. There are also a million versions of Protobuf out there. We again will just go for the -dev variant of this to solve any issues.
$ sudo apt install libprotobuf-dev
This library allows for the GUI to encode QR codes that you can share to receive or send payments with.
$ sudo apt install libqrencode-dev
This has to do with JSON parsing and encoding, its optional, but go ahead and grab it.
$ sudo apt install libunivalue-dev
Again optional, this library has to do with ZMQ and its features within a Bitcoin based client.
$ sudo apt install libzmq3-dev
Git is a terminal command tool that allows us to download repositories of files off the internet. You will use it a lot unless you are more fond of downloading and extracting compressed files and then cleaning all that up on your own.
$ sudo apt install git
This package group includes a lot of packages and libraries that give us the ability to compile GUI elements for bitcoin based altcoins.
$ sudo apt install qttools5-dev-tools
Here we go again, with another protocol buffer package. Like I said earlier, there are a ton of these, and this one specifically is needed to push the configure script with GUI later on.
$ sudo apt install protobuf-compiler
Alright, so now that we have all the dependencies we need for Litecoin, lets go ahead and grab the sourcecode from Github. Quickly though, lets go ahead and run both sudo apt update and sudo apt-get update just to make sure all of our stuff is up to date after installing all those packages. Then we will use a handy bit of terminal commands to copy the Github repository straight to our harddrive.
$ git clone https://github.com/litecoin-project/litecoin.git
Using the git command with clone modifier, we can then supply a URL to copy an entire Github repository can be downloaded and extraxted as it should be to your harddrive. This saves us from having to go the Github page, click download source, then extract the zip or other compressed file to the location we want it at. Once that command finishes running, we will want to move into the directory it was copied into using the cd command.
$ cd litecoin/
Start the Configure Process
Now that we are in the Litecoin folder, and we have all of our dependencies downloaded, we are ready to go ahead and start the actual process of compiling the source code. All we need to do to get this started is run the following command in terminal.
After running autogen.sh we are ready to configure the compilation. This, nine times out of ten, will be where you get errors for not having dependencies installed. Its also where you can run the command with modifiers to change the way the final binary comes out. Go ahead and run the following command:
What you see print out will be a long list of the program looking at the dependency libraries you have installed on your computer, and then telling you the way that the program is configured at the end. The important part will look something like this:
Options used to compile and link:
with wallet = yes
with gui / qt = no
with zmq = yes
with test = yes
with fuzz = no
with bench = yes
with upnp = yes
use asm = yes
scrypt sse2 = no
debug enabled = no
gprof enabled = no
werror = no
target os = linux
build os =
So as you can see, the configuration is set up to not provide us with a GUI wallet. Its also going to include a test and bench version of the binary. For most purposes, you wont need the test and bench versions of the binaries, so we can save a bit of time and space by running the configure script with a few modifiers (all of the modifiers available can be found by typing ./configure --help).
$ ./configure --with-gui --disable-tests --disable-bench
This should run the configure script again, and if you have all the dependencies above you should get back to the final readout, this time saying yes to GUI and no to tests and bench.
Compile the Cryptocurrency Wallet
We made it, this is the final moment, you can finally put in the terminal command to tell your computer to start turning all the code into an actual program that you can use. So, get ready, get set, enter:
$ sudo make
Make sure you have a bit of time, it can take anywhere from a few minutes to a couple hours to run make, but once its done the long part of this whole ordeal is over, and all you have to do is install. If you want to watch the printout in the terminal you can, but don't worry if you don't. Any errors that will cause the program not to work will also cause make to stop. You may see a ton of warnings or other things during this process, it happens, usually they don't mean anything. So you will see them as the last error printed out before it stops when you check it later.
Sudo Make Install
Once the make process ends, and as long as it doesn't end with an error, you should be able to run the command sudo make install and have the program copied to your /usr/local/bin folder (most common location). After that you can delete any source code as you only need the binaries that are in the /usr/local/bin/ folder.
Once you run sudo make install and it finishes, head over to /usr/local/bin. You can then launch the litecoin wallet by entering the command ./litecoin-qt.
If the GSWL series helped you out with getting set up compiling binaries from source in Linux, I hope you would consider donating to support this blog. In the future I will be writing about how to find the newest cryptocurrency projects on the internet, and get mining on them quickly. For now feel free to share this blog with anyone whom it may help.