Posts with tag: C++

distcc reduced compilation times to less than a half!

distcc is a program to distribute compilation of C, C++, Objective C or Objective C++ code across several machines on a network. Just evaluated distcc for building a ~1,4 Mio lines of code C++ code base on Linux with GCC. My local machine is already quite powerful. I usually build on 8 cores simultaneously (ninja -j8) with some quad-core Intel i7 and a quite fast SSD. A full build takes ~26 minutes.
→ Read More

A simple, customized logger, based on Boost.Log v2

Todays applications grow rapidly, complexity increases and finding bugs becomes more and more difficult. Especially for multi threaded applications, for applications that heavily depend on asynchronous external events or for applications that you don’t have local access to, an appropriate logging facility is invaluable for tracking down bugs. Boost.Log (v2) is a powerful C++ library that provides a simple way to integrate an extensible and performant logging facility in your application.
→ Read More

Creating and using shared libraries with different compilers on different operating systems

If you want to make your C/C++ project portable between operating systems and compilers, there are some things to consider. In this article I focus on shared libraries and give a practical overview on how to create and use shared libraries with various compilers on various operating systems, with the goal of portable source code and a unified build process. “A shared library or shared object is a file that is shared by executable files and further shared objects files.
→ Read More

Open source tools to examine and adjust include dependencies

In my previous post I wrote about include dependencies in general - why they matter and how to keep them at a minimum. In this article I’ll give a quick overview about the tools I evaluated and used to examine and adjust include dependencies of a large C++ project. I’ll cover some useful gcc compiler options, doxygen, cinclude2dot and the powerful include-what-you-use. GCC compiler options GCC provides some helpful options to determine/analyze include dependencies.
→ Read More

Why you should care about include dependencies in C/C++ and how to keep them at a minimum

When we think of dependencies, we usually think of “logical dependencies” at first: logical relations between classes, functions etc. Object oriented design, generic programming, encapsulation, design patterns are aimed to cut this “logical dependencies”. But there are also compile time dependencies - dependencies between files and libraries at compile time. This article is on include dependencies in C/C++ what are a sort of compile time dependencies. This dependencies have a huge impact on building, refactoring, testing and on the structure of your software.
→ Read More

Why I wouldn't use a dynamically typed language for large applications

Currently I’m developing for and maintaining a large code base that’s a mix of C++ and Python code. In this article I write about my experience about the type systems of statically typed C++ and dynamically typed Python, especially about the situations where I miss the explicit type information in dynamically typed languages. I use Python as synonym for dynamically typed languages because my experiences with python should also apply for other dynamically typed languages.
→ Read More

A QT Widget for Ogre3d

I recently played around with integrating Ogre3d into a QT5 Application. There are various resources about integrating Ogre3d and QT on the net, but for me non of them worked out of the box with recent QT5 and Ogre3d on Linux. Therefore i decided to publish my working implementation of an Ogre3d Qt widget that works on my up to date ArchLinux with Qt 5.2 and Ogre 1.9.0. You can find the sources on github.
→ Read More

Implementing undo/redo with the Command Pattern

This article is about implementing undo/redo functionality by utilizing the command pattern and assumes you know how the command pattern works (for a refresher on the command pattern you might take a look at this). To summarize, the command pattern is about representing and encapsulating all information that is needed to execute an action at a later time. Usually a command is an object that provides an interface execute(), which wraps the execution of the desired action.
→ Read More