为什么要写这个脚本
我的脚本是根据 @xiaohui 那个修改的,而源头来自 @abit 和 @furion 。
他们的脚本用CMake生成的标准Makefile来编译,无法充分利用现代硬件的性能,编译过程很慢。我在双路至强服务器上测试要花半小时,即使用make -j 8
也无济于事。所以我修改了他们的脚本,用Ninja-build这个超快的工具来组织编译。
如何使用这个脚本
从如下位置下载最新版脚本并运行:
https://github.com/adoal/install-steemd-fast/raw/master/install-steemd.sh
chmod +x install-steemd.sh
./install-steemd.sh
当然也可以根据脚本里面写的步骤手工运行。
加速原理
Steem源代码是用C++写的,用了boot库,编译这种重度使用模板的C++代码耗时极长。传统的Nakefile只能一个一个文件顺序编译,理论上可以用-j
指令来并行启动多个make
任务但要看具体情况,未必总有用。
Steem的编译系统用的是CMake。其实它并不是底层真正的编译系统,而是根据规则生成编译指令的工具,所以我们除了Makefile之外也可以试试其它后端,比如更加新潮的Ninja-build,默认会根据CPU内核数来运行
在真实硬件上的比较:HP Proliant BL460c G7服务器,双路Xeon 5650六核服务器,主频2.67GHz,48GiB内存。标准的Makefile编译正好需要半小时,用Ninja-build则缩短为7分半。之所以加速仅有4倍而不是12倍,因为子任务之间的依赖导致编译过程不可能完全并行。但是时间缩短到1/4已经很让人惊喜啦。
浙大的网管终于出手了。 :) 顶一下
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
你开始挖了没?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @adoal! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
欢迎豆薯。技术大牛来了,哈哈哈
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
原来是豆大啊,豆大威武
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
猪圈混的都是牛B, 我更想知道运行结果,一天收获怎样
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
steem的挖矿收益也很慢的……我用这个服务器一天下来也不到一个SP
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
玩这个还是会写文章的人比较爽:p
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
哈哈,写文是个体力活,就当是写博客了,如果一天挖到1-2个power,有条件还是可以去做的
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
以后就用这个啦。有谁写写steemd的配置和cli_wallet的使用?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
不愧是豆大,出手就是技术类的高质量文章,我先赞,晚来的后悔吧,嘿嘿。
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
牛B大了啊
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
威武!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
豆大威武!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
我编译好了才看到你的大作,亏大了。
要不要删除了再重新编译一下看看?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @adoal! You have received a personal award!
2 Years on Steemit
Click on the badge to view your Board of Honor.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit