Compiler sous Mac
Cette page explique comment compiler le dernier code source de FreeCAD sur MAC OS X.
Prérequis
Tout d'abord, vous allez avoir besoin d'installer les logiciels suivants.
Xcode Development Tools
À moins que vous ne souhaitiez utiliser l'IDE Xcode pour le développement de FreeCAD, vous n'avez besoin d'installer que les outils de Ligne de Commande (Command Line Tools). Pour faire ça sur 10.9 ou plus récent, ouvrez un Terminal, lancer la commande suivante puis cliquer sur Installer dans la boîte de dialogue qui s'affiche.
xcode-select --install
Pour les autres version de OS X, vous pouvez avoir le paquet des sur la page de téléchargement des développeurs Apple (connectez vous avec le même ID Apple que vous utilisez sur d'autre services d'Apple). Techniquement vous avez besoin de télécharger Development Tools 3.2 pour OS X 10.6, et Commande Line Tools 4.8 pour OS X 10.8.
CMake
Installez la dernière version de CMake depuis http://www.cmake.org/download. Bien que Homebrew installe aussi CMake, il n'installe que l’exécutable de la ligne de commande.
Homebrew
Pour installer Homebrew, entrer ce qui suit dans un terminal :
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Récupérer les sources
Dans ce guide, les dossiers source et build sont créés dans /Users/username/FreeCAD, mais vous pouvez bien sur utiliser le dossier que vous voulez.
mkdir ~/FreeCAD cd ~/FreeCAD
Pour télécharger le code source de FreeCAD, lancer :
git clone git://git.code.sf.net/p/free-cad/code FreeCAD-git
Une alternative est d'utiliser le mirroir Github : https://github.com/FreeCAD/FreeCAD_sf_master.git
Installer les dépendances
Toutes les librairies nécessaires peuvent être installer avec Homebrew.
brew tap homebrew/science brew tap sanelson/freecad brew install boost eigen freetype oce python qt pyside pyside-tools xerces-c brew install --without-framework --without-soqt sanelson/freecad/coin brew install --HEAD pivy
Compiler FreeCAD
En premier, créez un nouveau dossier pour le build :
mkdir ~/FreeCAD/build
Now you will need to run CMake to generate the build files. Open the CMake app, and fill in the source and build folder fields. In this case, it would be /Users/username/FreeCAD/FreeCAD-git for the source, and /Users/username/FreeCAD/build for the build folder.
Next, click the Configure button. This will display a dialog asking you to specify what generator to use. Leave it at the default Unix Makefiles. Configuring will fail the first time because there are some options that need to be changed. Note: You will need to check the Advanced checkbox to get all of the options.
Option name | Value | Notes |
---|---|---|
BUILD_ROBOT | OFF (unchecked) | As of 12/19/2014, the robot module fails to build using newer versions of clang (OS X 10.9 and later) |
CMAKE_BUILD_TYPE | Release | |
FREECAD_USE_EXTERNAL_PIVY | ON (checked) | |
FREETYPE_INCLUDE_DIR_freetype2 | /usr/local/include/freetype2 | You will only need to set this if you are using a CMake version older than 3.1.0 |
OCE_DIR | /usr/local/Cellar/oce/0.16.1/OCE.framework/Versions/0.16/Resources | |
PYSIDERCC4BINARY | /usr/local/bin/pyside-rcc | |
PYSIDEUIC4BINARY | /usr/local/bin/pyside-uic | |
PYTHON_EXECUTABLE | /usr/local/bin/python | |
PYTHON_INCLUDE_DIR | /usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 | |
PYTHON_LIBRARY | /usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib |
Note: The above paths for OCE and Python are for versions 0.16.1 and 2.7.9, respectively -- change as needed.
Now click Configure again and then Generate.
Finally, run make to compile FreeCAD.
cd ~/FreeCAD/build make –j3
The -j option specifies how many make processes to run at once. One plus the number of CPU cores is usually a good number to use. However, if compiling fails for some reason, it is useful to rerun make without the -j option, so that you can see exactly where the error occurred.
If make finishes without any errors, you can now launch FreeCAD, either from Terminal with ./bin/FreeCAD, or by double clicking the executable in Finder.
Creating an application bundle
TODO
Updating
FreeCAD development happens fast; everyday or so there are bug fixes or new features. To get these changes, run:
cd ~/FreeCAD/FreeCAD-git git pull
And then repeat the compile step above.
Troubleshooting
TODO