Compile on Linux/it

Panoramica
Nelle distribuzioni Linux recenti FreeCAD si compila facilmente, dato che di solito tutte le dipendenze sono fornite dal gestore di pacchetti. Fondamentalmente si tratta di eseguire 3 passaggi:
 * 1) Ottenere il codice sorgente di FreeCAD
 * 2) Ottenere le dipendenze (i pacchetti da cui dipende FreeCAD)
 * 3) Configurare con  e compilare con

Qui, di seguito, troverete le spiegazioni dettagliate di tutto il processo, delle particolarità che si possono incontrare e alcuni script di compilazione automatica. Se trovate qualcosa di sbagliato o di non aggiornato nel testo successivo (le distribuzioni Linux cambiano spesso), o se utilizzate una distribuzione che non è elencata, discutete il problema nel forum, e aiutateci a correggerlo.



Git
Il modo migliore per ottenere il codice è clonare il repository Git. Per questo è necessario il programma che può essere facilmente installato nella maggior parte delle distribuzioni Linux e può anche essere ottenuto dal sito web ufficiale.

Git può essere installato tramite il seguente comando:

Il seguente comando crea una copia locale della versione più recente del codice sorgente di FreeCAD in una nuova directory chiamata.

Per ulteriori informazioni sull'uso di Git e sul contributo del codice al progetto, vedere Gestione del codice sorgente.

Codice sorgente dall'archivio
In alternativa si può scaricare il sorgente dall' archivio, come file o, e scompattarlo nella directory desiderata.

Ottenere le dipendenze
Per compilare FreeCAD devi installare le dipendenze necessarie menzionate in Librerie di terze parti; i pacchetti che contengono queste dipendenze sono elencati in seguito per diverse distribuzioni Linux. Si noti che i nomi e la disponibilità delle librerie dipendono dalla propria particolare distribuzione; se la distribuzione è vecchia, alcuni pacchetti potrebbero non essere disponibili o avere un nome diverso. In questo caso, consultare la sezione distribuzioni precedenti e non convenzionali sottostante.

Dopo aver installato tutte le dipendenze, procedere con la compilazione di FreeCAD.

Notare che il codice sorgente di FreeCAD ha una dimensione di circa 500 MB; potrebbe essere tre volte più grande se clonate il repository Git con la sua intera cronologia delle modifiche. Ottenere tutte le dipendenze potrebbe richiedere il download di almeno 500 MB di nuovi file; quando questi file vengono decompressi potrebbero richiedere almeno 1500 MB di spazio. Attenzione anche che il processo di compilazione può generare fino a 1500 MB di file aggiuntivi mentre il sistema copia e modifica l'intero codice sorgente. Pertanto, assicurarsi di disporre di spazio libero sufficiente sul disco rigido, almeno 4 GB, durante il tentativo di compilazione.

Debian e Ubuntu
Sui sistemi basati su Debian (Debian, Ubuntu, Mint, ecc.) è abbastanza facile installare tutte le dipendenze necessarie. La maggior parte delle librerie sono disponibili tramite o il gestore di pacchetti Synaptic.

Se hai già installato FreeCAD dai repository ufficiali, puoi installare le sue dipendenze di compilazione con questa singola riga di codice in un terminale:

Tuttavia, se la versione di FreeCAD nei repository è vecchia, le dipendenze potrebbero essere quelle sbagliate per compilare una versione recente di FreeCAD. Pertanto, verificare di aver installato i seguenti pacchetti.

Questi pacchetti sono essenziali per il successo di qualsiasi tipo di compilazione:
 * , installa i compilatori C e C++, le librerie di sviluppo C e il programma.
 * , strumento essenziale per configurare il sorgente di FreeCAD. Potresti anche voler installare e  per un'opzione grafica.
 * , strumenti essenziali per produrre librerie condivise.
 * , l'utilità standard di reporting di base è normalmente già installata in un sistema Debian e consente di distinguere programmaticamente tra un'installazione Debian pura o una variante, come Ubuntu o Linux Mint. Non rimuovere questo pacchetto, poiché molti altri pacchetti di sistema potrebbero dipendere da esso.

La compilazione di FreeCAD utilizza il linguaggio Python ed è utilizzato anche in fase di esecuzione come linguaggio di scripting. Se stai usando una distribuzione basata su Debian, l'interprete Python è normalmente già installato.
 * , lo strumento che crea interfacce tra codice C++ e Python.
 * , lo strumento che crea interfacce tra codice C++ e Python.

Verifica di aver installato Python 3. Python 2 è diventato obsoleto nel 2019, quindi il nuovo sviluppo in FreeCAD non viene testato con questa versione del linguaggio.

Le librerie Boost devono essere installate:



Le librerie di Coin devono essere installate:
 * , per Debian Jessie, Stretch, Ubuntu da 16.04 a 18.10, oppure
 * , per Debian Buster, Ubuntu 19.04 e successivi, così come per Ubuntu 18.04/18.10 con il freecad-stable/freecad-daily PPA aggiunto alle sorgenti software.

Diverse librerie, che si occupano di matematica, superfici triangolate, ordinamento, mesh, visione artificiale, proiezioni cartografiche, visualizzazione 3D, sistema X11 Window, parsing XML e lettura di file Zip:


 * or
 * or
 * or
 * or
 * or
 * or
 * or
 * or

Python 2 e Qt4
Non è raccomandato per le installazioni più recenti in quanto sia Python 2 che Qt4 sono obsoleti. A partire dalla versione 0.20, FreeCAD non li supporta più.

Per compilare FreeCAD per Debian Jessie, Stretch, Ubuntu 16.04, utilizzando Python 2 e Qt4, installare le seguenti dipendenze.



Python 3 e Qt5
Per compilare FreeCAD per Debian Buster, Ubuntu 19.04 e versioni successive, nonché Ubuntu 18.04/18.10 con il freecad-stable/freecad-daily PPA aggiunto alle sorgenti software, installare le seguenti dipendenze.


 * (if compiling 0.20 on a machine that still has Qt4)
 * (if compiling 0.20 on a machine that still has Qt4)
 * (if compiling 0.20 on a machine that still has Qt4)

Kernel OpenCascade
Il kernel OpenCascade è la libreria grafica di base per creare forme 3D. Esiste in una versione ufficiale OCCT e in una versione comunitaria OCE. La versione community non è più consigliata perché obsoleta.

Per Debian Buster e Ubuntu 18.10 e successivi, così come Ubuntu 18.04 con freecad-stable/freecad-daily PPA aggiunto alle tue sorgenti software, installa i pacchetti ufficiali.



Per Debian Jessie, Stretch, Ubuntu 16.04 e versioni successive, installa i pacchetti della community edition.



È possibile installare le librerie singolarmente o utilizzando l'espansione dell'asterisco. Cambia con  se si vuole installare le librerie della comunità.

Pacchetti opzionali
Opzionalmente si possono anche installare i seguenti pacchetti extra:
 * , per fare in modo che Coin supporti formati di file immagine aggiuntivi.
 * e (o  per i sistemi precedenti), se si vuole generare la documentazione del codice sorgente.
 * , per il supporto di dispositivi di input 3D, come "Space Navigator" o "Space Pilot" di 3Dconnexion.
 * , se si intende registrare i file installati nel gestore pacchetti del tuo sistema, in modo da poterlo disinstallare in seguito.
 * , l'Addon Manager per visualizzare i file README.md in formato Markdown in modo nativo.
 * , affinché Addon Manager utilizzi git per recuperare e aggiornare workbench e macro.

Comando Singolo per Python 3 e Qt5
Richiede Pyside2 disponibile in Debian buster e nel freecad-stable/freecad-daily PPA|freecad-stable/freecad-daily PPA.

NOTA: su alcune versioni di Ubuntu e alcune versioni di Qt, si riceverà un errore che python3-pyside2uic non può essere trovato - su quei sistemi puoi tranquillamente ometterlo. Su Ubuntu 20.04 si dovrà aggiungere. Maggiori informazioni possono essere trovate in questa discussione del forum.

Comando Singolo per Python 2 e Qt4
Non raccomandato per le installazioni più recenti in quanto sia Python 2 che Qt4 sono obsoleti.

Gli utenti di Ubuntu 16.04 possono consultare anche la discussione sulla compilazione nel forum: Compilazione su Linux (Kubuntu): CMake non riesce a trovare VTK.

Raspberry Pi
Segui gli stessi passaggi di Debian e Ubuntu.

Sono stati segnalati problemi durante il tentativo di compilazione in Raspberry PI OS a 32 bit con Python 3 e Qt5, ma la combinazione Python 3 e Qt4 sembra funzionare per le versioni precedenti di FreeCAD (con problemi minori).

Per le versioni più recenti di FreeCAD (>= 0.20) la compilazione con Py3/Qt5 va a buon fine se il sistema operativo installato è Raspberry Pi OS 64-bit o Ubuntu 20.04.

A causa di diversi problemi con Qt, in Ubuntu 20.04 non verranno trovati i normali strumenti PySide.

In questo caso, possiamo installare i pacchetti da PyQt e creare collegamenti simbolici agli strumenti necessari.

Ora la compilazione può procedere.

L'opzione di  non dovrebbe essere maggiore di 3 perché il Raspberry Pi ha una memoria limitata. Ci vorranno diverse ore per compilare, quindi è meglio farlo durante la notte.

Per ulteriori informazioni, FreeCAD e Raspberry Pi 4.

Fedora
C'è un bug in cmake distribuito da Fedora 34/35 che fa sì che cmake non riesca a trovare le librerie opencascade. Questo può essere facilmente risolto apportando una piccola modifica al file cmake di livello superiore di opencascade installato su Fedora. Dettagli qui: https://bugzilla.redhat.com/show_bug.cgi?id=2083568.

Nella parte superiore del file, modificare la seguente riga per utilizzare. Questa operazione corregge un bug introdotto dall'uso di un collegamento simbolico da a  di Fedora, che causa l'errore di cmake.

Questo file è solitamente installato in.

cambiare in:

Questa banale modifica deve essere apportata all'interno della directory di build una volta che cmake è stato eseguito e ha avuto esito negativo. La riesecuzione di cmake rileverà quindi correttamente le librerie OCCT nel modo normale.

Sono necessari i seguenti pacchetti:


 * gcc-c++ (or possibly another C++ compiler?)
 * cmake
 * doxygen
 * swig
 * gettext
 * dos2unix
 * desktop-file-utils
 * libXmu-devel
 * freeimage-devel
 * mesa-libGLU-devel
 * opencascade-devel
 * openmpi-devel
 * python3
 * python3-devel
 * python3-pyside2
 * python3-pyside2-devel
 * pyside2-tools
 * boost-devel
 * tbb-devel
 * eigen3-devel
 * qt-devel
 * qt5-qtwebengine-devel
 * qt5-qtxmlpatterns
 * qt5-qtxmlpatterns-devel
 * qt5-qtsvg-devel
 * qt5-qttools-static
 * ode-devel
 * xerces-c
 * xerces-c-devel
 * opencv-devel
 * smesh-devel
 * Coin3
 * Coin3-devel

(Aprile 2021, sono disponibili Coin4 e Coin4-devel) (se coin2 è l'ultimo disponibile per la tua versione di Fedora, usare i packages di http://www.zultron.com/rpm-repo/)


 * SoQt-devel
 * freetype
 * freetype-devel
 * vtk
 * vtk-devel
 * med
 * med-devel

E facoltativamente:


 * libspnav-devel (for 3Dconnexion devices support like the Space Navigator or Space Pilot)
 * python3-pivy ( https://bugzilla.redhat.com/show_bug.cgi?id=458975 Pivy is not mandatory but needed for the Draft Workbench)
 * python3-markdown (for the Addon Manager to display native markdown)
 * python3-GitPython (for the Addon Manager to use git to checkout and update workbenches and macros)

To install all dependencies at once (tested on fedora 36):

Gentoo
Easiest way to check which packages are needed to compile FreeCAD is to check via portage:

emerge -pv freecad

This should give a nice list of extra packages that you need installed on your system.

If FreeCAD is not available on portage, it is available on the waebbl overlay. The issue tracker on the waebbl overlay Github may help guide through some issues you may come across. The overlay provides freecad-9999, which you can choose to compile, or simply use to get the dependencies.

layman -a waebbl

Tumbleweed
The following commands will install the packages required for building FreeCAD with Qt5 and Python 3.

The following command will install Qt Creator and the GNU Project Debugger.

If any packages are missing, then you can check the Tumbleweed "FreeCAD.spec" file on the Open Build Service.

Also, check to see if there are any patches you need to apply (such as 0001-find-openmpi2-include-files.patch).

Leap
If there is a difference between the available packages on Tumbleweed and Leap, then you can read the Leap "FreeCAD.spec" file on the Open Build Service to determine the required packages.

See piano_jonas unofficial "Compile On openSUSE" guide.

Arch Linux
You will need the following libraries from the official repositories:


 * boost
 * curl
 * desktop-file-utils
 * glew
 * hicolor-icon-theme
 * jsoncpp
 * libspnav
 * opencascade
 * shiboken2
 * xerces-c
 * pyside2
 * python-matplotlib
 * python-netcdf4
 * python-packaging
 * qt5-svg
 * qt5-webengine
 * cmake
 * eigen
 * git
 * gcc-fortran
 * pyside2-tools
 * swig
 * qt5-tools
 * shared-mime-info
 * coin
 * python-pivy
 * med

Distribuzioni precedenti e non convenzionali
On other distributions, we have very few feedback from users, so it might be harder to find the required packages.

Try first locating the required libraries mentioned in third party libraries in your package manager. Beware that some of them might have a slightly different package name; search for, but also , , , and similar. If that is not possible try compiling those libraries yourself.

FreeCAD requires the GNU g++ compiler version equal or above 3.0.0, as FreeCAD is mostly written in C++. During the compilation some Python scripts are executed, so the Python interpreter has to work properly. To avoid any linker problems it is also a good idea to have the library paths in the variable or in the  file. This is already done in modern Linux distributions, but may need to be set in older ones.

Pivy
Pivy (Python wrappers to Coin3d) is not needed to build FreeCAD or to start it, but it is needed as a runtime dependency by the Draft Workbench. If you are not going to use this workbench, you won't need Pivy. However, do notice that the Draft Workbench is used internally by other workbenches, like Arch and BIM, so Pivy needs to be installed to use these workbenches as well.

By November 2015 the obsolete version of Pivy included with the FreeCAD source code will no longer compile on many systems. This isn't a big problem as normally you should get Pivy from your distribution's package manager; if you cannot find Pivy, you may have to compile it yourself, see Pivy compilation instructions.

Debug symbols
In order to troubleshoot crashes in FreeCAD, it is useful to have the debug symbols of important dependency libraries such as Qt. For this, try installing the dependency packages that end with, , or similar, depending on your Linux distribution.

For Ubuntu, you may have to enable special repositories to be able to see and install these debug packages with the package manager. See Debug Symbol Packages for more information.

Compilare FreeCAD
FreeCAD uses CMake as its main build system, as it's available on all major operating systems. Compiling with CMake is usually very simple and happens in two steps.


 * 1) CMake checks that every needed program and library is present on your system, and generates a  that is configured for the second step. FreeCAD has several configuration options to choose from, but it comes with sensible defaults. Some alternatives are detailed below.
 * 2) The compilation itself, which is done with the program, which generates the FreeCAD executables.

Since FreeCAD is a large application, compiling the entire source code can take anywhere from 10 minutes to one hour, depending on your CPU and the number of CPU cores used for compilation.

You can build the code either in or out of the source directory. Out-of-source building is generally the best option.

Out-of-source build
Building in a separate folder is more convenient than building in the same directory where the source code is located as every time you update the source code CMake can intelligently determine which files have changed, and recompile only what is needed. This is very useful when testing different Git branches as you don't confuse the build system.

To build out-of-source, simply create a build directory,, distinct from your FreeCAD source folder, ; then from this build directory point to the right source folder. You can use or  instead of  in the instructions below as well. Once finishes configuring the environment, use  to start the actual compilation.

Note: if you are compiling the 0.19 release branch, you must explicitly specify that you are compiling with Qt5 and Python 3 -- replace the cMake command above with:

The option of  controls how many jobs (files) are compiled in parallel. The program prints the number of CPU cores in your system; by using it together with the  option you can choose to process as many files as you have cores, in order to speed up overall compilation of the program. In the example above, it will use all cores in your system except two; this will keep your computer responsive for other uses while compilation proceeds in the background. The FreeCAD executable will eventually appear in the directory. See also Compiling (speeding up) to improve compilation speed.

Resolving cmake issues
If you have done an out-of-source build before and get stuck on a dependency that is not recognized or can't seem to be resolved, try the following:


 * Delete the contents of the build directory before running cmake again. FreeCAD is a rapidly moving target, you may be tripping over cached cmake information that points at an older version than the new repository head can use. Clearing the cache may allow cmake to recover and recognize the version you actually need.


 * If cmake complains about missing a specific file, use a tool such as "apt-file search", or its equivalent in other package systems, to discover what package that file belongs to and install it. Bear in mind that you are likely to need the -dev version of the package that carries header or config files files required for FreeCAD to use the package.

Compiling against GNU libc 2.34 and later
GNU libc 2.34 introduces a change to the library that can cause builds on some Linux systems to fail with an error like:

To resolve this, a symbolic link must be manually created from the (now empty) system-installed libdl.so.* to the location your compiler says it is looking for the file. For example (if the actual installed copy of libdl.so on your system is /usr/lib/x86_64-linux-gnu/libdl.so.2):

Adapt the command for the structure of your system by searching for libdl.so* and linking it to the appropriate location.

In-source building
In-source builds are fine if you want to compile a version of FreeCAD quickly, and don't intend to update the source code often. In this case, you can remove the compiled program and the source just by deleting a single folder.

Change to the source directory, and point to the present directory (denoted by a single point):

The FreeCAD executable will then reside in the directory.

How to repair your source code directory
If you accidentally performed a compilation inside the source code directory, or added strange files, and would like to restore the contents to only the original source code, you can perform the following steps.

The first line clears the file. This ensures that the following clean and reset commands will affect everything in the directory and will not ignore items matching the expressions in. The second line deletes all files and directories that are not tracked by the git repository; then the last command will reset any changes to tracked files, including the first command which cleared the file.

If you do not clear the source directory, subsequent runs of may not capture new options to the system if the code changes.

Configuration
By passing different options to, you can change how FreeCAD is compiled. The syntax is as follows.

Where is the directory that contains the source code. The may be omitted in most cases. The space after the option may also be omitted.

For example, to avoid building the FEM Workbench:

All possible variables are listed in the file, located in the  directory. In this file, search for the word to get to the variables that can be set, and see their default values.


 * 1) =================   All the options for the build process    =================
 * 1) =================   All the options for the build process    =================

option(BUILD_FORCE_DIRECTORY "The build directory must be different to the source directory." OFF) option(BUILD_GUI "Build FreeCAD Gui. Otherwise you have only the command line and the Python import module." ON) option(FREECAD_USE_EXTERNAL_ZIPIOS "Use system installed zipios++ instead of the bundled." OFF) option(FREECAD_USE_EXTERNAL_SMESH "Use system installed smesh instead of the bundled." OFF) ...

Alternatively, use the command to list the current configuration, and thus all variables that can be changed. You may also install and use to launch a graphical interface showing all the variables that can be modified. In the next sections we list some of the more relevant options that you may want to use.

For a Debug build
Create a build to troubleshoot crashes in FreeCAD. Beware that with this build the Sketcher becomes very slow with complex sketches.

For a Release build
Create a build to test code that doesn't crash. A build will run much faster than a  build.

Building against Python 3 and Qt5
Support for Python 2 and Qt4 has been removed in FreeCAD 0.20 and it is not necessary to explicitly enable Qt5 and Python 3 if compiling the latest versions. Qt6 support is currently in development and does not work yet. Unless you plan on assisting with the Qt6 migration effort, FREECAD_QT_VERSION should be left at "Auto" (the default) or explicitly set to "5".

For 0.20 and 0.21_dev:

Note that when switching between 0.20 and the 0.21_dev builds, it may be necessary to delete CMakeCache.txt prior to running cmake.

Building for a specific Python version
If the default executable in your system is a symbolic link to Python 2,  will try to configure FreeCAD for this version. You must then choose another version of Python by giving the path to a specific executable:

If that doesn't work, you may have to define additional variables pointing to the desired Python libraries and include directories:

It is possible to have several independent versions of Python in the same system, so the locations and version numbers of your Python files will depend on your particular Linux distribution. Use to display the version of Python that you are using currently; only the first two numbers are necessary; for example, if the result is, you need to specify the directories that relate to the 3.6 version. If you don't know the right directories, try searching for them with the command.

You may use in a terminal to determine the  directory, or  for Debian systems.

Some components of FreeCAD, such as PySide, try to autodetect the most recent Python version installed on your system, which might fail if it is different from what you entered above. Adding the following cMake option might solve the issue:

Building with Qt Creator against Python 3 and Qt5
1. Launch Qt Creator.

2. Click on.

3. Navigate to the directory where the source code is,, and choose the topmost file.

4. By selecting the file, it will automatically run on it, but it may fail if the appropriate options aren't correctly set.

5. Go to. Set the appropriate build directory,.

6. Set the appropriate variables in the Key-Value dialog, of types and.

7. If the variables do not load the project correctly, you may have to go to. Then press, and add the appropriate configuration as described above. You may have to add more variables about the Python paths, if the system Python is not found.

7.1. Press, then.

7.2. Make sure the rest of the options are correctly set, for example, should be a present version installed in the system, like.

Press, then to close the configuration.

The program should run automatically again, and it should fill the entire Key-Value dialog with all the variables that can be configured.

8. Go to and choose  to compile the graphical version of FreeCAD, or  to compile only the command line version.

9. Finally, go to the menu. If this is a new compilation, it should take several minutes, inclusive hours, depending on the number of processors that you have available.

Qt designer plugin
If you want to develop Qt code for FreeCAD, you'll need the Qt Designer plugin that provides all custom widgets of FreeCAD.

Go into an auxiliary directory of the source code, the run with the indicated project file to create a ; then run  to compile the plugin.

If you are compiling for Qt5, make sure the binary is the one for this version, so that the resulting  contains the necessary information for Qt5.

where is the directory that stores Qt binary libraries, for example,.

The library created is, which needs to be copied to.

External or internal Pivy
Previously, a version of Pivy was included in the source code of FreeCAD (internal). If you wanted to use your system's copy of Pivy (external), you needed to use.

Using external Pivy became the default during development of FreeCAD 0.16, therefore this option does not need to be set manually anymore.

Doxygen documentation
If you have Doxygen installed you can build the source code documentation. See source documentation for instructions.

Additional documentation
The source code of FreeCAD is very extensive, and with CMake it's possible to configure many options. Learning to use CMake fully may be useful to choose the right options for your particular needs.
 * CMake Reference Documentation by Kitware.
 * How to Build a CMake-Based Project (blog) by Preshing on programming.
 * Learn CMake's Scripting Language in 15 Minutes (blog) by Preshing on programming.

Making a debian package
If you plan to build a Debian package out of the sources you need to install certain packages first:

Go to the FreeCAD directory and call

Once the package is built, you can use to check if the package contains errors

*.deb package with checkinstall
The Debian script allows to create a *.deb package that can be installed and removed with the standard  commands. It may need to be installed first (on Ubuntu use ). It's interactive and asks for the required information providing helpful defaults. During the process the package is installed and a *.deb file and a backup archive are created.

It's a good idea to define a name and a short description for the package. The name must be entered to uninstall it again and the desription will be listed by. The default name "build" is not very informative.

Example:

The result is a *.deb file in the freecad-build folder. will install the build by default. This is how you can install or uninstall it:

grep freecad freecad-test1_20220814-1_amd64.deb sudo dpkg -i freecad-test1_20220814-1_amd64.deb  # install dkpg -l

Aggiornare il codice sorgente
The CMake system allows you to intelligently update the source code, and only recompile what has changed, making subsequent compilations faster.

Move to the location where the FreeCAD source code was first downloaded, and pull the new code:

Then move into the build directory where the code was compiled initially, and run specifying the present directory (denoted by a dot); then trigger the re-compilation with.

Uninstalling the source code
In case the compiled source code was installed with (for Debian) the files were copied to the  folder into several subfolders. For uninstallation the file can be used. It has been created into the build folder during compilation and contains all installed files. As long as this file exists, the installation can be uninstalled.

For 64 bit systems
When building FreeCAD for 64-bit there is a known issue with the OpenCASCADE (OCCT) 64-bit package. To get FreeCAD running properly you might need to run the script and set additional :

For Debian based systems this option is not needed when using the pre-built OpenCASCADE packages because these ones set the proper internally.

Script di compilazione automatica
Ecco tutto quello che vi serve per una compilazione completa di FreeCAD. Si tratta di uno script di approccio e funziona su una distro di recente installazione. I comandi richiedono la password di root per l'installazione di pacchetti e nuovi repository online. Questi script dovrebbero funzionare su versioni a 32 e 64 bit. Essi sono scritti per diverse versioni, e dovrebbero essere eseguibili anche su versioni successive, con o senza grandi cambiamenti.

Here is all what you need for a complete build of FreeCAD. It's a one-script-approach and works on a freshly installed Linux distribution. The commands will ask for the root password for installation of packages and new online repositories. These scripts should run on 32 and 64 bit versions. They are written for different versions, but are also likely to run on a later version with or without major changes.

If you have such a script for your preferred distribution, please discuss it on the FreeCAD forum so we can incorporate it.

Ubuntu
These scripts provide a reliable way to install the correct set of dependencies required to build and run FreeCAD on Ubuntu. They make use of the Ubuntu personal package archives (PPA), and should work on any version of Ubuntu targeted by the PPA. The freecad-daily PPA targets recent versions of Ubuntu, while the freecad-stable PPA targets officially supported versions of Ubuntu.

This script installs the daily compiled snapshot of FreeCAD and its dependencies. It adds the daily repository, gets the dependencies to build this version, and installs the required packages. Afterwards it proceeds to pull the source code into a particular directory, creates a build directory and changes into it, configures the compilation environment with, and finally builds the entire program with. Save the script to a file, make it executable, and run it, but don't use ; superuser privileges will be asked only for selected commands.

If you wish, you can uninstall the pre-compiled version of FreeCAD while leaving the dependencies in place, however, leaving this package installed will allow the package manager to keep its dependencies up to date as well; this is mostly useful if you intend to follow the development of FreeCAD, and constantly update and compile the sources from the Git repository.

The previous script assumes that you want to compile the latest version of FreeCAD, so you are using the "daily" repository to get the dependencies. However, you can instead get the build dependencies of the "stable" version for your current Ubuntu release. If this is the case, replace the top part of the previous script with the following instructions. For Ubuntu 12.04, omit from the command.

Once you install the package from the  repository, it will supersede the FreeCAD executable that is available from the Universe Ubuntu repository. The executable will be named simply, and not.

OpenSUSE 12.2
No external Repositories are needed to compile FreeCAD. However, there is an imcompatability with python3-devel which needs to be removed. FreeCAD can be compiled from GIT

Since you are using git, next time you wish to compile you do not have to clone everything, just pull from git and compile once more

Fedora 27/28/29
Posted by user [PrzemoF] in the forum.

{ echo "~/$MAIN_DIR already exist. Quitting.."; exit; } cd $MAIN_DIR git clone https://github.com/FreeCAD/FreeCAD.git mkdir $BUILD_DIR

Arch using AUR
Arch User Repository (AUR) is a collection user made recipes to build packages which are not officially supported by distribution maintainers / community. They are usually safe. You can see who maintain the package and for how long he did. It is recommended to check construction files. Also non open source software are available in this area even if maintained by the official owning company.

Prerequisite : git

Steps :
 * 1) Open a terminal. Optionally create a directory eg. . Optionally change directory eg..
 * 2) Clone the AUR repository :
 * 3) Enter AUR repository folder :
 * 4) Compile using Arch makepkg : . The -s or --syncdeps flag will also install required dependencies.
 * 5) Install created package : or double click on the pkgname-pkgver.pkg.tar.xz inside your file browser.

To update FreeCAD to latest build just repeat from step 3. Update AUR repository when there is some breaking change in the recipe or new features using inside the folder.