Author Topic: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)  (Read 1219 times)

Offline FuzzyBear

  • Administrator
  • Sr. Member
  • *****
  • Posts: 228
  • Karma: +15/-0
    • View Profile
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 :)

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
BTC: 1FvMYwtkrQakoL8Zq1GjfKqTkm2a7TKt6N  |  LTC: LbMPUzwPRkWa5hCJGrEiRCeoYExY6Ujt1D  |  DEV: 1JfbPx4nSGFxfzhTK1h3gHbp1E1BkFbwFW
PPC: PDtcFPhMa9Hc9zTfoRG7zcURCRpcpRdMym  |  TRC: 1FzdruHpffAeW2ZBctDLwR8P4APVpATu2j  |  FRC: 1BADxscUvT42SFXZwXgxEfWVDHkV1QPTEj
NMC: N7q9zg9h4Scfx6R25RTL8LdGxCBQbgq8wz  |

Offline FuzzyBear

  • Administrator
  • Sr. Member
  • *****
  • Posts: 228
  • Karma: +15/-0
    • View Profile
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 .... <--- ok that doesn't work...

APkVyn9uJ8LvkGgkQeyamUig4h2bFew8AD
« Last Edit: July 11, 2013, 01:07:00 am by FuzzyBear »
BTC: 1FvMYwtkrQakoL8Zq1GjfKqTkm2a7TKt6N  |  LTC: LbMPUzwPRkWa5hCJGrEiRCeoYExY6Ujt1D  |  DEV: 1JfbPx4nSGFxfzhTK1h3gHbp1E1BkFbwFW
PPC: PDtcFPhMa9Hc9zTfoRG7zcURCRpcpRdMym  |  TRC: 1FzdruHpffAeW2ZBctDLwR8P4APVpATu2j  |  FRC: 1BADxscUvT42SFXZwXgxEfWVDHkV1QPTEj
NMC: N7q9zg9h4Scfx6R25RTL8LdGxCBQbgq8wz  |

Offline CryptoBeggar

  • Jr. Member
  • **
  • Posts: 9
  • Karma: +0/-0
  • Hello I'm new here
    • View Profile
Are you doing a statically linked binary?

Offline FuzzyBear

  • Administrator
  • Sr. Member
  • *****
  • Posts: 228
  • Karma: +15/-0
    • View Profile
Are you doing a statically linked binary?

erm my terminology letting me down here but i think i know what u mean,

the two links in the second post are binaries that I have compiled and then uploaded to a server which point out on the web so you can get the compiled source code without having to compile yourself.  These binaries are not going to move or be updated with latest source code compiled when changes made, I will build again and post a new link should sunnyking change source code.

Is that a staticly linked binary as opposed to a dynamic linked one??
BTC: 1FvMYwtkrQakoL8Zq1GjfKqTkm2a7TKt6N  |  LTC: LbMPUzwPRkWa5hCJGrEiRCeoYExY6Ujt1D  |  DEV: 1JfbPx4nSGFxfzhTK1h3gHbp1E1BkFbwFW
PPC: PDtcFPhMa9Hc9zTfoRG7zcURCRpcpRdMym  |  TRC: 1FzdruHpffAeW2ZBctDLwR8P4APVpATu2j  |  FRC: 1BADxscUvT42SFXZwXgxEfWVDHkV1QPTEj
NMC: N7q9zg9h4Scfx6R25RTL8LdGxCBQbgq8wz  |

Offline lasle2

  • Jr. Member
  • **
  • Posts: 12
  • Karma: +2/-0
    • View Profile
Any tips on how to build for Centos? I tried on Centos 6.4 last night but the build appears to be looking for the includes in the wrong places. I have yum installed all the depenencies.

My C dev skills are weak so I don't know to to fix the include lookup.
[XPM] ANkMtJWzv3YT6T3gDQZAVtQF829ZUyYKCJ [BTC] 18nHwySUrYaJpSD6PWbTzsawYgqGm2gsEH
[LTC] LP6Eu6XVBQKz9CdCRivoeU45T8SJD6NVoj [PPC] PRm7zKdCE7pbEoTNcrd4FwBLFXM6zSJBLD

Offline lasle2

  • Jr. Member
  • **
  • Posts: 12
  • Karma: +2/-0
    • View Profile
Would anyone mind posting a quick guide on how to build for windows? I need binaries that will work on Core 2's and all the latest ones only seem to work for newer processors. They crash on my Core 2 windows machines but work on my i7s and i5.
« Last Edit: July 11, 2013, 04:10:05 pm by lasle2 »
[XPM] ANkMtJWzv3YT6T3gDQZAVtQF829ZUyYKCJ [BTC] 18nHwySUrYaJpSD6PWbTzsawYgqGm2gsEH
[LTC] LP6Eu6XVBQKz9CdCRivoeU45T8SJD6NVoj [PPC] PRm7zKdCE7pbEoTNcrd4FwBLFXM6zSJBLD

Offline CryptoBeggar

  • Jr. Member
  • **
  • Posts: 9
  • Karma: +0/-0
  • Hello I'm new here
    • View Profile
You guessed right, I actually don't know what is a proper expression in this case.

Anyway I was trying to create a more recent compilation, so I can use it on the other machine (I have an older version of suse distribution there, so I'm actually unable to compile it there properly...), but wasn't successful so far. Have you used statically linked libraries?
 

Are you doing a statically linked binary?

erm my terminology letting me down here but i think i know what u mean,

the two links in the second post are binaries that I have compiled and then uploaded to a server which point out on the web so you can get the compiled source code without having to compile yourself.  These binaries are not going to move or be updated with latest source code compiled when changes made, I will build again and post a new link should sunnyking change source code.

Is that a staticly linked binary as opposed to a dynamic linked one??

Offline Sushi

  • Jr. Member
  • **
  • Posts: 3
  • Karma: +0/-0
  • Hello I'm new here
    • View Profile
Great post FuzzyBear!  Thanks!

Now how would I go about setting up several servers to mine and have the coins end up in my wallet on my PC?


Offline lasle2

  • Jr. Member
  • **
  • Posts: 12
  • Karma: +2/-0
    • View Profile
I decided to just install Ubuntu on my Centos boxes instead of spending an unknown amount of time learning how to migrate the make file between the two. Easy to build on Ubuntu and now my linux boxes are pulling down some nice pps :)

For the windows boxes I decided to just install ubuntu in virtualbox vms. Had to turn on the vt-x virtualization in the bios to get it to work but it was pretty easy overall. The vms get similar pps as the native ubuntu boxes.

Will be doing some experimenting with building on windows tomorrow. May write up a guide if I get it working.
[XPM] ANkMtJWzv3YT6T3gDQZAVtQF829ZUyYKCJ [BTC] 18nHwySUrYaJpSD6PWbTzsawYgqGm2gsEH
[LTC] LP6Eu6XVBQKz9CdCRivoeU45T8SJD6NVoj [PPC] PRm7zKdCE7pbEoTNcrd4FwBLFXM6zSJBLD

Offline MUTO

  • Jr. Member
  • **
  • Posts: 45
  • Karma: +2/-1
  • Hello I'm new here
    • View Profile
Is there a way to compile the qt of the actual improved version for linux?

Offline lasle2

  • Jr. Member
  • **
  • Posts: 12
  • Karma: +2/-0
    • View Profile
Code: [Select]
sudo apt-get install qt4-qmake libqt4-dev build-essential libboost-dev libboost-system-dev \
    libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev \
    libssl-dev libdb++-dev libminiupnpc-dev -y

qmake
make

On a newer version of ubuntu should work. Have not tried it as I only run a command prompt.

May need to add "USE_UPNP=-" to the qmake command:

qmake "USE_UPNP=-"
« Last Edit: July 12, 2013, 06:04:21 pm by lasle2 »
[XPM] ANkMtJWzv3YT6T3gDQZAVtQF829ZUyYKCJ [BTC] 18nHwySUrYaJpSD6PWbTzsawYgqGm2gsEH
[LTC] LP6Eu6XVBQKz9CdCRivoeU45T8SJD6NVoj [PPC] PRm7zKdCE7pbEoTNcrd4FwBLFXM6zSJBLD

Offline CryptoBeggar

  • Jr. Member
  • **
  • Posts: 9
  • Karma: +0/-0
  • Hello I'm new here
    • View Profile
Has anyone managed to build a binary for Linux out of the latest 0.1.1 version o mikaelh's update? I'm working on one including dynamic libraries, but no success so far  :-\

Offline ivanlabrie

  • Jr. Member
  • **
  • Posts: 12
  • Karma: +1/-0
  • Hello I'm new here
    • View Profile
Hi there, thanks for the great guide.

Having some trouble setting up my linux miner.
Using ubuntu 12.04 server, console only...only 256mb of ram though.
I created a 1gb swap file btw.

This happens when doing sudo apt-get install libcurl4-openssl-dev:

And this when compiling:


I managed to compile the client succesfully in digital ocean's vps instances before, not sure what's wrong with this rig.
Thanks in advance!

ps: it's a fresh ubuntu install btw

Offline ivanlabrie

  • Jr. Member
  • **
  • Posts: 12
  • Karma: +1/-0
  • Hello I'm new here
    • View Profile
Ok, this seems to be the problem but I'm too much of a noob to know how to solve it.

https://github.com/ros/rosdistro/commit/887346590cfefc0b6c1cd0288058d7c6a6c289bf

Offline tinnvec

  • Jr. Member
  • **
  • Posts: 4
  • Karma: +0/-0
  • Hello I'm new here
    • View Profile
First off, excellent guide, thank you very much.

While I'm quite familiar with compiling for linux, I'd like to put my Mac to work as well, but have never compiled anything for it (mainly use it for my web dev work). Could someone point me in the right direction on compiling for mac? My Google Fu seems to be weak on this search  :o

EDIT: I actually found that there are a few small differences, but using mac ports, you can install all needed dependencies, and simply compile using makefile.osx
« Last Edit: July 15, 2013, 07:58:00 pm by tinnvec »

Offline tinnvec

  • Jr. Member
  • **
  • Posts: 4
  • Karma: +0/-0
  • Hello I'm new here
    • View Profile
Has anyone managed to build a binary for Linux out of the latest 0.1.1 version o mikaelh's update? I'm working on one including dynamic libraries, but no success so far  :-\

I am currently running it now, I didn't need to install anything extra beyond what is needed for the default client, what are the errors you're seeing?

(oh and sorry for the double post, just trying to be helpful)

Offline DR3AMR2

  • Jr. Member
  • **
  • Posts: 3
  • Karma: +0/-0
  • Hello I'm new here
    • View Profile
Has anyone managed to build a binary for Linux out of the latest 0.1.1 version o mikaelh's update? I'm working on one including dynamic libraries, but no success so far  :-\

I needed to add this dependency in order for me to make it work for linux and the mikaelh's source code.

Code: [Select]
apt-get install libgmp-dev

Offline MUTO

  • Jr. Member
  • **
  • Posts: 45
  • Karma: +2/-1
  • Hello I'm new here
    • View Profile
Same here, but I used libgmp3-dev. Had no problems with combiling the Linux version then. It´s running very well with nearly 5000PPS on my Dual Quadcore 2,4Ghz Xeon machines. Even my Core2duo on one core get´s about 700 PPS (windows precombiled version). About 2000PPS on my i5 Notebook and 3500PPS on my 3Ghz Xeon Quadcore Workstation.

It´s realy exciting how much improvement this version gives. Just wondering, if this is just PPS or also Blockfindingrate. Already found a few Blocks, so it basically seems to work.

Please note, that he github repository is currently down. But building the newest relase out of the following sources also worked fine:
Quote from: mikaelh @ Bitcointalk
http://sourceforge.net/projects/primecoin-hp/files/0.1.1-hp4/primecoin-0.1.1-hp4.tar.bz2/download
« Last Edit: July 16, 2013, 09:19:05 am by MUTO »

Offline tjb0607

  • Newbie
  • *
  • Posts: 1
  • Karma: +2/-0
    • View Profile
building one now under  make -O3 -march=native -f makefile.unix .... <--- ok that doesn't work...

You need to do it by setting CXXFLAGS, because -O3 and -march are g++ flags, not make flags.

Code: [Select]
make CXXFLAGS="-O3 -march=native" -f makefile.unix primecoind
XPM: AUohr3skoRY5f1Rp6Pab1q8xDJzTJPE2Jh // BTC: 1octixjpZZUhh2jmyoaQsSedDiw7wFkhg

Offline maco

  • Jr. Member
  • **
  • Posts: 5
  • Karma: +0/-0
  • Hello I'm new here
    • View Profile
Thanks for the guide. Can you write up something for EC2 or do you already have one? I am not sure if it follows the same principles?

Offline CryptoBeggar

  • Jr. Member
  • **
  • Posts: 9
  • Karma: +0/-0
  • Hello I'm new here
    • View Profile
I would like to ask again for help on building universal linux build (like the one posted on sourceforge). Is it only using statically linked libraries or also anything else?

Thank you to anyone kind enough to respond!

Offline ivanlabrie

  • Jr. Member
  • **
  • Posts: 12
  • Karma: +1/-0
  • Hello I'm new here
    • View Profile
I would like to ask again for help on building universal linux build (like the one posted on sourceforge). Is it only using statically linked libraries or also anything else?

Thank you to anyone kind enough to respond!

This guide worked perfectly fine for me: http://ecoinomist.com/xpm-primecoin-mining-guide-on-linux
You need 512mb ram and 1gb swap, or more.

Offline CryptoBeggar

  • Jr. Member
  • **
  • Posts: 9
  • Karma: +0/-0
  • Hello I'm new here
    • View Profile
I would like to ask again for help on building universal linux build (like the one posted on sourceforge). Is it only using statically linked libraries or also anything else?

Thank you to anyone kind enough to respond!

This guide worked perfectly fine for me: http://ecoinomist.com/xpm-primecoin-mining-guide-on-linux
You need 512mb ram and 1gb swap, or more.

Thank you, although I am attempting to build a binary on one machine and transfer it on two others with the same architecture but different OS. I know it is possible as fuzzy and sunny both created at least one, but am not sure on which distro I should do this.

Offline ivanlabrie

  • Jr. Member
  • **
  • Posts: 12
  • Karma: +1/-0
  • Hello I'm new here
    • View Profile
Just compile it on each machine...problem solved.
Or use win binaries (yuck)

Offline CryptoBeggar

  • Jr. Member
  • **
  • Posts: 9
  • Karma: +0/-0
  • Hello I'm new here
    • View Profile
I'm having problem with some libraries, that's why I am looking for this kind of solution (a bit obsolete system on one computer which is also a server).