Compile on MacOS/fr: Difference between revisions
Renatorivo (talk | contribs) (→Pivy) |
(Updating to match new version of source page) |
||
Line 1: | Line 1: | ||
Since Mac OS X is BSD (UNIX) based, compiling FreeCAD on a Mac isn't much different from [[CompileOnUnix]], however there are a number of Mac-specific details critical to getting everything working properly. These instructions have been tested on Lion (10.7), but ''should work'' on Intel Macs running (Snow) Leopard as well. |
|||
=CompileOnMac/fr= |
|||
__TOC__ |
|||
Comme Mac OS X est basé sur la distribution''' BSD (UNIX)''', la compilation de FreeCAD sur '''Mac''' n'est pas très différente de [[CompileOnUnix/fr|CompileOnUnix]], mais il existe cependant un certain nombre de détails très importants, spécifiques au Mac, pour que tout fonctionne correctement. Ces instructions ont été testées sur '''Lion (10.7)''', mais ''devrait fonctionner'' sur les '''Macs Intel''' qui utilisent '''(Snow) Leopard'''. |
|||
== |
== Getting the source == |
||
Before you can compile FreeCAD, you need the source code. There are 3 ways to get it: |
|||
Avant de compiler FreeCAD, vous avez besoin du code source. Il y a trois moyens de l'obtenir : |
|||
=== Git === |
=== Git === |
||
The quickest and best way to get the code is to clone the read-only git repository (you need the [http://git-scm.com/ git] package installed): |
|||
La méthode la meilleure et la plus rapide d'obtenir le code est de « cloner » le dépôt Git en lecture seule (il vous faut le paquet [http://git-scm.com/ git] installé): |
|||
git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad freecad |
git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad freecad |
||
This will place a copy of the latest version of the FreeCAD source code in a new directory called "freecad". The first time you try connecting to the free-cad.git.sourceforge.net host, you will receive a message asking to authenticate the sourceforge SSH key, which is normally safe to accept (you can check their SSH keys on the sourceforge website if you are not sure) |
|||
=== Github === |
|||
Ceci place une copie de la plus récente version du code source de FreeCAD dans un nouveau répertoire nommé « freecad ». La première fois que vous vous connectez à l'hôte free-cad.git.sourceforge.net, vous obtiendrez un message vous demandant d'authentifier la clé SSH de Sourceforge. Celle-ci peut normalement être acceptée sans danger (vous pouvez vérifier les clés SSH de Sourceforge sur leur site Web si vous voulez vous en assurer) |
|||
There is an always up to date FreeCAD repository on Gihub: |
|||
=== Gihub === |
|||
Il y a également une copie synchronisée régulièrement du dépôt FreeCAD sur GitHub : |
|||
[https://github.com/FreeCAD/FreeCAD_sf_master github.com/FreeCAD/FreeCAD_sf_master] |
[https://github.com/FreeCAD/FreeCAD_sf_master github.com/FreeCAD/FreeCAD_sf_master] |
||
=== |
=== Source package === |
||
Alternatively you can download a source package, but they could be already quite old so it's always better to get the latest sources. Depending on your distribution, there are several ways to obtain a source package: |
|||
Official FreeCAD source packages (distribution-independent): https://sourceforge.net/projects/free-cad/files/FreeCAD%20Source/ |
|||
Vous pouvez également télécharger un paquet source, mais celui-ci pourrait être assez vieux ; il est donc préférable de télécharger les sources les plus récentes via git ou github. Dépendant de votre distribution, il y a plusieurs façons d'obtenir un paquet source : |
|||
Debian: http://packages.debian.org/source/sid/freecad |
|||
Ubuntu: http://packages.ubuntu.com/source/precise/freecad |
|||
Paquets source FreeCAD officiels (indépendants des distributions): https://sourceforge.net/projects/free-cad/files/FreeCAD%20Source/ |
|||
=== Install Dependencies === |
|||
Debian : http://packages.debian.org/source/sid/freecad |
|||
On Mac OS X 10.7, the following dependencies are NOT bundled with the operating and thus must be installed before building FreeCAD: |
|||
Ubuntu : http://packages.ubuntu.com/source/precise/freecad |
|||
=== Dépendances de l'installation === |
|||
Sur '''Mac OS X 10.7''', les dépendances suivantes ne sont pas fournies avec le système, et '''doivent''' donc être installées '''avant''' la compilation de FreeCAD : |
|||
*sip |
*sip |
||
*fortran |
*fortran |
||
Line 45: | Line 33: | ||
==== Option 1: Homebrew ==== |
==== Option 1: Homebrew ==== |
||
'''Note''': this section is still a work in progress! See the help forum post for the latest. |
|||
'''PS :''' cette section est toujours en cours d'élaboration ! Lisez le post sur le forum d'aide pour plus d'informations. |
|||
:https://forum.freecadweb.org/viewtopic.php?f=4&t=2064&p=15405 |
:https://forum.freecadweb.org/viewtopic.php?f=4&t=2064&p=15405 |
||
Download and install the package manager Homebrew: |
|||
Téléchargement et installation des gestionnaires de paquets '''Homebrew''' : |
|||
:http://mxcl.github.com/homebrew/ |
:http://mxcl.github.com/homebrew/ |
||
Then compile and install most of FreeCAD's dependencies: |
|||
Puis, compilez et installez la plupart des dépendances de FreeCAD : |
|||
brew install sip gfortran xerces-c boost eigen coin qt pyqt soqt ftgl |
brew install sip gfortran xerces-c boost eigen coin qt pyqt soqt ftgl |
||
Go on to [[CompileOnMac#Build OpenCASCADE]]. |
|||
Lisez le paragraphe [[CompileOnMac/fr#Compiler OpenCASCADE]]. |
|||
==== Option 2: MacPorts/Fink ==== |
==== Option 2: MacPorts/Fink ==== |
||
''' |
'''Note: this section is in need of updates.''' |
||
Installez''' MacPorts''', si vous ne l'avez pas déjà fait. '''MacPorts''' est un système qui vous permet de télécharger, compiler et installer de nombreuses applications open-source en une seule commande. Des applications similaires issues du monde '''Unix/Linux''' sont, '''[http://netbsd-france.org/docs/software/packages.html PKGSRC]''' et '''[http://fr.wikipedia.org/wiki/Advanced_Packaging_Tool APT]'''. Pour l'installer, il suffit de télécharger l'image disque à partir du site '''MacPorts''', et suivez les instructions : |
|||
Install MacPorts (if you don't already have it). MacPorts is a system that allows you to download, compile, and install many common open-source applications with a single command. Similar applications from the UNIX/Linux world are PKGSRC and APT. To install, just download the disk image from the MacPorts site and follow the directions: |
|||
:http://www.macports.org/install.php |
:http://www.macports.org/install.php |
||
Whether or not you just installed MacPorts, you'll probably want to make sure it's up to date. Run: |
|||
Que vous ayez ou non installé '''[http://www.macports.org/ MacPorts]''', vous voudrez probablement vérifier s'il est à jour.<br> |
|||
Exécutez : |
|||
sudo port selfupdate |
sudo port selfupdate |
||
Now that MacPorts is installed and up to date, you can start installing some of FreeCAD's required packages: |
|||
Maintenant que '''[http://www.macports.org/ MacPorts]''' est installé, et à jour, vous pouvez commencer l'installation de certains des paquets nécessaires à FreeCAD : |
|||
*xercesc |
*xercesc |
||
*boost |
*boost |
||
Line 83: | Line 59: | ||
*py-pyqt4 |
*py-pyqt4 |
||
*Coin |
*Coin |
||
The following command will compile/install the above libraries. If MacPorts produces errors, you may want to try installing them one at a time. |
|||
La commande suivante compile/installe les bibliothèques ci-dessus. Si '''MacPorts''' produit des erreurs, vous pouvez essayer d'installer ceci, '''un à la fois'''. |
|||
sudo port install xercesc boost ftgl f2c eigen3 py-sip py-pyqt4 Coin |
sudo port install xercesc boost ftgl f2c eigen3 py-sip py-pyqt4 Coin |
||
Note that for python packages like py-sip and py-pyqt4, there are multiple packages, one for each MacPorts version of Python. |
|||
Note that boost is a large package, and py-pyqt4 depends on qt4-mac, which is a large package. You may want to run port -v install so that you have more of an idea what's going on during these long builds. |
|||
Notez, que pour les paquets Python comme '''[http://www.riverbankcomputing.com/software/sip/download py-sip]''' et '''[http://guide.macports.org/ py-pyqt4]''', il ya plusieurs packages, une pour chaque version de '''Python MacPorts'''.<br> |
|||
Qt4 is also available for Mac as a binary installer from the Qt web site. I'm not sure how nicely this approach plays with FreeCAD compiling. |
|||
Notez que '''[http://www.boost.org/ boost]''' est un gros paquet, et '''[http://guide.macports.org/ py-pyqt4]''' dépend '''[http://www.qtcentre.org/wiki/index.php?title=Installing_Qt4_on_Mac_OS_X qt4-mac]''', qui est aussi un gros paquet. Vous pouvez exécuter '''run port -v''' de manière à avoir une idée de ce qui se passe au cours de ces longues compilations. |
|||
[http://qt.nokia.com/downloads/ Qt4] est également disponible pour Mac comme un installateur binaire à partir du site Web de [http://qt.nokia.com/downloads/ Qt].<br> |
|||
Je ne suis pas sûr, de savoir comment ce passe cette approche avec la compilation de FreeCAD.<br> |
|||
Il est également possible de choisir la version du compilateur '''gcc''' à utiliser, certaines versions récentes peuvent parfois provoquer des problèmes : |
|||
It is also possible to choose the version of the gcc compiler to use, some recent versions might sometimes cause problems: |
|||
sudo port -v install gcc_select |
|||
sudo port -v install gcc_select |
|||
sudo port select --list gcc |
|||
sudo port select --set gcc mp-gcc46 |
|||
'''Install Fortran Compiler''' |
|||
You also need a FORTRAN compiler. Apple's fork of gcc on OSX does not come with FORTRAN. |
|||
'''Installer le Compilateur Fortran''' |
|||
Vous avez également besoin d'un compilateur [http://fr.wikipedia.org/wiki/Fortran FORTRAN]. Le fork '''[http://fr.wikipedia.org/wiki/GNU_Compiler_Collection gcc]''' d'Apple sur '''[http://fr.wikipedia.org/wiki/OS_X OSX]''' ne convient pas à FORTRAN. |
|||
Un installateur pour '''GFortran''' peut se trouver ici, et fera l'affaire : |
|||
An installer for GFortran can be found here, and will do the trick: |
|||
http://gcc.gnu.org/wiki/GFortranBinaries#MacOS |
http://gcc.gnu.org/wiki/GFortranBinaries#MacOS |
||
If you are using fink, another method is to use the following commands (attempted by Shaneyfelt 2100.Nov.14) |
|||
Si vous utilisez '''fink''', une autre méthode consiste à utiliser les commandes suivantes (tenté par Shaneyfelt 2100.Nov.14) |
|||
sudo fink selfupdate |
sudo fink selfupdate |
||
sudo fink install gcc46 |
sudo fink install gcc46 |
||
''This installs another gcc compiler collection with the name gcc-4 to avoid a name conflict with the apple one.'' |
|||
MacPorts gcc4x packages also include FORTRAN compilers, so this should also work: |
|||
''Cela installe une autre collection de compilateurs '''gcc''' avec comme nom, '''gcc-4''' afin d'éviter un conflit de nom avec l''''Apple one'''.'' |
|||
Les paquets '''MacPorts gcc4x''', également incluent les compilateurs de '''Fortran''', et il faudrait également faire : |
|||
sudo port install gcc46 |
sudo port install gcc46 |
||
Another possible MacPorts package is g95. This seems to be a valid FORTRAN90 compiler and will pass FreeCAD's cmake configuration tests, but the actual build seems to ask for gcc-specific options, so probably easier to stick to gcc4x. |
|||
'''Install Eigen3''' |
|||
Un autre paquet possible pour '''MacPorts''' est '''[http://www.g95.org/ g95]'''.<br> |
|||
Cela semble être valable pour le compilateur [http://en.wikipedia.org/wiki/Fortran#Fortran_90 FORTRAN90] et passer des tests de configuration cmake de FreeCAD, mais la version actuelle semble demander des options spécifiques pour '''gcc''', il est sans doute plus facile de s'en tenir à '''[https://trac.macports.org/ticket/33963 gcc4x]'''. |
|||
'''Installer Eigen3''' |
|||
Téléchargez et décompressez la dernière bibliothèque '''eigen3''' ici : |
|||
Download and unzip the latest eigen3 library here: |
|||
http://eigen.tuxfamily.org/index.php?title=Main_Page |
http://eigen.tuxfamily.org/index.php?title=Main_Page |
||
These are needed for solver functionality. Once unzipped, the folder named 'Eigen' can be dropped into |
|||
Ces mesures sont nécessaires pour la fonctionnalité du solveur. Une fois décompressé, le dossier nommé '''Eigen''' peut être déposé dans : |
|||
'''/usr/local/include/eigen3/''' |
'''/usr/local/include/eigen3/''' |
||
=== |
=== Build OpenCASCADE === |
||
Actuellement, la meilleure façon de compiler '''OpenCASCADE''' sur '''OS X''' est, l'édition communautaire ('''OCE''').<br> |
|||
Téléchargez le code source ou, consultez le dépôt [http://fr.wikipedia.org/wiki/Git Git] à partir de : |
|||
Currently, the easiest way to build OpenCASCADE on OS X is from the community edition (oce). Download the source or check out the Git repository from: |
|||
:https://github.com/tpaviot/oce |
:https://github.com/tpaviot/oce |
||
Then, in terminal: |
|||
Alors, tapez dans le terminal : |
|||
mkdir build |
mkdir build |
||
cd build |
cd build |
||
Line 146: | Line 105: | ||
make |
make |
||
make install/strip |
make install/strip |
||
You may need cmake: |
|||
Vous devrez peut-être faire cmake : |
|||
sudo port install cmake |
sudo port install cmake |
||
=== Download and 'install' the FreeCAD.app template === |
|||
The following archive contains an application bundle template for FreeCAD. This is not strictly necessary, but it makes working with FreeCAD more convenient than the default installation configuration. The recommended install location for the bundle is the /Applications folder, but you should be able to put it anywhere you want -- just remember that the bundle can't be moved after FreeCAD is complied and installed without further modifications. Running make install using the configuration in the next step will install into this bundle. |
|||
=== Télécharger et installer le modèle FreeCAD.app === |
|||
L'archive suivante contient un modèle d'application pour FreeCAD. Ce n'est pas réellement nécessaire, mais il rend le travail de configuration de l'installation par défaut de FreeCAD plus pratique. L'emplacement recommandé de l'installation pour le bundle, est le dossier d'applications, mais vous devriez être en mesure de l'installer où vous voulez. Rrappelez-vous juste que, le faisceau (bundle) '''ne peut pas être déplacé ou modifié''' après que FreeCAD soit installé.<br> |
|||
Lancer '''make install''' dans l'étape suivante en utilisant cette configuration, l'installera dans cet ensemble (bundle). |
|||
:http://dl.getdropbox.com/u/103808/FreeCAD/FreeCAD_bundle_template_20091128.tar.gz |
:http://dl.getdropbox.com/u/103808/FreeCAD/FreeCAD_bundle_template_20091128.tar.gz |
||
=== Compile === |
|||
Configure, compile, and install FreeCAD using the following commands from within the root FreeCAD folder. If you put your FreeCAD.app bundle somewhere other than /Applications (or aren't using the bundle), change the 'PREFIX' argument accordingly. |
|||
=== Compilation === |
|||
Configurez, compilez et installez FreeCAD, en utilisant les commandes suivantes à partir du dossier racine de FreeCAD.<br> |
|||
Si vous mettez votre paquet '''FreeCAD.app''' ailleurs que dans Application (ou, n'utilise pas le bundle), changer la valeur de '''PREFIX''' en conséquence. |
|||
./autogen.sh |
./autogen.sh |
||
PREFIX=/Applications/FreeCAD.app/Contents |
PREFIX=/Applications/FreeCAD.app/Contents |
||
If you installed dependencies using Option 1 (Homebrew): |
|||
''Note'': this config line has not been verified and may contain errors! |
|||
Si vous avez installé les dépendances en utilisant l'option '''1 (Homebrew)''' :<br> |
|||
'''PS : cette ligne de configuration n'a pas été vérifiée et peut contenir des erreurs !''' |
|||
./configure --with-xercesc-lib=/usr/local/lib --with-xercesc-include=/usr/local/include \ |
./configure --with-xercesc-lib=/usr/local/lib --with-xercesc-include=/usr/local/include \ |
||
--with-boost-lib=/usr/local/lib --with-boost-include=/usr/local/include \ |
--with-boost-lib=/usr/local/lib --with-boost-include=/usr/local/include \ |
||
Line 180: | Line 128: | ||
--datarootdir=/Applications/FreeCAD.app/Contents/Resources/share --enable-debug=no \ |
--datarootdir=/Applications/FreeCAD.app/Contents/Resources/share --enable-debug=no \ |
||
--with-python-include=/System/Library/Frameworks/Python.framework/Versions/2.5/Headers |
--with-python-include=/System/Library/Frameworks/Python.framework/Versions/2.5/Headers |
||
Or if you installed dependencies using Option 2 (MacPorts/Fink): |
|||
ou, si vous avez installé les dépendances en utilisant l'option '''2 (MacPorts/Fink)''' : |
|||
./configure --with-xercesc-lib=/opt/local/lib --with-xercesc-include=/opt/local/include \ |
./configure --with-xercesc-lib=/opt/local/lib --with-xercesc-include=/opt/local/include \ |
||
--with-boost-lib=/opt/local/lib --with-boost-include=/opt/local/include \ |
--with-boost-lib=/opt/local/lib --with-boost-include=/opt/local/include \ |
||
Line 194: | Line 140: | ||
--datarootdir=/Applications/FreeCAD.app/Contents/Resources/share --enable-debug=no \ |
--datarootdir=/Applications/FreeCAD.app/Contents/Resources/share --enable-debug=no \ |
||
--with-python-include=/System/Library/Frameworks/Python.framework/Versions/2.5/Headers |
--with-python-include=/System/Library/Frameworks/Python.framework/Versions/2.5/Headers |
||
Then: |
|||
alors : |
|||
make |
make |
||
make install |
make install |
||
Depending on your machine's processing power, the make step can take quite a while. |
|||
=== Run === |
|||
Selon la puissance de votre machine, l'étape '''make''' peut prendre plus ou moins de temps. |
|||
If everything went OK, double-clicking the .app bundle should start FreeCAD. If you have any issues, post the details on the [http://forum.freecadweb.org/viewforum.php?f=4 help forum]. |
|||
=== Exécution === |
|||
Si tout s'est bien passé, double-cliquez sur le paquet '''.app''' pour démarrer FreeCAD.<br> |
|||
Si vous avez des questions, postez les sur le [http://forum.freecadweb.org/viewforum.php?f=4 forum d'aide] (Anglais).<br> |
|||
Une discussion a été ouverte en Français [https://forum.freecadweb.org/viewtopic.php?f=12&t=3538 Freecad sur Mac] |
|||
=== PyQt4 === |
=== PyQt4 === |
||
Some users reported facing a "No Module named PyQt4" message on FreeCAD startup. This is a workaround to correct it: |
|||
Il y, a une solution de contournement pour le corriger : |
|||
cd /Library/Python/2.6/site-packages |
cd /Library/Python/2.6/site-packages |
||
sudo ln -s /contrib/lib/python2.6/site-packages/PyQt4 . |
sudo ln -s /contrib/lib/python2.6/site-packages/PyQt4 . |
||
Line 220: | Line 158: | ||
cd /volatile/FreeCAD-r5443-ser/lib |
cd /volatile/FreeCAD-r5443-ser/lib |
||
for i in *.dylib; do j=`basename $i .dylib`; cp $i $j.so; done |
for i in *.dylib; do j=`basename $i .dylib`; cp $i $j.so; done |
||
=== Pivy === |
=== Pivy === |
||
Some FreeCAD components won't work without Pivy. See [[Extra_python_modules#Pivy|here]] for partial build instructions. |
|||
Certains composants de FreeCAD ne fonctionneront pas sans pivy. Allez voir [[Extra_python_modules/fr#Pivy|sur cette page]] pour les instructions de compilations partielles. |
|||
{{docnav |
{{docnav|CompileOnUnix|Third Party Libraries}} |
||
[[Category:Developer Documentation]] |
|||
{{languages/fr | {{en|CompileOnMac}} {{es|CompileOnMac/es}} {{jp|CompileOnMac/jp}} {{se|CompileOnMac/se}} }} |
|||
{{clear}} |
|||
[[Category:Developer Documentation/fr]] |
|||
<languages/> |
Revision as of 22:05, 6 November 2014
Since Mac OS X is BSD (UNIX) based, compiling FreeCAD on a Mac isn't much different from CompileOnUnix, however there are a number of Mac-specific details critical to getting everything working properly. These instructions have been tested on Lion (10.7), but should work on Intel Macs running (Snow) Leopard as well.
Getting the source
Before you can compile FreeCAD, you need the source code. There are 3 ways to get it:
Git
The quickest and best way to get the code is to clone the read-only git repository (you need the git package installed):
git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad freecad
This will place a copy of the latest version of the FreeCAD source code in a new directory called "freecad". The first time you try connecting to the free-cad.git.sourceforge.net host, you will receive a message asking to authenticate the sourceforge SSH key, which is normally safe to accept (you can check their SSH keys on the sourceforge website if you are not sure)
Github
There is an always up to date FreeCAD repository on Gihub: github.com/FreeCAD/FreeCAD_sf_master
Source package
Alternatively you can download a source package, but they could be already quite old so it's always better to get the latest sources. Depending on your distribution, there are several ways to obtain a source package:
Official FreeCAD source packages (distribution-independent): https://sourceforge.net/projects/free-cad/files/FreeCAD%20Source/ Debian: http://packages.debian.org/source/sid/freecad Ubuntu: http://packages.ubuntu.com/source/precise/freecad
Install Dependencies
On Mac OS X 10.7, the following dependencies are NOT bundled with the operating and thus must be installed before building FreeCAD:
- sip
- fortran
- xerces-c
- boost
- eigen
- ftgl
- coin3d
- OpenCASCADE
- Qt
- pyqt
- soqt
Option 1: Homebrew
Note: this section is still a work in progress! See the help forum post for the latest.
Download and install the package manager Homebrew:
Then compile and install most of FreeCAD's dependencies:
brew install sip gfortran xerces-c boost eigen coin qt pyqt soqt ftgl
Go on to CompileOnMac#Build OpenCASCADE.
Option 2: MacPorts/Fink
Note: this section is in need of updates.
Install MacPorts (if you don't already have it). MacPorts is a system that allows you to download, compile, and install many common open-source applications with a single command. Similar applications from the UNIX/Linux world are PKGSRC and APT. To install, just download the disk image from the MacPorts site and follow the directions:
Whether or not you just installed MacPorts, you'll probably want to make sure it's up to date. Run:
sudo port selfupdate
Now that MacPorts is installed and up to date, you can start installing some of FreeCAD's required packages:
- xercesc
- boost
- py-sip
- ftlg
- f2c
- eigen3
- py-pyqt4
- Coin
The following command will compile/install the above libraries. If MacPorts produces errors, you may want to try installing them one at a time.
sudo port install xercesc boost ftgl f2c eigen3 py-sip py-pyqt4 Coin
Note that for python packages like py-sip and py-pyqt4, there are multiple packages, one for each MacPorts version of Python.
Note that boost is a large package, and py-pyqt4 depends on qt4-mac, which is a large package. You may want to run port -v install so that you have more of an idea what's going on during these long builds.
Qt4 is also available for Mac as a binary installer from the Qt web site. I'm not sure how nicely this approach plays with FreeCAD compiling.
It is also possible to choose the version of the gcc compiler to use, some recent versions might sometimes cause problems:
sudo port -v install gcc_select sudo port select --list gcc sudo port select --set gcc mp-gcc46
Install Fortran Compiler
You also need a FORTRAN compiler. Apple's fork of gcc on OSX does not come with FORTRAN.
An installer for GFortran can be found here, and will do the trick: http://gcc.gnu.org/wiki/GFortranBinaries#MacOS If you are using fink, another method is to use the following commands (attempted by Shaneyfelt 2100.Nov.14)
sudo fink selfupdate sudo fink install gcc46
This installs another gcc compiler collection with the name gcc-4 to avoid a name conflict with the apple one.
MacPorts gcc4x packages also include FORTRAN compilers, so this should also work:
sudo port install gcc46
Another possible MacPorts package is g95. This seems to be a valid FORTRAN90 compiler and will pass FreeCAD's cmake configuration tests, but the actual build seems to ask for gcc-specific options, so probably easier to stick to gcc4x.
Install Eigen3
Download and unzip the latest eigen3 library here: http://eigen.tuxfamily.org/index.php?title=Main_Page These are needed for solver functionality. Once unzipped, the folder named 'Eigen' can be dropped into
/usr/local/include/eigen3/
Build OpenCASCADE
Currently, the easiest way to build OpenCASCADE on OS X is from the community edition (oce). Download the source or check out the Git repository from:
Then, in terminal:
mkdir build cd build cmake .. cd .. make make install/strip
You may need cmake:
sudo port install cmake
Download and 'install' the FreeCAD.app template
The following archive contains an application bundle template for FreeCAD. This is not strictly necessary, but it makes working with FreeCAD more convenient than the default installation configuration. The recommended install location for the bundle is the /Applications folder, but you should be able to put it anywhere you want -- just remember that the bundle can't be moved after FreeCAD is complied and installed without further modifications. Running make install using the configuration in the next step will install into this bundle.
Compile
Configure, compile, and install FreeCAD using the following commands from within the root FreeCAD folder. If you put your FreeCAD.app bundle somewhere other than /Applications (or aren't using the bundle), change the 'PREFIX' argument accordingly.
./autogen.sh PREFIX=/Applications/FreeCAD.app/Contents
If you installed dependencies using Option 1 (Homebrew):
Note: this config line has not been verified and may contain errors!
./configure --with-xercesc-lib=/usr/local/lib --with-xercesc-include=/usr/local/include \ --with-boost-lib=/usr/local/lib --with-boost-include=/usr/local/include \ --with-qt4-dir=/usr/local--with-qt4-lib=/usr/local/lib --with-qt4-include=/usr/local/include \ --with-qt4-framework=/usr/local/lib --with-qt4-bin=/usr/local/bin --with-occ-lib=/usr/local/lib \ --with-occ-include=/usr/local/include/oce --with-coin=/usr/local/lib --with-soqt=/usr/local/lib \ --prefix=/Applications/FreeCAD.app/Contents --bindir=/Applications/FreeCAD.app/Contents/MacOS \ --libdir=/Applications/FreeCAD.app/Contents/Frameworks/FreeCAD \ --includedir=/Applications/FreeCAD.app/Contents/Resources/include \ --datarootdir=/Applications/FreeCAD.app/Contents/Resources/share --enable-debug=no \ --with-python-include=/System/Library/Frameworks/Python.framework/Versions/2.5/Headers
Or if you installed dependencies using Option 2 (MacPorts/Fink):
./configure --with-xercesc-lib=/opt/local/lib --with-xercesc-include=/opt/local/include \ --with-boost-lib=/opt/local/lib --with-boost-include=/opt/local/include \ --with-qt4-dir=/usr/local/Trolltech/Qt-4.8.0 --with-qt4-lib=/usr/local/Trolltech/Qt-4.8.0/lib \ --with-qt4-include=/usr/local/Trolltech/Qt-4.8.0/include --with-qt4-framework=/Library/Frameworks \ --with-qt4-bin=/usr/local/Trolltech/Qt-4.8.0/bin --with-occ-lib=/usr/local/lib \ --with-occ-include=/usr/local/include/oce --with-coin=/Library/Frameworks \ --with-soqt=/Library/Frameworks --prefix=/Applications/FreeCAD.app/Contents \ --bindir=/Applications/FreeCAD.app/Contents/MacOS --libdir=/Applications/FreeCAD.app/Contents/Frameworks/FreeCAD \ --includedir=/Applications/FreeCAD.app/Contents/Resources/include \ --datarootdir=/Applications/FreeCAD.app/Contents/Resources/share --enable-debug=no \ --with-python-include=/System/Library/Frameworks/Python.framework/Versions/2.5/Headers
Then:
make make install
Depending on your machine's processing power, the make step can take quite a while.
Run
If everything went OK, double-clicking the .app bundle should start FreeCAD. If you have any issues, post the details on the help forum.
PyQt4
Some users reported facing a "No Module named PyQt4" message on FreeCAD startup. This is a workaround to correct it:
cd /Library/Python/2.6/site-packages sudo ln -s /contrib/lib/python2.6/site-packages/PyQt4 . sudo ln -s /contrib/lib/python2.6/site-packages/sip* . cd /volatile/FreeCAD-r5443-ser/bin/pivy cp _coin.dylib _coin.so cd /volatile/FreeCAD-r5443-ser/lib for i in *.dylib; do j=`basename $i .dylib`; cp $i $j.so; done
Pivy
Some FreeCAD components won't work without Pivy. See here for partial build instructions.