Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build projects in parallel using Eclipse/CDT (not parallel compiling!)

I have several projects which all rely on a basic library. Now when I change a header file in this basic library I have to rebuild all dependent projects. Currently Eclipse/CDT builds one project after another. How can I build all these projects in parallel?

Please note that I already use the -j (parallel compiling) option for each project. But this is not enough because:

  1. there are really a lot of CPU's available (for most projects more than source files) and
  2. due to parallel compiling the linking takes much longer than compiling and (to my knowledge) can not use multi-threading.
like image 794
Danvil Avatar asked Feb 28 '11 09:02

Danvil


2 Answers

I don't think the current version of Eclipse CDT can build projects in parallel, but you can achieve the same effect by having an Eclipse CDT Makefile project which builds multiple binaries (libraries and executables).

A simple way to generate such project is by using CMake with Eclipse CDT4 - Unix Makefiles generator. Then if you specify /usr/bin/make -j<n> as a build command, where n is the number of parallel jobs in Project Properties, it will build your targets (not only source files) in parallel.

like image 177
vitaut Avatar answered Oct 26 '22 03:10

vitaut


Project Properties > C++ Build > Behaviour > Enable Parallel Build

like image 37
Michael Fayad Avatar answered Oct 26 '22 04:10

Michael Fayad