Author Topic: [xolominer] How to compile and run in linux  (Read 17761 times)

Offline donschoe

  • Full Member
  • ***
  • Posts: 92
  • Karma: +8/-1
  • hello world
  • Referrals: 1
    • View Profile
[xolominer] How to compile and run in linux
« on: November 04, 2013, 01:23:29 pm »
How to: compile and run primeminer in Linux.

All guides apply to a fresh installed system.
All guides used the latest Xolominer v0.8 RC1 from github.
I didnt write guides for x86 systems, dont use x86 systems for primecoin mining. But anyways the setup should be the same.


Ubuntu 12.04.3 LTS Precise Pangolin x64

Code: [Select]
# Update & upgrade repositories and install build tools
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential software-properties-common python-software-properties git

# Add db4.8 repository and update
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update

# Install xolominer dependencies
sudo apt-get install libdb4.8-dev libdb4.8++-dev libssl-dev libgmp-dev libboost-chrono1.48-dev libboost-filesystem1.48-dev libboost-system1.48-dev libboost-program-options1.48-dev libboost-thread1.48-dev

# Pull the xolominer source from github
git clone https://github.com/thbaumbach/primecoin.git xolominer

# Go to source and compile the code
cd xolominer/src
make -f makefile.unix

# Start mining
./primeminer -pooluser=[xpm-payout-address] -poolip=[choose-your-server] -poolport=1337 -genproclimit=[threads-to-use] -poolpassword=[some-random-password-for-protection]


Ubuntu 13.10 Saucy Salamander x64

Code: [Select]
# Update & upgrade repositories and install build tools
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential git

# Install xolominer dependencies
sudo apt-get install libssl-dev libgmp-dev libboost-chrono1.54-dev libboost-filesystem1.54-dev libboost-system1.54-dev libboost-program-options1.54-dev libboost-thread1.54-dev

# Get db4.8 source, compile and install
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --enable-cxx
make
sudo make install

# Tell your system where to find db4.8
export BDB_INCLUDE_PATH="/usr/local/BerkeleyDB.4.8/include"
export BDB_LIB_PATH="/usr/local/BerkeleyDB.4.8/lib"
sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb-4.8.so /usr/lib/libdb-4.8.so
sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb_cxx-4.8.so /usr/lib/libdb_cxx-4.8.so

# Pull the xolominer source from github
cd
git clone https://github.com/thbaumbach/primecoin.git xolominer

# Go to source and compile the code
cd xolominer/src
make -f makefile.unix

# Start mining
./primeminer -pooluser=[xpm-payout-address] -poolip=[choose-your-server] -poolport=1337 -genproclimit=[threads-to-use] -poolpassword=[some-random-password-for-protection]

Debian 6.0.8 Squeeze x64

Code: [Select]
# Get root access
su -

# Update & upgrade repositories and install build tools
apt-get update && apt-get upgrade
apt-get install build-essential git

# Install xolominer dependencies
apt-get install libssl-dev libgmp3-dev

# Get boost source, compile and install
cd
wget http://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz
tar -xzvf boost_1_54_0.tar.gz
cd boost_1_54_0
./bootstrap.sh --prefix=/usr/local
./b2 install --with=all

# Tell your system where to find boost
export BOOST_INCLUDE_PATH="/usr/local/include/boost"
export BOOST_LIB_PATH="/usr/local/lib"
ldconfig

# Get db4.8 source, compile and install
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --enable-cxx
make
make install

# Tell your system where to find db4.8
export BDB_INCLUDE_PATH="/usr/local/BerkeleyDB.4.8/include"
export BDB_LIB_PATH="/usr/local/BerkeleyDB.4.8/lib"
sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb-4.8.so /usr/lib/libdb-4.8.so
sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb_cxx-4.8.so /usr/lib/libdb_cxx-4.8.so

# Pull the xolominer source from github
cd
git clone https://github.com/thbaumbach/primecoin.git xolominer

# Go to source and compile the code
cd xolominer/src
make -f makefile.unix

# Start mining
./primeminer -pooluser=[xpm-payout-address] -poolip=[choose-your-server] -poolport=1337 -genproclimit=[threads-to-use] -poolpassword=[some-random-password-for-protection]


Debian 7.2.0 Wheezy x64

Code: [Select]
# Get root access
su -

# Update & upgrade repositories and install build tools
apt-get update && apt-get upgrade
apt-get install build-essential git

# Install xolominer dependencies
apt-get install libssl-dev libgmp3-dev libboost-chrono1.49-dev libboost-filesystem1.49-dev libboost-system1.49-dev libboost-program-options1.49-dev libboost-thread1.49-dev

# Get db4.8 source, compile and install
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --enable-cxx
make
make install

# Tell your system where to find db4.8
export BDB_INCLUDE_PATH="/usr/local/BerkeleyDB.4.8/include"
export BDB_LIB_PATH="/usr/local/BerkeleyDB.4.8/lib"
sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb-4.8.so /usr/lib/libdb-4.8.so
sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb_cxx-4.8.so /usr/lib/libdb_cxx-4.8.so

# Pull the xolominer source from github
cd
git clone https://github.com/thbaumbach/primecoin.git xolominer

# Go to source and compile the code
cd xolominer/src
make -f makefile.unix

# Start mining
./primeminer -pooluser=[xpm-payout-address] -poolip=[choose-your-server] -poolport=1337 -genproclimit=[threads-to-use] -poolpassword=[some-random-password-for-protection]


CentOS 6.4 Final x64

Code: [Select]
# Get root access
su -

# Update repositories and install build tools & dependencies
yum update
yum groupinstall "Development Tools"
yum install gmp gmp-devel zlib zlib-devel

#  NOTE: This only works if you have no boost, openssl and db4 isntalled. remove them and clean your system first.

# Get openssl source, compile and install
wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz
tar -xzvf openssl-1.0.1e.tar.gz
cd openssl-1.0.1e
./config --prefix=/usr/local enable-ec enable-ecdh enable-ecdsa
make
make install

# Get boost source, compile and install
cd
wget http://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz
tar -xzvf boost_1_54_0.tar.gz
cd boost_1_54_0
./bootstrap.sh --prefix=/usr/local
./b2 install --with=all

# Get db4.8 source, compile and install
cd
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --prefix=/usr/local --enable-cxx
make
make install

# Pull the xolominer source from github
cd
git clone https://github.com/thbaumbach/primecoin.git xolominer

# Go to source and compile the code
cd xolominer/src
LDFLAGS="-Wl,-R/usr/local/lib" make -f makefile.unix

# Start mining
./primeminer -pooluser=[xpm-payout-address] -poolip=[choose-your-server] -poolport=1337 -genproclimit=[threads-to-use] -poolpassword=[some-random-password-for-protection]
« Last Edit: November 05, 2013, 08:41:11 am by donschoe »

Offline donschoe

  • Full Member
  • ***
  • Posts: 92
  • Karma: +8/-1
  • hello world
  • Referrals: 1
    • View Profile
Re: [xolominer] How to compile and run in linux
« Reply #1 on: November 04, 2013, 01:24:16 pm »
FAQ
Q: Where to get Berkeley DB 4.8 from in Ubuntu?
A:
From bitcoin launchpad repository.

Code: [Select]
# Add db4.8 repository and update
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev

Q: How to compile Berkeley DB 4.8?
A:
Code
Code: [Select]
# Get db4.8 source, compile and install
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
tar -xzvf db-4.8.30.NC.tar.gz
cd db-4.8.30.NC/build_unix
../dist/configure --enable-cxx
make
sudo make install

# Tell your system where to find db4.8
export BDB_INCLUDE_PATH="/usr/local/BerkeleyDB.4.8/include"
export BDB_LIB_PATH="/usr/local/BerkeleyDB.4.8/lib"
sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb-4.8.so /usr/lib/libdb-4.8.so
sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb_cxx-4.8.so /usr/lib/libdb_cxx-4.8.so
sudo ldconfig

Q: How to compile OpenSSL correctly?
A:
Code
Code: [Select]
# Get openssl source, compile and install
wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz
tar -xzvf openssl-1.0.1e.tar.gz
cd openssl-1.0.1e
./config --prefix=/usr/local enable-ec enable-ecdh enable-ecdsa ALL=?
make
sudo make install
sudo ldconfig

Q: How to compile Boost correctly?
A:
Code
Code: [Select]
# Get boost source, compile and install
wget http://sourceforge.net/projects/boost/files/boost/1.54.0/boost_1_54_0.tar.gz
tar -xzvf boost_1_54_0.tar.gz
cd boost_1_54_0
./bootstrap.sh --prefix=/usr/local
sudo ./b2 install --with=all

# Tell your system where to find boost
export BOOST_INCLUDE_PATH="/usr/local/include/boost"
export BOOST_LIB_PATH="/usr/local/lib"
sudo ldconfig

Q: Compiling fails due to low available memory. What to do?
You get messages like this:
Code: [Select]
# Compiler error output
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.

# dmesg output
[ 1377.575785] Out of memory: Kill process 12305 (cc1plus) score 905 or sacrifice child
[ 1377.575800] Killed process 12305 (cc1plus) total-vm:579928kB, anon-rss:546144kB, file-rss:0kB

A: Add a temporary swap space:
Code: [Select]
# Create and enable 1GB swap space
sudo dd if=/dev/zero of=/swapfile bs=64M count=16
sudo mkswap /swapfile
sudo swapon /swapfile

# Do your stuff and compile things
[...]

# Disable Swap
sudo swapoff /swapfile
sudo rm /swapfile
« Last Edit: November 05, 2013, 05:46:04 am by donschoe »

Offline maybe_just_one

  • Jr. Member
  • **
  • Posts: 21
  • Karma: +1/-0
  • Hello I'm new here
  • Referrals: 0
    • View Profile
Re: [xolominer] How to compile and run in linux
« Reply #2 on: November 04, 2013, 05:01:56 pm »
If you can figure out CentOS I will be soooo happy.

Offline maybe_just_one

  • Jr. Member
  • **
  • Posts: 21
  • Karma: +1/-0
  • Hello I'm new here
  • Referrals: 0
    • View Profile
Re: [xolominer] How to compile and run in linux
« Reply #3 on: November 04, 2013, 05:02:48 pm »
Also on Debian 7 I was able to get it to work by using the Berkely db5 instead of 4.8.

Offline donschoe

  • Full Member
  • ***
  • Posts: 92
  • Karma: +8/-1
  • hello world
  • Referrals: 1
    • View Profile
Re: [xolominer] How to compile and run in linux
« Reply #4 on: November 04, 2013, 09:07:51 pm »
Added Debian 6, CentOS is still bitchy :D
« Last Edit: November 04, 2013, 09:28:41 pm by donschoe »

Offline xolokram

  • Hero Member
  • *****
  • Posts: 655
  • Karma: +56/-2
  • beeeeer.org
  • Referrals: 10
    • View Profile
    • beeeeer.org - XPM Mining Pool
Re: [xolominer] How to compile and run in linux
« Reply #5 on: November 04, 2013, 09:37:02 pm »
good job so far & thank you
beeeeer.org - beeeeer's GPU miner!
BTC: 1S4kxaF4ro17qThUz4hQwAoiXzCWdzwdb | LTC: LMgYASNbAgGUG6fhw1xdMAWSbMiWjNNGgo | XPM: AJhA1PGbNM94ZmsJvVVM5FfbE9SdxiMzgd

Offline pmp0925

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
  • Hello I'm new here
  • Referrals: 0
    • View Profile
Re: [xolominer] How to compile and run in linux
« Reply #6 on: November 05, 2013, 04:29:46 am »
Added Debian 6, CentOS is still bitchy :D

I'd be great to have it working at CentOS! I have several servers waiting to mine primecoins but couldn't compile the miner at CentOS  :-[

Offline antfuentes87

  • Jr. Member
  • **
  • Posts: 17
  • Karma: +1/-1
  • Primecoin is the future.
  • Referrals: 0
    • View Profile
    • Ready to Mine Primecoin VPS
Re: [xolominer] How to compile and run in linux
« Reply #7 on: November 05, 2013, 04:56:16 am »
How much ram is required to compile on Ubuntu Server 12.04.3 LTS?
Ready to Mine Primecoin VPS. $15 / Month. More information @ http://www.primecoinvps.com

Offline donschoe

  • Full Member
  • ***
  • Posts: 92
  • Karma: +8/-1
  • hello world
  • Referrals: 1
    • View Profile
Re: [xolominer] How to compile and run in linux
« Reply #8 on: November 05, 2013, 05:35:38 am »
How much ram is required to compile on Ubuntu Server 12.04.3 LTS?

Around 1 GB, but if you have less, you can add a temporary swap partition.

Code: [Select]
# Create and enable 1GB Swap space
sudo dd if=/dev/zero of=/swapfile bs=64M count=16
sudo mkswap /swapfile
sudo swapon /swapfile

# Do your stuff and compile things
[...]

# Disable Swap
sudo swapoff /swapfile
sudo rm /swapfile

Offline xolokram

  • Hero Member
  • *****
  • Posts: 655
  • Karma: +56/-2
  • beeeeer.org
  • Referrals: 10
    • View Profile
    • beeeeer.org - XPM Mining Pool
Re: [xolominer] How to compile and run in linux
« Reply #9 on: November 05, 2013, 08:40:17 am »
if your RAM is 512 MByte or lower (any linux distribution) compiling with this command might help:

Quote
> make -j 1 -f makefile.unix primeminer CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=4096"
or when you're unlucky but it's no problem for you to wait HOURS (DAYS?):
Quote
> make -j 1 -f makefile.unix primeminer CXXFLAGS="--param ggc-min-expand=0 --param ggc-min-heapsize=4096"
(the latter one is not recommended as it really slows down the compilation)
« Last Edit: November 05, 2013, 10:44:56 am by xolokram »
beeeeer.org - beeeeer's GPU miner!
BTC: 1S4kxaF4ro17qThUz4hQwAoiXzCWdzwdb | LTC: LMgYASNbAgGUG6fhw1xdMAWSbMiWjNNGgo | XPM: AJhA1PGbNM94ZmsJvVVM5FfbE9SdxiMzgd

Offline donschoe

  • Full Member
  • ***
  • Posts: 92
  • Karma: +8/-1
  • hello world
  • Referrals: 1
    • View Profile
Re: [xolominer] How to compile and run in linux
« Reply #10 on: November 05, 2013, 08:46:32 am »
Added CentOS. Note: This only seems to work on a clean environment. Make sure you completly remove all openssl, db4 and boost from yum!

Offline Sy

  • Sr. Member
  • ****
  • Posts: 126
  • Karma: +9/-0
  • Referrals: 0
    • View Profile
Re: [xolominer] How to compile and run in linux
« Reply #11 on: November 05, 2013, 11:22:58 am »
Just compiled on debian wheezy x64, followed your apt-get instructions but skipped on libdb4.8
Quote
apt-get install libdb-dev libdb++-dev
and you are done, why compile 4.8? This is no wallet so the version doesn't matter, Berkeley DB is used for wallet, blockchain data and peers.
Compiles just fine.

You didn't use
Quote
apt-get install libminiupnpc-dev
though so it should throw a compile error without USE_UPNP=0 with make, didn't test though, just installed it anyway ^^
cgminer Monitoring
beeeeer.org stats

XPM: AePRWBYdhAyURqBTeiACUoMRryjQhu5Sx3

Offline donschoe

  • Full Member
  • ***
  • Posts: 92
  • Karma: +8/-1
  • hello world
  • Referrals: 1
    • View Profile
Re: [xolominer] How to compile and run in linux
« Reply #12 on: November 05, 2013, 11:27:59 am »
Just compiled on debian wheezy x64, followed your apt-get instructions but skipped on libdb4.8
Quote
apt-get install libdb-dev libdb++-dev
and you are done, why compile 4.8? This is no wallet so the version doesn't matter, Berkeley DB is used for wallet, blockchain data and peers.
Compiles just fine.

Next time you tell me before I compile this on a dozen of systems :)

You didn't use
Quote
apt-get install libminiupnpc-dev
though so it should throw a compile error without USE_UPNP=0 with make, didn't test though, just installed it anyway ^^

Default should be = 0. Never needed this to specify.

Offline xolokram

  • Hero Member
  • *****
  • Posts: 655
  • Karma: +56/-2
  • beeeeer.org
  • Referrals: 10
    • View Profile
    • beeeeer.org - XPM Mining Pool
Re: [xolominer] How to compile and run in linux
« Reply #13 on: November 05, 2013, 01:22:05 pm »
if i remember corretly
Code: [Select]
USE_UPNP=-is possible too. this should completely ignore (mini) UPNP & all dependencies.
« Last Edit: November 05, 2013, 01:24:27 pm by xolokram »
beeeeer.org - beeeeer's GPU miner!
BTC: 1S4kxaF4ro17qThUz4hQwAoiXzCWdzwdb | LTC: LMgYASNbAgGUG6fhw1xdMAWSbMiWjNNGgo | XPM: AJhA1PGbNM94ZmsJvVVM5FfbE9SdxiMzgd

Offline antfuentes87

  • Jr. Member
  • **
  • Posts: 17
  • Karma: +1/-1
  • Primecoin is the future.
  • Referrals: 0
    • View Profile
    • Ready to Mine Primecoin VPS
Re: [xolominer] How to compile and run in linux
« Reply #14 on: November 05, 2013, 04:00:37 pm »
if your RAM is 512 MByte or lower (any linux distribution) compiling with this command might help:

Quote
> make -j 1 -f makefile.unix primeminer CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=4096"
or when you're unlucky but it's no problem for you to wait HOURS (DAYS?):
Quote
> make -j 1 -f makefile.unix primeminer CXXFLAGS="--param ggc-min-expand=0 --param ggc-min-heapsize=4096"
(the latter one is not recommended as it really slows down the compilation)

**EDIT: The first one worked perfect, and it actual did not take that long! Thanks again!
« Last Edit: November 05, 2013, 04:45:23 pm by antfuentes87 »
Ready to Mine Primecoin VPS. $15 / Month. More information @ http://www.primecoinvps.com

 
Share this topic...
In a forum
(BBCode)
In a site/blog
(HTML)


Peercoin.net Official Peercoin Website