Tuesday, February 21, 2012


Visual Studio Precompiled Headers

I've no idea why this information is not easily findable on microsoft.com: http://www.cygnus-software.com/papers/precompiledheaders.html

Worked perfectly, with the only caveat that I had some C files (in a mainly C++ project) which are fairly standalone (and 3rd party) so didn't want to add stdafx.h to them -- selecting the .c files in the solution, right clicking and (for all configs again) switching off precompiled headers for these files gave me a clean build at 10% of the time.

The double level pch appeals to some degree for when we have a stable code base and just the plugins/leaf nodes are changing -- then again, that's probably time for a library / real plugin design. Right now compiles are fast enough to not bother I reckon.

Labels: , , , , ,

Tuesday, February 07, 2012


C++ disruptor autoconf / automake hell

I'll try to avoid a tirade about the state of C++ build tools, but I was having a problem persuading the https://github.com/fsaintjacques/disruptor-- project to build. Given that the code is mainly headers (which I like since I consider most cpp files a code smell), the pain was disproportionate. Anyway, here's a compile command for those who just want to run the code (save as a script):

#! /bin/bash

export LD_LIBRARY_PATH=/opt/gcc-4.6.2/lib64/:$LD_LIBRARY_PATH

g++ -I .. \
-I /opt/boost/linux64/1.48.0/ \
-std=gnu++0x \
-lboost_unit_test_framework -L /opt/boost/linux64/1.48.0/lib \
-O3 -march=native -DNDEBUG \
-o ${1%.*} $1

Labels: , , ,

This page is powered by Blogger. Isn't yours?