Howto Use OpenFOAM with Kdevelop4

From OpenFOAMWiki

Developing within KDevelop

1 KDevelop

KDevelop is a free, open source IDE (Integrated Development Environment) for MS Windows, Mac OS X, Linux, Solaris and FreeBSD. It is a feature-full, plugin extensible IDE for C/C++ and other programming languages. It is based on KDevPlatform, and the KDE and Qt libraries and is under development since 1998. -

2 Versions

Operating system: gentoo Linux

OpenFOAM version: OpenFOAM-1.5-dev

Kdevelop version: kdevelop 4.0.2

3 Installation

Install Kdevelop with your favorite package manager.

4 Import an existing project

Project -> Open / Import Project ...

Select the root directory of your project (for example: $WM_PROJECT_DIR/src/finiteVolume/) and leave the name empty. Click Next.

Import finiteVolume library

Type in a name of your project and select as Build System: Custom Makefile Project Manager. Click Finish.

Project Information

5 Custom include paths

If some header files cannot be found, as they are in different directories and the correct include path is missing, one can add "custom include paths" in order to have "Auto Completion" of your code or get Declarations and Definitions of classes. The custom include paths does NOT affect the compiler settings or the project in any way. The header files, which are not found are highlighted with a red under tilde. There are two possibilities to open the graphical dialog for customized include paths:

5.1 Add custom include paths

  1. Go with your cursor to the desired line. Then automatically a small window should pop-up. Either press Alt -> 1 or push the 1 with the left mouse button in order to open the graphical dialog for customized include paths.
    Custom Include Path Dialog Option 1
  2. Go to the Problems tab at the "Bottom Dock". If the "Bottom Dock" is not visible, one can activate it with Window -> Show Bottom Dock. Click with the right mouse button at the line with the missing header file, a small dialog button "Add Custom Include Path" appear. Click this dialog button to open the graphical dialog for customized include paths.
    Custom Include Path Dialog Option 2

5.2 Setup Custom Include Paths.

  • Storage directory:

The custom include-path will be stored in a special file called ".kdev_include_paths". The "Storage directory" specifies the absolute storage location of this file within a source directory of your project. The custom path will be used for all files below that directory.

  • Custom Include Paths:

Specify your paths here. It might be useful to specify the "lnInclude" paths from each libso, you are using.

Custom Include Path

6 Debugging

Kdevelop4 has also a graphical GDB Frontend.