开发者

Building linux application through Vmware

I used to develop using Visual Studio on windows... (C++)

we recently migrated our app to linux (red-hat) , and currently each employee is building his own app is his own virtual machine using Vmware. out native OS is still Windows.

At first, it seemed that building using g++ was faster then using VS compiler, however, after some time, it seems like it tured out to be pretty slow. Is it beacuse we're using Vmware ? are there things we can do to accelerate the bu开发者_StackOverflowilding process ?


g++ is not a speed daemon, but it performs well. Yes, a VM can have unsteady performance, especially on disk access. You can always try ccache to avoid recompiling the parts you don't need to.

Or, ditch VMWare (and windows underneath) and do it all on Linux. either with a dedicated build box, or on your own machine. if you have to have a full featured GUI for writing, QtCreator is quite up to the task (no, it's not tied to only writing Qt applications).


I never really noticed that g++ was slower than VS or the opposite, but there is ways to make g++ go a lot faster.

  • ccache for instance. I tried it and it really speeds up the compilation.

    ccache is a compiler cache. It speeds up recompilation of C/C++ code by caching previous compilations and detecting when the same compilation is being done again

  • If you're working on a multicore machine you probably want to do multiprocess compilation, if you're using make you can do make -jX where X is your number of cores. Note you'll have to enable multicore on your virtual machines.

  • Disable compiler optimizations.

That said, whatever you do, compilation on a virtual machine wont be as efficient as compilation on a real machine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜