PPCoinTalk - PeerCoin (PPC) & PrimeCoin (XPM)

PrimeCoin (XPM) => General Discussion => Topic started by: FuzzyBear on July 10, 2013, 07:50:13 pm

Title: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: FuzzyBear on July 10, 2013, 07:50:13 pm
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
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: FuzzyBear on July 11, 2013, 01:03:19 am
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
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: CryptoBeggar on July 11, 2013, 12:52:31 pm
Are you doing a statically linked binary?
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: FuzzyBear on July 11, 2013, 01:42:22 pm
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??
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: lasle2 on July 11, 2013, 02:15:56 pm
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.
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: lasle2 on July 11, 2013, 02:32:50 pm
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.
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: CryptoBeggar on July 11, 2013, 04:55:54 pm
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??
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: Sushi on July 11, 2013, 10:28:46 pm
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?

Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: lasle2 on July 12, 2013, 06:15:41 am
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.
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: MUTO on July 12, 2013, 12:46:29 pm
Is there a way to compile the qt of the actual improved version for linux?
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: lasle2 on July 12, 2013, 06:02:02 pm
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=-"
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: CryptoBeggar on July 14, 2013, 09:58:45 am
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  :-\
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: ivanlabrie on July 15, 2013, 03:07:14 am
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:
(http://img690.imageshack.us/img690/3173/h5gd.jpg)
And this when compiling:
(http://img96.imageshack.us/img96/8050/yeag.jpg)

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
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: ivanlabrie on July 15, 2013, 02:41:49 pm
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
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: tinnvec on July 15, 2013, 07:16:53 pm
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
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: tinnvec on July 15, 2013, 07:20:27 pm
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)
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: DR3AMR2 on July 16, 2013, 08:57:55 am
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
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: MUTO on July 16, 2013, 09:17:07 am
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
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: tjb0607 on July 16, 2013, 09:17:57 am
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
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: maco on July 16, 2013, 08:05:11 pm
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?
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: CryptoBeggar on July 18, 2013, 09:16:48 pm
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!
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: ivanlabrie on July 18, 2013, 09:28:04 pm
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.
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: CryptoBeggar on July 18, 2013, 10:36:03 pm
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.
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: ivanlabrie on July 18, 2013, 11:57:13 pm
Just compile it on each machine...problem solved.
Or use win binaries (yuck)
Title: Re: [Primecoin] How to build the client from source on Linux (Ubuntu 12.04)
Post by: CryptoBeggar on July 19, 2013, 03:21:10 pm
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).