How to do a depends build for namecore

Namecoin, NMControl
Post Reply
moa
Posts: 255
Joined: Mon May 23, 2011 6:13 am

How to do a depends build for namecore

Post by moa »

This should work on any linux or OSX and builds the full suite of namecoind, namecoin-cli, namecoin-tx and namecoin-qt. It downloads all the dependencies it needs as source, checks the hash of the dependency source and builds them from source locally.

I assume you have already cloned the github source for namecore

Code: Select all

git clone https://github.com/namecoin/namecore.git
Go into namecore dir

Code: Select all

cd namecore
1) Create a directory for caching the deps builds outside of namecoin src that wont be wiped when cleaning between builds: I put mine one above src

Code: Select all

mkdir ../cached-depends
2) Create another directory for caching the source tarballs

Code: Select all

mkdir ../cached-depends/source
3) Clean up the local git tree to pristine (beware this is scorched earth cleanliness so make sure you save anything you want to keep somewhere outside of namecoin/namecore)

Code: Select all

git reset --hard HEAD
git clean -dfx
4)Build the dependencies from known source: (This takes a while to download and build but you only have to do this once now and whenever dependencies are bumped up a version, as per bitcoin schedule)

Code: Select all

cd depends

Code: Select all

make -j4 BASE_CACHE="PATH_TO_CACHE/cached-depends" SOURCES_PATH="PATH_TO_CACHE/cached-depends/sources/"
NB: you have to figure out the absolute path 'PATH_To_CACHE' for where you created the cached-depends dir and sub in above.

5) Build namecore:

Code: Select all

cd ..
./autogen.sh
./configure --prefix=`pwd`/depends/x86_64-unknown-linux-gnu
make -j4
The 'x86_64-unknown-linux-gnu' will be different as to what platform you are building on. Look in the PATH_TO_CACHE/cached-depends directory after step 4) and there will a new directory in there with the name of your platform that you should use. This is a ccache build so should go quick on subsequent builds after the first one. I have a build_namecore.sh bash script that does all this, except the initial dir creation, if anybody is interested.

The binaries will be in the usual locations, e.g. if you want to run namecoin-qt in situ

Code: Select all

./src/qt/namecoin-qt

moa
Posts: 255
Joined: Mon May 23, 2011 6:13 am

Re: How to do a depends build for namecore

Post by moa »

Oh yeah, any time you want to build the latest namecore using the framework you set up above:

go into namecore dir, pull the latest code and clean the tree:

Code: Select all

cd namecore
git pull
git clean -dfx
Now repeat steps 4) and 5) in the OP.

biolizard89
Posts: 2001
Joined: Tue Jun 05, 2012 6:25 am
os: linux

Re: How to do a depends build for namecore

Post by biolizard89 »

On Debian Jessie, steps 4 and 5 failed for me unless I did this first:

Code: Select all

sudo apt-get install pkg-config autoconf libtool
Jeremy Rand, Lead Namecoin Application Engineer
NameID: id/jeremy
DyName: Dynamic DNS update client for .bit domains.

Donations: BTC 1EcUWRa9H6ZuWPkF3BDj6k4k1vCgv41ab8 ; NMC NFqbaS7ReiQ9MBmsowwcDSmp4iDznjmEh5

somename
Posts: 80
Joined: Mon Sep 15, 2014 3:12 pm
os: windows

Re: How to do a depends build for namecore

Post by somename »

biolizard89 wrote:On Debian Jessie, steps 4 and 5 failed for me unless I did this first:

Code: Select all

sudo apt-get install pkg-config autoconf libtool
pkg-config is a new requirement in Bitcoin Core 0.11. It's not used if you build on Windows, but even on Windows it has to be installed.

The same 3 packages need to be added to Ubuntu 14.04 as well (compared to Bitcoin Core 0.10).

Post Reply