Skip to content

Guide for mining zcash using nheqminer CPU or CPU_XENONCAT on RedHat 7.2

fsayed edited this page Nov 12, 2016 · 6 revisions

This is based on the default guide for Ubuntu on Nicehash Build Guide. I wrote this because there are some subtleties in building mining software on Redhat/CentOS 7.2, also, I'm sure you can use this guide to build Nicehash mining software on versions < 7.2. Note that this is the unofficial guide, I made it because I ran into issues with Boost libraries which weren't available on stock repositories. We will building it in the following order:

  • Install pertinent required libraries which are available on stock repositories.
  • Install Boost libraries (boost-log and boost-log-setup are not found on in stock repositories)
  • Download and Install lbzip2 library
  • Build and install nheqminer_CPU_XENONCAT or nheqminer_cpu or both
  • Start mining

Install Pertinent required libraries:

Start a terminal on your linux machine and type the following:

sudo yum install git ncurses-devel autoconf pkgconfig glibc gcc-c++ git wget zlib-devel patch libtool -y

The above command will install compilers and libraries, it will skip the items you already have installed.

Install Boost Libraries:

According to Nicehash mining software, it uses boost_log and boost_log_setup libraries from a whole list of Boost libraries. Unfortunately, these two libraries are not found on the EPEL package of Redhat/CentOS 7.2. They may include it in the future versions of Redhat/CentOS or perhaps you can build RPMs yourself. However, for this guide, we will download compile and install Boost package. Boost package are found on Sourceforge. As of this writing the latest version is 1.62. Lets Download and install this bad boy: Start a terminal window on your linux desktop, I will right-click over 'boost_1_62_0.tar.gz' link and select 'copy link address/copy link location' and paste it in my terminal window after 'wget' command:

Boost Package Download Link

wget <paste_boost_1_62_0.tar.gz_link_address>

Once downloaded, we will extract it, build it, and install it.

Extract Boost Package

tar xzvf boost_1_62_0.tar.gz

Build Boost Package

cd boost_1_62

./bootstrap.sh --with-libraries=all --prefix=/usr/local --includedir=/usr/local/include --libdir=/usr/local/lib

Install Boost Package

sudo ./bjam install

We need to do one more step, we need to let the mining software know where the Boost libraries are installed, we will assign the location '/usr/local/lib' to a special environment variable LD_LIBRARY_PATH. We will set that variable in our terminal and we will also add it to our .bashrc file so, we you restart or logout and log back in your user account, LD_LIBRARY_PATH value is automatically set.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

The above will set that environment variable for your current session. Now, we will add the same line to .bashrc file:

echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib" >> ~/.bashrc

Download and install lbzip2 package:

Download it from lbzip2 download site. Right click on the download link and:

wget <paste_the_download_link_for_lbzip2>

Once the download is finished. Let's extract it, build, and install. The version available is 2.5.This is very quick. On your terminal, type the following:

Extract lbzip2:

tar xzvf lbzip2-2.5.tar.gz

Build it:

cd lbzip2-2.5 Prep for build ./configure Check dependencies make check

Install it

sudo make install

Install nheqminer_CPU_XENONCAT or nheqminer_CPU or both.

The steps for building and installing nheqminer are exactly the same, the only difference is their location in the package. First, git clone it, build, and install.

nheqminer_CPU_XENONCAT:

Open your terminal window and by default you are always in your home directory. Lets download the mining software using git:

git clone -b Linux https://github.com/nicehash/nheqminer.git

The above command will download the nheqminer mining software to your current (home) directory. You will see a 'nheqminer' directory. Let's continue:

cd nheqminer/cpu_xenoncat/Linux/asm/

sh assemble.sh

cd ../../../Linux_cmake/nheqminer_cpu_xenoncat

cmake .

make -j $(nproc)

If you noticed, the steps are exactly the same as on the nicehash instruction. If you prefer to use nheqminer_cpu, the steps are exactly the same except the location is different. The steps are:

nheqminer_CPU:

Open your terminal window and by default you are always in your home directory. Lets download the mining software using git:

git clone -b Linux https://github.com/nicehash/nheqminer.git

The above command will download the nheqminer mining software to your current (home) directory. You will see a 'nheqminer' directory. Let's continue:

cd nheqminer/cpu_xenoncat/Linux/asm/

sh assemble.sh

cd ../../../Linux_cmake/nheqminer_cpu

cmake .

make -j $(nproc)

Starting the miner

You should have installed zcash s/w where you created your t_address and z_address etc etc. You know your t_address. You also know how many CPU cores you have. 'nproc' command in your terminal window should give you the result as well. Say, I have 8 cores, i.e. dual quad core cpu. I would like to use 6 cores to mine. I can start mining now. Open up a terminal window and type the following code:

If you build nheqminer_cpu_xenoncat:

cd nheqminer/Linux_cmake/nheqminer_cpu_xenoncat

Now Run it:

./nheqminer_cpu_xenoncat -l stratum.zcash.nicehash.com:3357 -u my_t_address -t 6

If you build nheqminer_cpu:

cd nheqminer/Linux_cmake/nheqminer_cpu

Now Run it:

./nheqminer_cpu -l stratum.zcash.nicehash.com:3357 -u my_t_address -t 6

Note: substitute your t_address in the command above

Disclaimer: This doc is unofficial and only here to help you. Use it at your own risk