Compilation and Installing

When I try to compile the examples of the OpenLB release, the C++ compiler generates pages of error messages. What’s wrong?

Your C++ compiler might not be fully compliant with the current ISO C++ standard, that is, it is probably too old. OpenLB makes use of advanced, template-based techniques, and some older compilers fail to interpret them properly. The oldest version of gcc that was found to compile the OpenLB source code without problems is gcc 3.4.1. If your compiler is older than that, we strongly encourage you to upgrade to a newer version. Consider this an important investment in the quality of your programming environment, given that an increasing number of software projects nowadays require the use of a standard-compliant compiler.

When I use OpenLB, my source code takes ages to get compiled. Why’s that?

The OpenLB code is fully generic. You can for example switch from a D3Q19 lattice to a D3Q27 one by changing a single word in your code. For this to be possible, the OpenLB library is template-based, and is completly recompiled every time you recompile your code. If you can do without full genericity and are happy with, say, the D3Q19 lattice, you might chose to precompile your code. For this, comment out the line #include “olb2D.hh” respectively #include “olb3D.hh” in your code, and use the special, precompiling version of the Makefile. More details about this procedure can be found in the user guide.