• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

Compiling on FreeBSD with Clang

sgeos

New member
I was going to ask if any had any advice on how to go about building darkcoind on FreeBSD 10 with clang, but I had an insight while trying to phrase the question and figured it out. If anyone else is interested, my notes are included below. My notes are written like a shell script, but obviously the files changes made with vim need to be carried out manually. FWIW, I installed net-p2p/bitcoin-daemon before trying to build darkcoind from source and I'm pretty sure it pulled in all the dependencies.
Code:
#!/usr/local/bin/bash

# shell and other convenience ports used
# cd /usr/ports/ports-mgmt/portmaster && make install clean
# portmaster shells/bash devel/git editors/vim

# required to build net-p2p/bitcoin-daemon
# portmaster devel/protobuf devel/pkgconf security/openssl devel/gmake devel/automake devel/autoconf

# required to run net-p2p/bitcoin-daemon
# portmaster security/openssl

# required libraries for net-p2p/bitcoin-daemon
# portmaster devel/boost-libs databases/db48

# set compilers and flags
export CC=clang
export CXX=c++
export CXXFLAGS="-I/usr/local/include -I/usr/local/include/db48"
export LDFLAGS="-L/usr/local/lib -L/usr/local/lib/db48"

# get source and build project
git clone https://github.com/darkcoinproject/darkcoin.git
cd darkcoin/src/
vim makefile.unix
# line 199 : obj/%.o: %.c rules needs to use $(CC) instead of $(CXX)
# line 65 : remove "-l dl \" from LIBS
gmake -f makefile.unix

# install darkcoind
su
# enter root password
cp ./darkcoind /usr/local/bin/darkcoind
chmod 555 /usr/local/bin/darkcoind
exit

# configure and run darkcoind
mkdir ~/.darkcoin/
vim ~/.darkcoin/darkcoin.conf

# fill darkcoin.conf user, password and options
# something like this will work:
#     rpcuser=darkcoinrpc
#     rpcpassword=<<your randomly generated password here>>
#     server=1
#     daemon=1
#     txindex=1
chmod 600 ~/.darkcoin/darkcoin.conf
darkcoind -reindex
# -reindex is not needed next time the server is started:
# darkcoind
# get the current block progress with the following command:
# echo `darkcoind getblockcount 2>&1`/`wget -O - http://chainz.cryptoid.info/drk/api.dws?q=getblockcount 2>/dev/null`

EDIT: Added "installation" instructions and a better way of checking current block progress.
 
Last edited by a moderator:
Back
Top