Compile on MacOS/es

Ya que Mac OS X está basado en BSD (UNIX), la compilación de FreeCAD en Mac no es muy diferente a la Compilación en Unix, sin embargo existen algunos detalles específicos para Mac que son críticos para tener todo funcionando correctamente. Estas instrucciones se han probado en Lion (10.7), pero también deberían funcionar en Intel Macs utilizando (Snow) Leopard.

Conseguir el código fuente
Antes de que puedas compilar FreeCAD, necesitaras el código fuente. Existen 3 modos de obtenerlo:

Git
El modo más rápido y el mejor para opbtener el código es clonar el repositorio de sólo lectura de Git (necesitas tener instalado el paquete Git): git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad freecad Esto creará una copia de la última versión del código fuente de FreeCAD en un nuevo directorio denominado "freecad". La primera vez que intentes conectar al huesped de free-cad.git.sourceforge.net, recibiras un mensaje preguntando la clave SSH de autentificación de Sourceforge, lo cual es normalmente seguro aceptar (puedes comprobar sus claves SSH en la website si no estas seguro)

Github
Siempre hay un repositorio actualizado de FreeCAD en Gihub: github.com/FreeCAD/FreeCAD_sf_master

Paquetes de código fuente
Alternativamente puedes descargar un paquete de código fuente, pero podría ser bastante antiguo así que es siempre mejor conseguir el último código fuente. Dependiendo de tu distribuidor, hay diversas formas de conseguir un paquete de software:

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

Instalar dependencias
En Mac OS X 10.7, las siguientes dependencias NO están incluidas con el sistema y por tanto deben ser instaladas antes de construir FreeCAD:
 * sip
 * fortran
 * xerces-c
 * boost
 * eigen
 * ftgl
 * coin3d
 * OpenCASCADE
 * Qt
 * pyqt
 * soqt

Opción 1: Homebrew
Nota: Esta sección está en proceso de construcción! Mira en el foro de ayuda para conocer las últimas novedades.
 * https://forum.freecadweb.org/viewtopic.php?f=4&t=2064&p=15405

Descarga e instala el gestor de paquetes Homebrew:
 * http://mxcl.github.com/homebrew/

Luego compila e instala la mayoría de dependencias de FreeCAD: brew install sip gfortran xerces-c boost eigen coin qt pyqt soqt ftgl Ve a CompileOnMac/es.

Opción 2: MacPorts/Fink
Nota: Esta sección necesita actualizarse.

Instala MacPorts, si aún no lo tienes. MacPorts es un sistema que permite descargar, compilar, e instalar muchas aplicaciones de código libre con un simple comando. Aplicaciones similares en el mundo UNIX/Linux son PKGSRC y APT. Para instalar, simplemente descarga la imagen del disco desde la web de MacPorts y sigue las instrucciones:
 * http://www.macports.org/install.php

Hubieras instalado MacPorts o no, probablemente querrás asegurarte de que está actualizado. Ejecuta: sudo port selfupdate Ahora que MacPorts está instalado y actualizado, puedes comenzar a instalar algunos paquetes requeridos por FreeCAD: 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.
 * xercesc
 * boost
 * py-sip
 * ftlg
 * f2c
 * eigen3
 * py-pyqt4
 * Coin

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:
 * https://github.com/tpaviot/oce

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.
 * 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. ./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.