Showing posts with label Qt. Show all posts
Showing posts with label Qt. Show all posts

Thursday, July 23, 2009

distcc made easy

The easiest way to set up a simple two machine distcc environment in Ubuntu 9.04.

Quick and dirty

install distcc on both client and server:
sudo apt-get install distcc

On server:
distccd --daemon --allow your_client_ip_address

On client:
export DISTCC_HOSTS='localhost your_server_ip_address'
make -j4 CC=distcc CXX=distcc

Please note the CXX=distc for projects using C++ e.g. Qt ;)

That's all it takes.

Permanent in project

To make distcc more permanent in your Qt project add the following two lines to yous .pro file:
QMAKE_CC = distcc
QMAKE_CXX = distcc

Which qmake will then generate to:
CC = distcc
CXX = distcc
in the make file.

export DISTCC_HOSTS='localhost your_server_ip_address'
make -j4

Visualize progress

To get visual response of what is happening use distccmon-gnome
(sudo apt-get install distccmon-gnome)

Tuesday, March 10, 2009

Qt Creator - A fun way to code Qt

Last November I came across a new lightweight C++ IDE named Qt Creator which is being developed at Qt Software (former Trolltech). Qt Creator is supposed to provide everything a Qt programmer needs, and it actually quite good at keeping its promise. At first I used it in parallel with Eclipse, but since Christmas it has been my primary IDE. In March I upgraded to the newly relesed version 1.00, which is the version I currently use.

All basic features expected to be found in an advanced text editor / IDE are supported, e.g. syntax highlighting, auto-indentation, (un-)commenting code, code folding, bookmarks etc. But also more advanced features are supported like code completion and error highlighting.

I like the easy code navigation and powerful search features, but I really miss code refactoring support which I hope the trolls will soon add. The integrated help is useful after you learn to remember that it's not located in the same window as the editor, this is frustrating when you out of old habit try to Alt-Tab yourself away from the Qt Assistant window.
I have very mixed feelings about the project view, but maybe I'm not using it correctly. I would like it to also show other files than the ones present in .pro files e.g. configuration files.

Since I work with Scratchbox I haven't familiarized myself that much with the building and debugging facilities provided. I did however get Qt Creator to compile inside Scratchbox but it generated the Makefiles wrong and I didn't have time to look into the problem. The form editor seems to be an integrated version of the normal Qt Designer, which is ok to use.

Support for two popular version control systems, Subversion and Git, is also available.

Qt Creator even contains vi key-bindings so vi users can feel at home. Sadly Emacs users are still left out in the cold.

Oh, I almost forgot, it's cross platform.