提高Qt Creator编译速度的7种方法の扩展篇:IncrediBuild v9.x使用详解,与Qt Creator v4.10搭配提速

一、前言

笔者在2019年初写了一篇《提高Qt Creator编译速度的7种方法》,其中第7种方法是使用第三方插件,IncrediBuild for Qt Creator。

IncrediBuild是Xoreax公司研发的一款强大的编程开发工具,可加快C/C++ 的编译和创建速度。能无缝集成到Visual Studio/Qt Creator开发环境中,采用Xoreax的多线程处理技术,不必改变项目文件的代码。IncrediBuild独特的并行处理方案能让用户实现快速的动态项目创建,将用户网络转换到一个虚拟的超级计算机中,利用远端机器的空闲CPU周期,不论这些机器是否正被使用。同时,IncrediBuild并不改变源代码,也绝对没有额外的硬件需求,因此,IncrediBuild在应用程序的创建和加速方面得到来自2000多个组织机构超过100000个用户的信赖也就不足为奇。具有如下优势:
IncrediBuild通过高效的并行计算实现加速创建应用,它利用网络上空闲的CPU资源,将PC和服务器网络转换到被称作“虚拟超级计算机”的私有计算云中。任务进程被分发到远端CPU资源用于并行计算,动态缩短创建应用时间达90%以上。

例如:
某C++项目编译整个工程:单机编译耗时3min40s,联机编译(2台电脑)耗时2min10s;
分布式编译的子节点越多(每台研发电脑都可当做子节点),编译效率越高。

本篇将详细介绍该方法。笔者使用的软件版本是IncrediBuild v9.4.4;Qt Creator v4.10。

 

二、软件下载与注册

Xoreax IncrediBuild是商业软件,需要License。但是也提供了免费版本给用户使用。免费版本最多支持四个CPU内核。

1、官网免费注册与登录

https://www.incredibuild.com/ibonlinestore/signup
https://www.incredibuild.com/ibonlinestore/login

2、免费许可证获得
FreeDev IncrediBuild Agent许可证最多支持四个内核。如果您的计算机上有四个以上的内核,请联系支持部门以获取支持更多内核的许可证版本。
https://www.incredibuild.com/FreeVisualStudioLicense

 

三、软件安装

1、去官网(需账号登录)下载好安装包incredibuild9_44.exe,使用自定义安装。

一路Next下去,都使用默认值。最后一个步骤是指向License文件:

2、软件默认是安装路径是C:\Program Files (x86)\IncrediBuild\,里面有install.exe文件,可以用来修复和卸载软件。此外,软件的启动程序是C:\Program Files (x86)\IncrediBuild\xgTrayIcon.exe,启动后在Windows的托盘看得见。

 

四、Qt Creator的配置

1、先去官网https://incredibuild.atlassian.net/wiki/spaces/IUM/pages/19202836/IncrediBuild+for+Qt+Creator下载插件文件IncrediBuild QT Creator 4.10 Plugin(x86).dll,版本要对号入座。

2、把Qt插件文件"IncrediBuild QT Creator 4.10 Plugin(x86).dll"拷贝进入Qt以下路径:\Qt5.12.5\Tools\QtCreator\lib\qtcreator\plugins\

3、启动Qt Creator,打开项目工程。

4、进入项目页面,点击“添加Build步骤”,选择IncrediBuild for Windows。

我们的目的是禁用原来的配置(如图,Eable/Disable按钮要是按下的状态),新增IncrediBuild的配置。最终结果如下:

接下来再挨个挨个讲解新增的IncrediBuild实现的qmake,Make和Clean的配置。

5、新增IncrediBuild实现的qmake的配置

重点关注一下参数,要确保正确
如果是MinGW编译器Make command:F:\Qt\Qt5.12.5\5.12.5\mingw73_32\bin\qmake.exe
如果是MSVC编译器Make command:F:\Qt\Qt5.12.5\5.12.5\msvc2017\bin\qmake.exe
Make arguments:F:\tmp-source\qt-hmi\HmiFuncDesigner-master\HmiFuncDesigner\HmiFuncDesigner.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
Profile.xml:F:\profile.xml

其中profile.xml的内容如下:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Profile FormatVersion="1">
  <Tools>
    <Tool Filename="mingw32-make.exe" AllowRemote="true" />
    <Tool Filename="qmake.exe" AllowRemote="true" />
    <Tool Filename="jom.exe" AllowRemote="true" />
    <Tool Filename="moc.exe" AllowRemote="true" />
    <Tool Filename="rcc.exe" AllowRemote="true" />
    <Tool Filename="uic.exe" AllowRemote="true" />
    <Tool Filename="lupdate.exe" AllowRemote="true" />
    <Tool Filename="lrelease.exe" AllowRemote="true" />
  </Tools>
</Profile>

6、新增IncrediBuild实现的Make的配置

重点关注一下参数,要确保正确
如果是MinGW编译器Make command:F:\Qt\Qt5.12.5\Tools\mingw730_32\bin\mingw32-make.exe
如果是MSVC编译器Make command:F:\Qt\Qt5.12.5\Tools\QtCreator\bin\jom.exe
Make arguments:-j4
Profile.xml:F:\profile.xml

profile.xml的文件内容与第5步相同

7、新增IncrediBuild实现的清除的配置

重点关注一下参数,要确保正确
Make command:F:\Qt\Qt5.12.5\Tools\mingw730_32\bin\mingw32-make.exe
Make arguments:clean -j4
Profile.xml:F:\profile.xml

profile.xml的文件内容与第5步相同

8、Qt Creator主菜单-构建-构建项目

 

五、联机的配置

1、举例两台电脑,电脑1是服务器,电脑2是客户端。两电脑都需要安装IncrediBuild。License在电脑1安装了,电脑2就装不了了,但是客户端不需要License也能用于连接服务器。

2、服务器配置

3、客户端配置

3、客户端连接上服务器之后,可以监控的到。只需在服务器的Qt Creator点击编译项目即可,客户端会自动帮忙分摊。如图所示的Helping 1 Agent。

恭喜你,提速成功!!

 

 

----------------------------------------------------------------附录---------------------------------------------------------------

incredibuild官方的文档:

Qt Creator中文官网说明:https://incredibuild.atlassian.net/wiki/spaces/IUMC/pages/449314876/IncrediBuild+Qt+Creator

Qt Creator英文官网说明:https://incredibuild.atlassian.net/wiki/spaces/IUM/pages/19202836/IncrediBuild+for+Qt+Creator
incredibuild自定义安装说明:https://incredibuild.atlassian.net/wiki/spaces/IUMC/pages/449315036
incredibuild从Visual Studio 2017内安装:https://incredibuild.atlassian.net/wiki/spaces/IUMC/pages/449315118/Visual+Studio+2017

incredibuild英文用户手册:https://incredibuild.atlassian.net/wiki/spaces/IUM/overview
incredibuild中文用户手册:https://incredibuild.atlassian.net/wiki/spaces/IUMC/overview
Creating a Profile XML File用户手册:https://incredibuild.atlassian.net/wiki/spaces/IUM/pages/13303979/Creating+a+Profile+XML+File

 

它山之石:

QT Creator+VS2015+IncrediBuild联合编译 --提高90%的编译速度

Qt MinGW 使用联合编译IncrediBuild

 

 

 

  • 3
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值