4 Read this, it's important!
5 ===========================
7 If you are reading this, then you are looking at the *development* version of Cura. If you just want to use Cura, take a look at the following location: https://daid.github.com/Cura
12 Cura is developed in Python with a C++ engine. The part you are looking at right now is the Python GUI.
13 The C++ engine is responsible for generating the actual toolpath. For development of the engine check out https://github.com/Ultimaker/CuraEngine
18 Cura development comes with a script "package.sh", this script has been designed to run under *nix OSes (Linux, MacOS). For Windows the package.sh script can be run from bash using git.
19 The "package.sh" script generates a final release package. You should not need it during development, unless you are changing the release process. If you want to distribute your own version of Cura, then the package.sh script will allow you to do that.
21 Both MacOS and Linux require some extra instructions for development, as you need to prepare an environment. Look below at the proper section to see what is needed.
23 Debian and Ubuntu Linux
26 To build and install Cura, run the following commands:
29 git clone https://github.com/daid/Cura.git
31 sudo apt-get install python-opengl
32 sudo apt-get install python-numpy
33 sudo apt-get install python-serial
34 sudo apt-get install python-setuptools
38 sudo ./package.sh debian
40 sudo dpkg -i ./scripts/linux/Cura*.deb
45 The following section describes how to prepare working environment for developing and packaing for Mac OS X.
46 The working environment consist of build of Python, build of wxPython and all required Python packages.
48 We assume you already have Apple hardware with [64bit processor](http://support.apple.com/kb/HT3696) and you are familiar with tools like [virtualenv](http://pypi.python.org/pypi/virtualenv), [virtualenvwrapper](http://virtualenvwrapper.readthedocs.org/en/latest/) and [pip](http://www.pip-installer.org/en/latest/). Also ensure you have modern compiler installed.
52 You'll need **non-system**, **framework-based**, **universal** with **deployment target set to 10.6** build of Python 2.7
54 **non-system**: Output of
55 `python -c "import sys; print sys.prefix"`
56 should *not* start with *"/System/Library/Frameworks/Python.framework/"*.
58 **framework-based**: Output of
59 `python -c "import distutils.sysconfig as c; print(c.get_config_var('PYTHONFRAMEWORK'))"`
60 should be non-empty string. E.g. *Python*.
62 **universal**: Output of
63 ``lipo -info `which python` ``
64 should include both i386 and x86_64. E.g *"Architectures in the fat file: /usr/local/bin/python are: i386 x86_64"*.
66 **deployment target set to 10.6**: Output of
67 ``otool -l `which python` ``
68 should contain *"cmd LC_VERSION_MIN_MACOSX ... version 10.6"*.
70 The easiest way to install it is via [Homebrew](http://mxcl.github.com/homebrew/) using the formula from Cura's repo:
71 `brew install --build-bottle --fresh Cura/scripts/darwin/python.rb --universal`
72 Note if you already have Python installed via Homebrew, you have to uninstall it first.
74 You can also install [official build](http://www.python.org/ftp/python/2.7.3/python-2.7.3-macosx10.6.dmg).
77 ###Configure Virtualenv
78 Create new virtualenv. If you have [virtualenvwrapper](http://virtualenvwrapper.readthedocs.org/en/latest/) installed:
81 wxPython cannot be installed via pip, we have to build it from source by specifing prefix to our virtualenv.
83 Assuming you have virtualenv at *~/.virtualenvs/Cura/* and [wxPython sources](http://sourceforge.net/projects/wxpython/files/wxPython/2.9.4.0/wxPython-src-2.9.4.0.tar.bz2) at *~/Downloads/wxPython-src-2.9.4.0/*:
85 1. `cd` into *~/Downloads/wxPython-src-2.9.4.0/* and configure the sources:
88 CFLAGS='-msse2 -mno-sse3 -mno-sse4' \
89 CXXFLAGS='-msse2 -mno-sse3 -mno-sse4' \
99 --enable-universal_binary=i386,x86_64 \
101 --prefix=$HOME/.virtualenvs/Cura/ \
103 --with-libjpeg=builtin \
104 --with-libpng=builtin \
105 --with-libtiff=builtin \
106 --with-macosx-version-min=10.6 \
112 Note to speedup the process I recommend you to enable multicore build by adding the -j*cores* flag:
114 3. `cd` into *~/Downloads/wxPython-src-2.9.4.0/wxPython/*
115 4. Build wxPython (Note `python` is the python of your virtualenv):
117 python setup.py build_ext \
121 INSTALL_MULTIVERSION=0 \
123 WX_CONFIG=$HOME/.virtualenvs/Cura/bin/wx-config \
126 5. Install wxPython (Note `python` is the python of your virtualenv):
128 python setup.py install \
129 --prefix=$HOME/.virtualenvs/Cura \
133 INSTALL_MULTIVERSION=0 \
135 WX_CONFIG=$HOME/.virtualenvs/Cura/bin/wx-config \
138 6. Create file *~/.virtualenvs/Cura/bin/pythonw* with the following content:
141 ENV=`python -c "import sys; print sys.prefix"`
142 PYTHON=`python -c "import sys; print sys.real_prefix"`/bin/python
143 export PYTHONHOME=$ENV
146 At this point virtualenv is configured for wxPython development.
147 Remember to use `python` for pacakging and `pythonw` to run app for debugging.
150 ###Install Python Packages
151 Required python packages are specified in *requirements.txt* and *requirements_darwin.txt*
152 If you use virtualenv, installing requirements as easy as `pip install -r requirements_darwin.txt`
155 ###Package Cura into application
156 Ensure that virtualenv is activated, so `python` points to the python of your virtualenv (e.g. ~/.virtualenvs/Cura/bin/python).Use package.sh to build Cura:
157 `./package.sh darwin`
159 Note that application is only guaranteed to work on Mac OS X version used to build and higher, but may not support lower versions.
160 E.g. Cura built on 10.8 will work on 10.8 and 10.7, but not on 10.6. In other hand, Cura built on 10.6 will work on 10.6, 10.7 and 10.8.