Mining Monero on old Ubuntu

Getting the xmr-stak-cpu to work on an ubuntu 14.04:

* Compile gcc from scratch and install to /home/user/inst (script)

#!/bin/bash
VER=7.1.0
cd
WORKDIR=${PWD}/work/gcc-${VER}
INSTDIR=${WORKDIR}/inst
mkdir -p ${WORKDIR}
mkdir -p ${INSTDIR}
cd ${WORKDIR}
if [ ! -e gcc-${VER}.tar.bz2 ]; then
	wget -O gcc-${VER}.tar.bz2 ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-${VER}/gcc-${VER}.tar.bz2
fi
if [ ! -e gcc-${VER} ]; then
	tar xvfj gcc-${VER}.tar.bz2
fi
cd gcc-${VER}
./contrib/download_prerequisites
# 64bit only
./configure --disable-multilib --prefix=/home/user/inst && make -j $(grep -c ^processor /proc/cpuinfo) && make install

* Compile cmake from scratch

cd
mkdir -p work
cd work
mkdir -p cmake
cd cmake
wget https://cmake.org/files/v3.8/cmake-3.8.2.tar.gz
tar xvfz cmake-3.8.2.tar.gz
cd cmake-3.8.2.tar.gz
./configure --prefix=/home/user/inst && make && make install

* Download the xmr-stak-cpu files and compile

mkdir -p $HOME/work/xmr
cd $HOME/work/xmr
git clone https://github.com/fireice-uk/xmr-stak-cpu
cd xmr-stak-cpu
CC=$HOME/inst/bin/gcc CXX=$HOME/inst/bin/g++ PATH=$HOME/inst/bin:$PATH cmake . -DCMAKE_INSTALL_PREFIX=$HOME/xmr-stak-cpu -DMICROHTTPD_REQUIRED=OFF && make && make install

This will compile the file with the new gcc and the new cmake. The result will be installed to $HOME/xmr-stak-cpu, it’s only the executable file and the config.txt.

To run, you must point your LD_LIBRARY_PATH to the correct directory, otherwise you’ll get strange errors:

LD_LIBRARY_PATH="$HOME/inst/lib64" ./xmr-stak-cpu

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.