Compile on MacOS: Difference between revisions
m (Fix typos) |
Renatorivo (talk | contribs) (Marked this version for translation) |
||
Line 1: | Line 1: | ||
<translate> |
<translate> |
||
<!--T:52--> |
|||
This page explains how to compile the latest FreeCAD source code on Mac OS X. |
This page explains how to compile the latest FreeCAD source code on Mac OS X. |
||
== Prerequisites == |
== Prerequisites == <!--T:53--> |
||
First of all, you will need to install the following software. |
First of all, you will need to install the following software. |
||
=== Xcode Development Tools === |
=== Xcode Development Tools === <!--T:54--> |
||
Unless you want to use the Xcode IDE for FreeCAD development, you will only need to install the Command Line Tools. To do this on 10.9 and later, open Terminal, run the following command, and then click Install in the dialog that comes up. |
Unless you want to use the Xcode IDE for FreeCAD development, you will only need to install the Command Line Tools. To do this on 10.9 and later, open Terminal, run the following command, and then click Install in the dialog that comes up. |
||
</translate> |
</translate> |
||
Line 12: | Line 13: | ||
</pre> |
</pre> |
||
<translate> |
<translate> |
||
<!--T:55--> |
|||
For other versions of OS X, you can get the package from the Apple developer [https://developer.apple.com/downloads/index.action?q=xcode downloads page] (sign in with the same Apple ID you use for other Apple services). Specifically, you will need to download Development Tools 3.2 for OS X 10.6, and Command Line Tools 4.8 for OS X 10.8. |
For other versions of OS X, you can get the package from the Apple developer [https://developer.apple.com/downloads/index.action?q=xcode downloads page] (sign in with the same Apple ID you use for other Apple services). Specifically, you will need to download Development Tools 3.2 for OS X 10.6, and Command Line Tools 4.8 for OS X 10.8. |
||
=== CMake === |
=== CMake === <!--T:56--> |
||
Install the latest version of CMake from http://www.cmake.org/download. Although Homebrew will also install CMake, it only installs the command line executable. |
Install the latest version of CMake from http://www.cmake.org/download. Although Homebrew will also install CMake, it only installs the command line executable. |
||
=== Homebrew === |
=== Homebrew === <!--T:57--> |
||
To install Homebrew, enter the following in Terminal: |
To install Homebrew, enter the following in Terminal: |
||
</translate> |
</translate> |
||
Line 24: | Line 26: | ||
</pre> |
</pre> |
||
<translate> |
<translate> |
||
== Getting the source == |
== Getting the source == <!--T:58--> |
||
In this guide, the source and build folders are created in '''/Users/username/FreeCAD''', but you can of course use whatever folder you want. |
In this guide, the source and build folders are created in '''/Users/username/FreeCAD''', but you can of course use whatever folder you want. |
||
</translate> |
</translate> |
||
Line 32: | Line 34: | ||
</pre> |
</pre> |
||
<translate> |
<translate> |
||
<!--T:59--> |
|||
To get the FreeCAD source code, run: |
To get the FreeCAD source code, run: |
||
</translate> |
</translate> |
||
Line 38: | Line 41: | ||
</pre> |
</pre> |
||
<translate> |
<translate> |
||
<!--T:60--> |
|||
Alternatively, you can use the github mirror: https://github.com/FreeCAD/FreeCAD_sf_master.git |
Alternatively, you can use the github mirror: https://github.com/FreeCAD/FreeCAD_sf_master.git |
||
== Installing the Dependencies == |
== Installing the Dependencies == <!--T:61--> |
||
All of the needed libraries can be installed using Homebrew. |
All of the needed libraries can be installed using Homebrew. |
||
</translate> |
</translate> |
||
Line 51: | Line 55: | ||
</pre> |
</pre> |
||
<translate> |
<translate> |
||
== Compiling FreeCAD == |
== Compiling FreeCAD == <!--T:62--> |
||
First, create a new folder for the build: |
First, create a new folder for the build: |
||
</translate> |
</translate> |
||
Line 58: | Line 62: | ||
</pre> |
</pre> |
||
<translate> |
<translate> |
||
<!--T:63--> |
|||
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. |
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. |
||
<!--T:64--> |
|||
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. |
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. |
||
<!--T:65--> |
|||
{| class="wikitable" style="text-align:left" |
{| class="wikitable" style="text-align:left" |
||
|- |
|- |
||
Line 89: | Line 96: | ||
Note: The above paths for OCE and Python are for versions 0.16.1 and 2.7.9, respectively -- change as needed. |
Note: The above paths for OCE and Python are for versions 0.16.1 and 2.7.9, respectively -- change as needed. |
||
<!--T:66--> |
|||
Now click '''Configure''' again and then '''Generate'''. |
Now click '''Configure''' again and then '''Generate'''. |
||
<!--T:67--> |
|||
Finally, run '''make''' to compile FreeCAD. |
Finally, run '''make''' to compile FreeCAD. |
||
</translate> |
</translate> |
||
Line 98: | Line 107: | ||
</pre> |
</pre> |
||
<translate> |
<translate> |
||
<!--T:68--> |
|||
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. |
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. |
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 == |
== Creating an application bundle == <!--T:69--> |
||
TODO |
TODO |
||
== Updating == |
== Updating == |
||
Line 112: | Line 122: | ||
<translate> |
<translate> |
||
And then repeat the compile step above. |
And then repeat the compile step above. |
||
== Troubleshooting == |
== Troubleshooting == <!--T:70--> |
||
TODO |
TODO |
||
{{docnav|CompileOnUnix|Third Party Libraries}} |
{{docnav|CompileOnUnix|Third Party Libraries}} |
||
<!--T:71--> |
|||
[[Category:Developer Documentation]] |
[[Category:Developer Documentation]] |
||
Revision as of 11:33, 20 December 2014
This page explains how to compile the latest FreeCAD source code on Mac OS X.
Prerequisites
First of all, you will need to install the following software.
Xcode Development Tools
Unless you want to use the Xcode IDE for FreeCAD development, you will only need to install the Command Line Tools. To do this on 10.9 and later, open Terminal, run the following command, and then click Install in the dialog that comes up.
xcode-select --install
For other versions of OS X, you can get the package from the Apple developer downloads page (sign in with the same Apple ID you use for other Apple services). Specifically, you will need to download Development Tools 3.2 for OS X 10.6, and Command Line Tools 4.8 for OS X 10.8.
CMake
Install the latest version of CMake from http://www.cmake.org/download. Although Homebrew will also install CMake, it only installs the command line executable.
Homebrew
To install Homebrew, enter the following in Terminal:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Getting the source
In this guide, the source and build folders are created in /Users/username/FreeCAD, but you can of course use whatever folder you want.
mkdir ~/FreeCAD cd ~/FreeCAD
To get the FreeCAD source code, run:
git clone git://git.code.sf.net/p/free-cad/code FreeCAD-git
Alternatively, you can use the github mirror: https://github.com/FreeCAD/FreeCAD_sf_master.git
Installing the Dependencies
All of the needed libraries can be installed using 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
Compiling FreeCAD
First, create a new folder for the 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