Bitcoin Forum
June 19, 2024, 01:54:45 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)  (Read 2125 times)
FuzzyBear (OP)
Legendary
*
Offline Offline

Activity: 1420
Merit: 1010



View Profile WWW
July 10, 2013, 06:44:53 PM
 #1

Hey everyone,

Had a few requests from people for help in building Primecoin from source on a linux OS so I decided to write up this handy guide so that everyone could do it themselves Smiley

http://www.devtome.com/doku.php?id=install_primecoin_ubuntu

If you have any problems then please post in this thread and i'll look into them or update the post as needs be.

Guide was requested as apparently you can get 3x more PPS building from source (maybe needs further optimisation?) but hope this gets some people some more coins.

FuzzyBear

***** Earn DEV at http://devtome.com *****
FuzzyBear (OP)
Legendary
*
Offline Offline

Activity: 1420
Merit: 1010



View Profile WWW
July 10, 2013, 06:53:18 PM
 #2

ok yeah so just running it now myself and my laptop gone from 10-20 PPS to 100-110 PPS so looks like this guide will hopefully let some non devs get some coins!!

***** Earn DEV at http://devtome.com *****
craslovell
Legendary
*
Offline Offline

Activity: 1470
Merit: 1021



View Profile WWW
July 10, 2013, 07:40:56 PM
 #3

Great guide Fuzzy. I'm getting owned by our proxy though, can't even get the dependencies I need downloaded  Sad
kendog77
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500


View Profile
July 10, 2013, 08:33:37 PM
 #4

That you FuzzyBear!

Did you notice much of an improvement running with the latest code here?
https://bitcointalk.org/index.php?topic=253662.0

I followed the guide, recompiled with Sunny's latest fix to prime.cpp / prime.h, compiled with the -O3 and -march=native flags and expected to see a performance improvement on an AMD A4 processor but the results seem to be about the same as the default primecoind linux build.

Do you have any tips for how to speed up performance?
tacotime
Legendary
*
Offline Offline

Activity: 1484
Merit: 1005



View Profile
July 10, 2013, 09:01:13 PM
 #5

You guys are welcome to my optimized ubuntu64 executable too, but I'll warn you that I have no idea if it's generating primes correctly (I altered a bunch of the code according to Mike's recommendations)

download here

Code:
XMR: 44GBHzv6ZyQdJkjqZje6KLZ3xSyN1hBSFAnLP6EAqJtCRVzMzZmeXTC2AHKDS9aEDTRKmo6a6o9r9j86pYfhCWDkKjbtcns
eule
Hero Member
*****
Offline Offline

Activity: 756
Merit: 501


View Profile
July 10, 2013, 09:55:14 PM
 #6

Nice guide, and very nice to post the binary tacotime! Too bad I'm on a 32 bit Mint and my server has no graphical UI.
Any chance of you or someone else uploading the three modified source files? I tried doing it myself but compiler ran into trouble, guess i made some mistakes...   Cheesy

96redformula
Full Member
***
Offline Offline

Activity: 224
Merit: 100


View Profile
July 10, 2013, 10:01:51 PM
 #7

You guys are welcome to my optimized ubuntu64 executable too, but I'll warn you that I have no idea if it's generating primes correctly (I altered a bunch of the code according to Mike's recommendations)

download here

Can somebody get this up on a direct link Smiley.
FuzzyBear (OP)
Legendary
*
Offline Offline

Activity: 1420
Merit: 1010



View Profile WWW
July 10, 2013, 11:55:27 PM
 #8

Ok i'll post a few builds I have here so people can test for themselves.... I'm on the 2nd  build and i gone from 10-20 PPS to 210 and still rising!!

http://donate.ppcointalk.org/primecoind.zip - code with first fix and compiled under make -f makefile.unix
http://donate.ppcointalk.org/primecoind.tar.gz - latest code fix and compiled under make -f makefile.unix

building one now under  make -O3 -march=native -f makefile.unix

***** Earn DEV at http://devtome.com *****
Zalfrin
Sr. Member
****
Offline Offline

Activity: 401
Merit: 250



View Profile
July 11, 2013, 12:16:05 AM
Last edit: July 11, 2013, 01:07:12 AM by Zalfrin
 #9

I also needed to install make.  Grin

Anyhow, on my DO droplet I'm getting an error, maybe the installed version of g++ is wrong?

g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64 -I/root/primecoin/src -I/root/primecoin/src/obj -DUSE_UPNP=0 -DUSE_IPV6=1 -I/root/primecoin/src/leveldb/include -I/root/primecoin/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2  -MMD -MF obj/init.d -o obj/init.o init.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.7/README.Bugs> for instructions.
make: *** [obj/init.o] Error 4
shinkicker
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
July 11, 2013, 07:55:38 AM
 #10

Nice guide. Two small points, maybe add 'make' to the RPM list. EC2's do not come with make as does the 'server' release of ubuntu. With that small addition it all went through for me.

Also its better to run as a daemon

Code:
./primecoind --daemon

Also if anyone is using headless this will set up your conf:

Code:
cat << 'EOF' > ~/.primecoin/primecoin.conf
# bitcoin.conf configuration file. Lines beginning with # are comments.
# server=1 tells Bitcoin to accept JSON-RPC commands.
server=1

# You must set rpcuser and rpcpassword to secure the JSON-RPC api
rpcuser=USERNAME
rpcpassword=PASSWORD

# Listen for RPC connections on this TCP port:
rpcport=9000

# You can use Bitcoin or bitcoind to send commands to Bitcoin/bitcoind
# running on another host using this option:
rpcconnect=127.0.0.1

# Set gen=1 to attempt to generate bitcoins
gen=1
EOF

Save the above as conf.sh and then do

$ chmod u+x  conf.sh

and finally..

./conf.sh

EDIT:

You can't compile on a EC2 micro instance:

[652846.409725] Out of memory: Kill process 14520 (cc1plus) score 921 or sacrifice child
[652846.409740] Killed process 14520 (cc1plus) total-vm:587212kB, anon-rss:555376kB, file-rss:124kB
FuzzyBear (OP)
Legendary
*
Offline Offline

Activity: 1420
Merit: 1010



View Profile WWW
July 11, 2013, 12:58:21 PM
 #11

Nice guide. Two small points, maybe add 'make' to the RPM list. EC2's do not come with make as does the 'server' release of ubuntu. With that small addition it all went through for me.

Also its better to run as a daemon

Code:
./primecoind --daemon

Also if anyone is using headless this will set up your conf:

Code:
cat << 'EOF' > ~/.primecoin/primecoin.conf
# bitcoin.conf configuration file. Lines beginning with # are comments.
# server=1 tells Bitcoin to accept JSON-RPC commands.
server=1

# You must set rpcuser and rpcpassword to secure the JSON-RPC api
rpcuser=USERNAME
rpcpassword=PASSWORD

# Listen for RPC connections on this TCP port:
rpcport=9000

# You can use Bitcoin or bitcoind to send commands to Bitcoin/bitcoind
# running on another host using this option:
rpcconnect=127.0.0.1

# Set gen=1 to attempt to generate bitcoins
gen=1
EOF

Save the above as conf.sh and then do

$ chmod u+x  conf.sh

and finally..

./conf.sh

EDIT:

You can't compile on a EC2 micro instance:

[652846.409725] Out of memory: Kill process 14520 (cc1plus) score 921 or sacrifice child
[652846.409740] Killed process 14520 (cc1plus) total-vm:587212kB, anon-rss:555376kB, file-rss:124kB


Brilliant thank you for the feedback, added the run as daemon change to the doc, and what did you have to do to install make?? just run
Code:
sudo make install
if so i'll add that the the doc. Many thanks again for the feedback and hope you are getting lots of coins now.... I seem to have stopped getting them as my PC's are all very old Sad

***** Earn DEV at http://devtome.com *****
Zalfrin
Sr. Member
****
Offline Offline

Activity: 401
Merit: 250



View Profile
July 11, 2013, 01:51:24 PM
 #12

I did an apt-get make install I believe, but ultimately I just ended up following this thread: https://bitcointalk.org/index.php?topic=252944.0

For out-of-memory errors on small server instances, there are instructions in that thread for setting up a temporary swap space so the compiler can use the disk space as additional memory.
Pages: [1]
  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!