Easy and portable Steem install script: speeded up with Ninja-build

in #steem8 years ago

Why this script?

My script is modified from @xiaohui, which is derived and/or translated from @abit and @furion .
Their scripts build steem using standard Makefile genarated by CMake, which cannot take advantage of mordern hardware. The building process is very slow. On my Dual-Xeon server it takes about half an hour. Simply using make -j 8 doesn't speed up building, unfortunately. So I modify their scripts to build steem with Ninja-build, a blazing fast building tool.

Using this script

Download and run the latest script:

https://github.com/adoal/install-steemd-fast/raw/master/install-steemd.sh
chmod +x  install-steemd.sh
./install-steemd.sh

You can, of course, run it manually by following the steps inside this script.

How it works

Source code of Steem is written in C++, with boost. Compiling C++ code with template heavily used is a time consuming job. Traditional Makefile is built one-by-one serially. There is a -j directive to run several make task, but it depends.

Since the building system of Steem is CMake, which is in fact a building-script generator instead of a bottom layer building system, we can try other backends, not the default Makefile. Ninja-build is a modern one. It defaults to run equivalent number of tasks to that of CPU cores.

As a compare, on a HP Proliant BL460c G7 server, with Dual 6-core Xeon 5650 2.67GHz and 48GiB memory, standard Makefile takes exactly half an hour, while Ninja-build takes 7.5 minutes. The accerating ratio is 4 instead of 12, because there are dependencies between subtasks which keep the building process from fully parallelized. But 1/4 time is amazing fast too :)

Reference

Sort:  

Great job, thank you!

Thank you so much @adoal. Saving 75% of compiling time is so amazing.

有点来晚了啊,给豆大一顶~