Building steemd on Debian 9
steemdevยท@almost-digitalยท
0.000 HBDBuilding steemd on Debian 9
I had some trouble getting steemd to compile on Debian 9 (Stretch) so I'm documenting the process that finally worked for me in the hopes that it will save someone else a bit of time. I think this guide will work for Ubuntu 17 as well, YMMV.  --- First make sure you got the basics for building by running: ``` apt-get build-essential git autoconf automake cmake python-dev autotools-dev ``` ## Boost 1.60 Stretch comes only with packages for boost 1.62 which is not supported yet, so we need to build our own version. Download and extract boost 1.60: ``` wget https://downloads.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2 tar xjfv boost_1_60_0.tar.bz2 cd boost_1_60_0 ``` ๐ข Then we need to patch it to work with gcc 6.3.0 that comes with sterch: ``` wget https://github.com/boostorg/multiprecision/commit/f9c8f9ec091ad232c0a291904f7839d665d098e0.patch patch boost/multiprecision/cpp_int.hpp f9c8f9ec091ad232c0a291904f7839d665d098e0.patch ``` ๐ข Get the dependencies: ``` apt-get install libbz2-dev libicu-dev ``` ๐ข Finally build & install it (replace -j 32 with the number of cpu cores you have): ``` mkdir -p /opt/steem ./bootstrap.sh --prefix=/opt/steem ./b2 --with=all -j 32 install ``` ๐ข This will take a while so open up a new terminal and star preparing for the next step. ## OpenSSL 1.0.2 Sterch comes with OpenSSL 1.1.something and that does not work, so we need 1.0.2, not sure what version is recommended but the latest 1.0.2l works fine. ``` https://www.openssl.org/source/openssl-1.0.2l.tar.gz tar xvzf openssl-1.0.2l.tar.gz cd openssl-1.0.2l ./config --prefix=/opt/steem make -j32 make install ``` ๐ข ## Finally, we can build steemd Grab the dependencies ``` apt-get install libtool pkg-config python3 python3-jinja2 doxygen libncurses5-dev libreadline-dev perl ``` ๐ข Get the source, pay attention here and make sure to check out the `v0.19.0` tag *before* pulling the submodules! ``` git clone https://github.com/steemit/steem cd steem git checkout v0.19.0 git submodule update --init --recursive mkdir build && cd build ``` ๐ข You probably want to have a look at the different flags over at https://github.com/steemit/steem/blob/master/doc/building.md the ones I'm using in this example is for a witness node. ``` cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/steem -DLOW_MEMORY_NODE=YES -DSKIP_BY_TX_ID=YES .. ``` ๐ข Moment of truth! If you did everything right steemd should compile without errors. The perl export is needed for the doxygen target install depends on, if you just want to build the steemd binary you can skip it. ``` export PERL_USE_UNSAFE_INC=1 make -j32 steemd make -j32 install ``` ๐ข Now you have all the steem binaries in `/opt/steem/bin`.