Posts with tag: Linux

SELinux basics

I recently came in touch with SELinux when I had to write/extend a policy for a commercial app. This post is some kind of notepad/cheatsheet I created while learning the topic. The aim is to document the concepts and commands which are necessary in order to be able to understand the basics and modify/adjust an existing SELinux policy.
→ Read More

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

gprof, Valgrind and gperftools - an evaluation of some tools for application level CPU profiling on Linux

In this post I give an overview of my evaluation of three different CPU profiling tools: gperftools, Valgrind and gprof. I evaluated the three tools on usage, functionality, accuracy and runtime overhead. The usage of the different profilers is demonstrated with the small demo program cpuload, available via my github repository gklingler/cpuProfilingDemo. The intent of cpuload.cpp is just to generate some CPU load - it does nothing useful. The bash scripts in the same repo (which are also listed below) show how to compile/link the cpuload.
→ 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

Howto get hardware accelerated OpenGL support in Docker

I recently played around with Docker and tried to get OpenGL with hardware acceleration/direct rendering (DRI) to work. This was no big deal, but there are some things that must be considered and I want to share with you: The graphics driver in the docker container must be the same as on the host system. The X server on the host must permit connections from the docker container (this is what xhost + in run.
→ Read More

How to use a chroot-jail for software development

In this tutorial I show you how you can easily setup and use a chroot-jail on Linux, and explain why this can be especially useful for software development. My main operating system is Arch Linux - I really like it because of it’s simplicity, flexibility and always up to date packages because of it’s rolling release style. A disadvantage of a rolling release style (for software development) is that the system is quite “volatile”: Major packet update can happen every time you update your system or just certain packages.
→ 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