IfcPlusPlus

Description
IFC++ or IfcPlusPlus is an open source (MIT license) library from the IfcQuery project for reading, writing, and viewing IFC files.

While the IFC++ library can be used for general purpose, a very useful component that it includes is an IFC reader and viewer based on Qt 5 and OpenSceneGraph (OSG). This viewer is very fast, and can be used to compare the performance of other viewers of IFC data, like Blender and FreeCAD, which use the IfcOpenShell library.

Installing
The IFC++ distribution is provided as source code, so to use the library and the viewer, the code must be compiled before it can be used.

IFC++ is developed mostly on a Windows platform, so it includes solution files to compile the  dynamic library using Visual Studio. A static library can also be produced for Linux using CMake.

Compiling in Windows
Follow the instructions in the official ifcplusplus repository.

Compiling in Linux
The general instructions are as follows:
 * 1) Get the source code of IFC++ from its main repository.
 * 2) Gather all dependencies for compiling, including a C++ compiler, CMake, and Make, and the development files for Boost, Qt 5, as well as the OpenSceneGraph (OSG) library for visualization.
 * 3) Run  to generate a, then start the compilation by running.
 * 4) Install the  shared module to the appropriate library path so that it is found by the IFC++ viewer.

Prerequisites
In a Debian/Ubuntu based distribution, getting the required development files is usually simple.

Get the source code of the project and place it in a custom directory to which you have full write access.

OpenSceneGraph
OpenSceneGraph (OSG) is a collection of C++ libraries that uses OpenGL for 3D visualization; it is used in games, virtual reality, scientific visualization, and modelling. Install the development files of OpenSceneGraph.

If the files are too old in your distribution, you may also compile the libraries yourself. The procedure is outlined in the main repository, openscenegraph/OpenSceneGraph. Compiling is straight forward, although you may need various dependencies like Qt 5, Freetype, Inventor, Jasper, OpenEXR, COLLADA, ZLIB, GDAL, FFmpeg, Gstremer, DirectShow, SDL, Poppler, and Lua.

CMake configuration
It is recommended to perform the configuration and compilation in a specific build directory separate from the source directory.

Actual compilation
If there were no error messages during configuration with CMake, a should have been created in the build directory, so you can proceed to compile the libraries by running.

is the number of processors that you assign to the compilation process; choose at least one fewer than the total number of CPU cores that you have.

Testing the compilation in the build directory
If the build was successful you should have a subdirectory with the newly compiled libraries.

The executable is a simple IFC viewer that uses the compiled library.

Installation of the compiled libraries
If the compilation doesn't report any errors, you may run to copy the headers, compiled libraries, and binaries to their corresponding installation directories.

By default, the is, so all compiled files will be placed under this directory, which normally requires elevated privileges.

Removing the compiled libraries
To remove the installed libraries, just remove the corresponding files that were installed.

Links

 * IFC++ project page
 * ifcquery/ifcplusplus repository
 * IfcQuery / IfcPlusPlus selber kompilieren, for FreeCAD
 * IFC Viewer ifcplusplus (older thread)