Difference between revisions of "IDEs"

From Eigen
Jump to: navigation, search
(Created page with "Some workarounds and hacks might be useful for IDEs in order to use Eigen in an optimal way. This page is meant to collect them, to help newcomers. =Eclipse= Apart from "Orga...")
 
Line 2: Line 2:
  
 
=Eclipse=
 
=Eclipse=
 +
==Paths==
 
Apart from "Organize includes" (see the section below), everything works out of the box. For example, if Eigen is installed in ''/usr/include/eigen3'' and this path is added to the '''Project Properties > C/C++ General > Paths & Symbols > Includes''', you only need to add includes of the form <source lang="cpp">#include <Eigen/Dense></source> as used in Eigen's documentation.
 
Apart from "Organize includes" (see the section below), everything works out of the box. For example, if Eigen is installed in ''/usr/include/eigen3'' and this path is added to the '''Project Properties > C/C++ General > Paths & Symbols > Includes''', you only need to add includes of the form <source lang="cpp">#include <Eigen/Dense></source> as used in Eigen's documentation.
  

Revision as of 18:35, 8 February 2016

Some workarounds and hacks might be useful for IDEs in order to use Eigen in an optimal way. This page is meant to collect them, to help newcomers.

Eclipse

Paths

Apart from "Organize includes" (see the section below), everything works out of the box. For example, if Eigen is installed in /usr/include/eigen3 and this path is added to the Project Properties > C/C++ General > Paths & Symbols > Includes, you only need to add includes of the form
#include <Eigen/Dense>
as used in Eigen's documentation.

Organizing includes

This handy feature of Eclipse does not work out of the box for Eigen. Eclipse tries to include by default the .h files of the library but those are not sufficient to build the project correctly. As done by default by Eclipse for the stdlib, substitution rules need to be used in order for Eclipse to automatically handle includes correctly.

Go to Preferences > C++ > Coding Style > Organize Includes > Substitution headers. There you can add a new rule, and import the following xml file:

ADD FILE.

This file is useful in the case where the path of Eigen (for example /usr/include/eigen3) is defined as above. If not, it needs to be adapted.

In case the Eigen architecture changes and the previous file is not up to date, you can use the following Python3 script (and adapt it with your own Eigen's path if different) to generate a new one:

ADD FILE.

Other IDEs