Bitcoin Forum
May 30, 2024, 12:21:37 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 [7] 8 »  All
  Print  
Author Topic: [XPM] Primecoin High Performance Linux Compilation Guide  (Read 43533 times)
maco
Sr. Member
****
Offline Offline

Activity: 294
Merit: 250



View Profile
July 24, 2013, 09:41:39 AM
 #121

There is a few ways to fix this. Trust me, I had a lot of slip and falls, but thanks to the assistance of the community, I got back up.

Plan A) execute swap file commands
cd
sudo dd if=/dev/zero of=/swapfile bs=64M count=16
sudo mkswap /swapfile
sudo swapon /swapfile

Plan B)  Before make file execution, use this command: sed -i 's/O2/O3/g' makefile.unix
then try this again -> make -f makefile.unix USE_UPNP=-

Still don't work?

Plan C) Get upgraded to 1024 MB of RAM and you are good to go. Only do this step if necessary and Plan A & Plan B has failed.

Best of luck!


Thanks for the comprehensive instructions. Smiley

I have got a bit stuck though and I'm hoping someone can help. I got HP5 working and am now trying HP7. I am trying under three different distros: Debian 6, Ubuntu 12.4 and Centos 6.

I was getting some failures due to this bug, but got around that using the recommended s/TIME_UTC/TIME_UTC_/g.

CentOS

This one fails not finding lib boost I think, but the latest versions are installed:

Code:
# make -f makefile.unix USE_UPNP=-
/bin/sh ../share/genbuild.sh obj/build.h
which: no git in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
g++ -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/root/primecoin-0.1.1-hp7/src -I/root/primecoin-0.1.1-hp7/src/obj -I/usr/local/include -DUSE_IPV6=1 -I/root/primecoin-0.1.1-hp7/src/leveldb/include -I/root/primecoin-0.1.1-hp7/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2  -o primecoind leveldb/libleveldb.a obj/alert.o obj/version.o obj/checkpoints.o obj/netbase.o obj/addrman.o obj/crypter.o obj/key.o obj/db.o obj/init.o obj/keystore.o obj/main.o obj/net.o obj/protocol.o obj/bitcoinrpc.o obj/rpcdump.o obj/rpcnet.o obj/rpcmining.o obj/rpcwallet.o obj/rpcblockchain.o obj/rpcrawtransaction.o obj/script.o obj/sync.o obj/util.o obj/wallet.o obj/walletdb.o obj/hash.o obj/bloom.o obj/noui.o obj/leveldb.o obj/txdb.o obj/prime.o obj/checkpointsync.o -Wl,-z,relro -Wl,-z,now -Wl,-rpath,/usr/local/lib  -L/usr/local/lib -Wl,-Bdynamic -l boost_system -l boost_filesystem -l boost_program_options -l boost_thread -l db_cxx -l ssl -l crypto -l gmp -Wl,-Bdynamic -l z -l dl -l pthread /root/primecoin-0.1.1-hp7/src/leveldb/libleveldb.a /root/primecoin-0.1.1-hp7/src/leveldb/libmemenv.a
/usr/bin/ld: cannot find -lboost_thread
collect2: ld returned 1 exit status
make: *** [primecoind] Error 1

Ubuntu

Compiler crashes without any particularly helpful info:

Code:
# make -f makefile.unix
/bin/sh ../share/genbuild.sh obj/build.h
g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/root/primecoin-0
p7/src -I/root/primecoin-0.1.1-hp7/src/obj -I/usr/local/include -DUSE_UPNP=0 -DUSE_IPV6=1 -I/root/primecoin-0.1.1-hp7/src/leveldb/include -I/root/primecoi
1-hp7/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2  -MMD -MF obj/main.d -o obj/m
main.cpp
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.
make: *** [obj/main.o] Error 4

Debian

Similar to Ubuntu in terms of compiler crash, but the message about git might be helpful to someone more clueful than me?

Code:
# make -f makefile.unix
/bin/sh ../share/genbuild.sh obj/build.h
fatal: Not a git repository (or any of the parent directories): .git
g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/root/primecoin-0.1.1-hp7/src -I/root/primecoin-0.1.1-hp7/src/obj -I/usr/local/include -DUSE_UPNP=0 -DUSE_IPV6=1 -I/root/primecoin-0.1.1-hp7/src/leveldb/include -I/root/primecoin-0.1.1-hp7/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2  -MMD -MF obj/main.d -o obj/main.o main.cpp
g++: Internal error: Killed (program cc1plus)
Please submit a full bug report.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
make: *** [obj/main.o] Error 1

Any suggestions welcome! Smiley

Kate.

PS. I expect my guys will fix this in the next day or so but I was having a go while they are busy with the main mining estate. Since I've got stuck I expect others will too!

maco
Sr. Member
****
Offline Offline

Activity: 294
Merit: 250



View Profile
July 24, 2013, 09:44:44 AM
 #122

One quick question: how do I tell how many coins I've mined?

Hi,

just watch 'primecoind getbalance' or 'primecoind listtransactions' or both...
I don't know if immature coins are listed though.

Hi,

When you type in primecoind listtransactions, do you see an address? or do you see a blank [ ] or { } ?

If the brackets or braces are blank, no blocks yet.

You will see it listed as 'generate' full address info, coin amount (11 xpm estimated currently), and immature or mature depending on when you seen it. Also, if you used this guide, you will see a balance. If you see 0.00000 that means no coins mined. If you see 11.xxx or 10.xxx instead of 0.0000 you got some coins, but double check with primecoind listtransaction.

You'll know its there when you see the added text.

Best of luck
maco
monsterer
Legendary
*
Offline Offline

Activity: 1008
Merit: 1002


View Profile
July 24, 2013, 12:25:48 PM
 #123

Fantastic, thanks guys Smiley
Transisto
Donator
Legendary
*
Offline Offline

Activity: 1731
Merit: 1008



View Profile WWW
July 25, 2013, 06:53:14 PM
 #124

For those that didn't use their free Amazon 100$ in AWS credit.

Fill this form : http://aws.amazon.com/big-data/powerof60/terms/

You'll receive a code by email almost instantly.
ivanlabrie
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000



View Profile
July 25, 2013, 07:05:08 PM
 #125

For those that didn't use their free Amazon 100$ in AWS credit.

Fill this form : http://aws.amazon.com/big-data/powerof60/terms/

You'll receive a code by email almost instantly.

Thanks!
bidji29
Sr. Member
****
Offline Offline

Activity: 392
Merit: 250


View Profile
July 26, 2013, 10:57:10 AM
 #126

Now there is so many parameter. It's very hard to know what to do.
Did the basic setting have been tested on the testnet and appears ok?
I doesn"t ask if they are the best, just if they are ok

http://www.freebieservers.com/  100% FREE GAME SERVERS
PicassoRoll
Newbie
*
Offline Offline

Activity: 8
Merit: 0



View Profile
July 26, 2013, 11:27:11 AM
 #127

this is great not only for XPM, but for building any other cryptos on Linux. great guide.
mikaelh (OP)
Sr. Member
****
Offline Offline

Activity: 301
Merit: 250


View Profile
July 26, 2013, 12:14:22 PM
 #128

Now there is so many parameter. It's very hard to know what to do.
Did the basic setting have been tested on the testnet and appears ok?
I doesn"t ask if they are the best, just if they are ok

The basic settings should be fine for both mainnet and testnet. In fact some of the current defaults are specifically targeting optimal mainnet performance. Unless you know how to do statistics properly, you will probably only end up hurting your miner's performance.
adambeazley
Newbie
*
Offline Offline

Activity: 17
Merit: 0



View Profile WWW
July 26, 2013, 03:56:37 PM
 #129

Can someone help me with instructions to upgrade from hp5 to the new hp8 on ubuntu 13.04. I followed all of the instructions by the OP as it was written then.

Thanks
Lollaskates
Sr. Member
****
Offline Offline

Activity: 249
Merit: 250


View Profile
July 26, 2013, 07:34:26 PM
 #130

Here is a shell script for CentOS (tested with 6.4 minimal) to automate the install. Currently written for -hp8 and especially useful for spinning up cloud VPS instances with minimal intervention. Copy the following snippet and save it as build-primecoind-centos.sh, and run it. It is assumed you are logged in as root as no sudo commands are used.

Steps to copy the shell script:
1) Open a file for writing

Code:
vi build-primecoind-centos.sh

2) Press 'i' to enter edit mode, and paste the large snippet below:

Code:
#!/bin/sh

echo 'NOTICE: Switching to /root directory…'
cd /root

echo 'NOTICE: Installing dependencies via yum…'
yum -y install gcc-c++ m4 openssl-devel db4-devel boost-devel wget git ntp
yum -y groupinstall "Development Tools"

echo 'Configuring and starting NTPd...'
chkconfig ntpd on
ntpdate 0.pool.ntp.org
service ntpd start

echo 'NOTICE: Clearing work environment…'
rm -rf gmp-5.1.2.tar.bz2 gmp-5.1.2
rm -rf openssl-1.0.1e.tar.gz openssl-1.0.1e
rm -rf primecoin-0.1.1-hp8.tar.bz2 primecoin-0.1.1-hp8
rm -rf miniupnpc-1.6.20120509.tar.gz

echo 'NOTICE: Downloading OpenSSL 1.0.1e...'
wget ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/openssl-1.0.1e.tar.gz
tar xzvf openssl-1.0.1e.tar.gz
cd openssl-1.0.1e
echo 'NOTICE: Configuring OpenSSL 1.0.1e...'
./config shared --prefix=/usr/local --libdir=lib
echo 'NOTICE: Compiling OpenSSL 1.0.1e...'
make
echo 'NOTICE: Installing OpenSSL 1.0.1e…'
make install

cd /root
echo 'NOTICE: Downloading GMP 5.1.2…'
wget http://mirrors.kernel.org/gnu/gmp/gmp-5.1.2.tar.bz2
tar xjvf gmp-5.1.2.tar.bz2
cd gmp-5.1.2
echo 'NOTICE: Configuring GMP 5.1.2…'
./configure --enable-cxx
echo 'NOTICE: Compiling GMP 5.1.2…'
make
echo 'NOTICE: Installing GMP 5.1.2…'
make install

cd /root
echo 'NOTICE: Downloading miniupnpc 1.6.2…'
wget http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.6.20120509.tar.gz -O  miniupnpc-1.6.20120509.tar.gz
tar xzvf miniupnpc-1.6.20120509.tar.gz
cd miniupnpc-1.6.20120509
echo 'NOTICE: Compiling miniupnpc 1.6.2…'
make
echo 'NOTICE: Installing miniupnpc 1.6.2…'
INSTALLPREFIX=/usr/local make install

cd /root
echo 'NOTICE: Downloading XPM -hp8…'
wget http://sourceforge.net/projects/primecoin-hp/files/0.1.1-hp8/primecoin-0.1.1-hp8.tar.bz2/download -O primecoin-0.1.1-hp8.tar.bz2
tar xjvf primecoin-0.1.1-hp8.tar.bz2
cd primecoin-0.1.1-hp8/src
sed -i -e 's/$(OPENSSL_INCLUDE_PATH))/$(OPENSSL_INCLUDE_PATH) \/usr\/local\/include)/' makefile.unix
sed -i -e 's/$(OPENSSL_LIB_PATH))/$(OPENSSL_LIB_PATH) \/usr\/local\/lib)/' makefile.unix
sed -i -e 's/$(LDHARDENING) $(LDFLAGS)/$(LDHARDENING) -Wl,-rpath,\/usr\/local\/lib $(LDFLAGS)/' makefile.unix
echo 'NOTICE: Compiling XPM -hp8…'
make -f makefile.unix BOOST_LIB_SUFFIX=-mt
echo 'NOTICE: Installing XPM -hp8…'
strip primecoind
cp -f primecoind /usr/local/bin/

cd /root
echo 'NOTICE: Writing configuration for XPM -hp8…'
mkdir -p .primecoin
echo 'server=1
gen=1
rpcallowip=127.0.0.1
rpcuser=primecoinrpc
rpcpassword=SOME_SECURE_PASSWORD
sievesize=1000000' > .primecoin/primecoin.conf
sed -i -e "s/SOME_SECURE_PASSWORD/`< /dev/urandom tr -cd '[:alnum:]' | head -c32`/" .primecoin/primecoin.conf

echo 'NOTICE: Finished'

3) Save and exit Vim by pressing ESC, then typing ':x' (without quotes) and pressing Enter.

4) set the shell script as executable, and run it (as root).

Code:
chmod +x build-primecoind-centos.sh
./build-primecoind-centos.sh

Once completed, you will simply be able to type primecoind anywhere and run the client.
Tamis
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250



View Profile
July 29, 2013, 06:44:46 PM
Last edit: July 30, 2013, 10:52:35 AM by Tamis
 #131

For those that didn't use their free Amazon 100$ in AWS credit.

Fill this form : http://aws.amazon.com/big-data/powerof60/terms/

You'll receive a code by email almost instantly.

That worked just fine ! Thanks a lot for the tip.
Now I wonder what would be the best choice for the available credits  regarding primecoin mining...

What instance did you choose and how do we make sure AWS credits are used and instance is not debited on credit card ?
Payment options only show my credit card.

Edit :

I'm testing this instance : High-CPU Reserved Instances - Medium
Getting 4400pps with default settings.

Now I need to see if it is my credit card that gets debited or my AWS credits.
I will probably test the bigger high cpu instance tomorow depending on what gets debited.
If any of you already tested the high ones please post performance.    
samos123
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
August 16, 2013, 06:18:16 AM
 #132

Is there a big difference in performance between pre-compiled binaries and self-compiled?

I'm thinking about only compiling libgmp from source and using the precompiled binaries for primecoind.

Thanks a lot for your guide btw!
boldar
Full Member
***
Offline Offline

Activity: 139
Merit: 100



View Profile
August 16, 2013, 02:36:42 PM
 #133

Hey mikaelh,

I just finished writing a quick install guide for BAMT 1.1, a Debian distro for Litecoin.

https://bitcointalk.org/index.php?topic=274897

Feel free to add it to your compilation.  Thanks for all your hard work!
redtwitz
Full Member
***
Offline Offline

Activity: 231
Merit: 100


View Profile
August 20, 2013, 01:14:39 AM
Last edit: September 01, 2013, 06:03:30 AM by redtwitz
 #134

This is what I had to do on a fresh Fedora 19 install before being able to compile:

Code:
yum install boost-devel gcc-c++ gmp-devel libdb-cxx-devel miniupnpc-devel wget

cd
wget -O - ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/openssl-1.0.1e.tar.gz | tar zx
cd openssl-1.0.1e
./config shared --prefix=/usr/local --libdir=lib
make
make install
ln -s /usr/local/lib/libssl.so /usr/lib64/libssl.so.1.0.0
ln -s /usr/local/lib/libcrypto.so /usr/lib64/libcrypto.so.1.0.0
nanobtc
Hero Member
*****
Offline Offline

Activity: 601
Merit: 610



View Profile WWW
August 23, 2013, 02:38:38 PM
 #135

Thanks for the clear instructions, worked easily on 12.04 w/updates. I have one chugging away on pretty old hardware, was rewarded finally with 1.

Can anyone give examples for proxy use? I have .bashrc environment variables set up already, but does not seem to be used. I see the setting as null whille watching.

Lennon: "free as a bird"
mechs
Full Member
***
Offline Offline

Activity: 210
Merit: 100



View Profile
August 31, 2013, 08:09:16 PM
 #136

Thanks for the clear instructions, worked easily on 12.04 w/updates. I have one chugging away on pretty old hardware, was rewarded finally with 1.

Can anyone give examples for proxy use? I have .bashrc environment variables set up already, but does not seem to be used. I see the setting as null whille watching.
Any changes required for compiling -hp10 on Ubuntu?
Myerss
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
October 28, 2013, 10:38:04 AM
 #137

Strange everything compiled without error but when I try to start I only get this.
Running on Xubuntu 13.04

Code:
./run-primecoind
Terminated


Code:
ps xuf |grep primecoind
miner     6464  0.0  0.0  17844   976 pts/1    S+   11:31   0:00      \_ grep --color=auto primecoind

primecoind getinfo
error: couldn't connect to server

Heres my script:
Code:
#!/bin/bash
export PATH="/usr/local/bin:$PATH"
killall --older-than 10s -q run-primecoind primecoind
function background_loop
        while :; do
                primecoind >/dev/null 2>&1
                sleep 1
        done
background_loop &
mikaelh (OP)
Sr. Member
****
Offline Offline

Activity: 301
Merit: 250


View Profile
October 28, 2013, 12:00:32 PM
 #138

The killall command in the script occasionally kills the script itself (it's supposed to only kill previously started scripts). Try commenting out the line:
Code:
killall --older-than 10s -q run-primecoind primecoind
j28
Newbie
*
Offline Offline

Activity: 4
Merit: 0



View Profile
November 03, 2013, 08:55:33 AM
Last edit: November 03, 2013, 09:15:15 AM by j28
 #139

hi guys,

everything went well on ubuntu for me but I dont get this

Code:
test@kitchenpc:~$ ps xuf |grep primecoind
test     17600  0.0  0.0  16580   660 pts/1    S    09:34   0:00 /bin/bash ./run-primecoind
test     17601  282  2.3 1581368 90680 pts/1   SLl  09:34  44:52  \_ primecoind
test     17758  0.0  0.0  13636   972 pts/1    S+   09:50   0:00      \_ grep --color=auto primecoind

looks like its runing right?

but where can I see how fast am I hashing?
and where are my coins stored?
and how can I send them to my online wallet?
 
is there any gui for this?

paulthetafy
Hero Member
*****
Offline Offline

Activity: 820
Merit: 1000


View Profile
November 03, 2013, 09:19:55 AM
 #140

hi guys,

everything went well on ubuntu for me but I dont get this

Code:
test@kitchenpc:~$ ps xuf |grep primecoind
d315     17600  0.0  0.0  16580   660 pts/1    S    09:34   0:00 /bin/bash ./run-primecoind
d315     17601  282  2.3 1581368 90680 pts/1   SLl  09:34  44:52  \_ primecoind
d315     17758  0.0  0.0  13636   972 pts/1    S+   09:50   0:00      \_ grep --color=auto primecoind

looks like its runing right?

but where can I see how fast am I hashing?
and where are my coins stored?
and how can I send them to my online wallet?
 
is there any gui for this?
 

If you want to see a GUI you need to run the primecoin-qt which is similar to the wallet app for most coins.  I'm not sure it if is built when you follow the compilation guide, but you can download it.  I don't think you can run it at the same time as the primecoind daemon though, it's one or the other.

To see how fast you are "hashing" you need to use change to the folder that has the primecoind dameon and type "./primecoind getmininginfo".  This will give you some stats including your chainspermin, chainsperday, and primespersec values which indicate how fast it is mining. 

Your coins are stored in a wallet.dat file in your ~/.primecoin folder.  If you use the primecoin-qt GUI then you can see your balance and send coins from there.  Otherwise you can again use the daemon and call "./primecoind getbalance" to see your cleared balance, "./primecoind listaccounts" to see your balance including any blocks that have not matured, and then finally "./primecoind sendtoaddress XXXX" to send cleared coins to your "online wallet" wherever that is.

The getmininginfo command, along with a heap of others, can also be run from the debug console in the GUI (Help->Debug Window->Console).  Type help for a full list of commands. 
Pages: « 1 2 3 4 5 6 [7] 8 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!