Velocizzare la compilazione

From FreeCAD Documentation
Revision as of 19:32, 13 November 2019 by Renatorivo (talk | contribs)

FreeCAD è una grande applicazione che può richiedere da 10 minuti a un'ora per essere compilata completamente dal sorgente. Ciò dipende principalmente dalla CPU in uso e dal numero di core utilizzati nel processo di compilazione. Ecco alcuni suggerimenti per abbreviare tale processo e ridurre i tempi di costruzione.

CCache

Installare ccache per la costruzione cache

Disabilitare i Moduli

Usare cmake-curses-gui, cmake-qt-gui, o i flag di cmake per disabilitare i moduli su cui non si sta lavorando

For example, to avoid building the FEM and Mesh workbenches:

cmake -DBUILD_FEM=OFF -DBUILD_MESH=OFF ../freecad-source

Use cmake-gui, cmake-curses-gui, or cmake-qt-gui to display all the possible variables that can be edited in the configuration; using these interfaces you can easily switch on or off different workbenches.

make -j

Usare make -j # per specificare il numero di processi (thread) di compilazione simultanea. Il valore suggerito è quello corrispondente al numero di processori del proprio computer, ad es.

make -j $(nproc)

Run four compilation commands in parallel:

make -j4

Compile as many files in parallel as the number of CPU cores in your system. This is useful if you have many cores and want to use them all to compile the software.

make -j$(nproc)

Compile as many files in parallel as the number of CPU cores in your system, minus two. Use this so that your system is still responsive to do some other task; for example, two cores will allow you to use a browser, while the rest of the cores keep compiling the software on the background.

make -j$(nproc --ignore=2)

distcc

Distcc può essere utilizzato per la compilazione distribuita su una rete.