5

I am building a C++ project using Eclipse on Windows OS, I am also using the Eigen Linear Algebra library. My problem is with the very slow compiling time of Eigen (about 50 sec).

I've tried these proposed solutions:

I really need a solution for this, it's very unpractical to wait 47 sec each time I build the project to test something.

Any idea is deeply appreciated, thanks.

2
  • Precompiled header support is compiler-specific. Which compiler & version are you using? And what exactly didn't work from the first link? Commented Apr 16, 2015 at 9:03
  • @Angew. I am using Cygwin C++ Compiler -g3. Regarding the first link, I did my best to follow it but it gave me no results, nothing changed, I might have done a mistake in the step where it says "Then go to the miscellaneous option select the release configuration and add ... ". I wasn't sure how to construct my path in that shape.
    – M.A.
    Commented Apr 16, 2015 at 9:26

1 Answer 1

2

Eigen is a template library, meaning that the classes are defined based on the template parameters. I don't think that you would be able to precompile without letting the compiler know exactly all the possible classes you would need in your entire code base.

Alternatively, you could write a wrapper for Eigen and declare all the types you want and use that library. HOWEVER, you are likely to lose a lot of Eigen's advantages (see here, here and others).

2
  • 1
    It is possible to use precompiled headers to speed up template compilation, at least with compiler which do two-phase name lookup properly. It may not speed up the instantiation,but it will still save on the parsing. And with template code, there's usually a lot of parsing involved. Commented Apr 16, 2015 at 9:38
  • @Angew Fair enough. However, the second point is still valid, albeit dangerous for performance due to the loss of expression templates. Commented Apr 16, 2015 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.