chiark / gitweb /
Merge pull request #828 from Dim3nsioneer/SteamEngine
[cura.git] / README.md
1 Cura
2 ====
3
4 Read this, it's important!
5 ===========================
6
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
8
9 Development
10 ===========
11
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\r
14 \r
15 Issues
16 ===========\r
17 \r
18 Before posting issues (either Bugs, Feature requests or Requests for information) please read our policies carefully. These will be regulary updated and can be found at https://github.com/daid/Cura/wiki/Issue-policies
19
20
21 Packaging
22 ---------
23
24 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.
25 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.
26
27 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.
28
29 Debian and Ubuntu Linux
30 --------
31
32 To build and install Cura, run the following commands:
33
34 ```bash
35 git clone https://github.com/daid/Cura.git
36
37 sudo apt-get install python-opengl
38 sudo apt-get install python-numpy
39 sudo apt-get install python-serial
40 sudo apt-get install python-setuptools
41
42 cd Cura
43
44 sudo ./package.sh debian_amd64          # or debian_i386 for 32bit
45
46 sudo dpkg -i ./scripts/linux/cura*.deb
47 ```
48
49 Mac OS X
50 --------
51 The following section describes how to prepare working environment for developing and packaing for Mac OS X.
52 The working environment consist of build of Python, build of wxPython and all required Python packages.
53
54 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.
55
56
57 ###Install Python
58 You'll need **non-system**, **framework-based**, **universal** with **deployment target set to 10.6** build of Python 2.7
59
60 **non-system**: Output of
61 `python -c "import sys; print sys.prefix"`
62 should *not* start with *"/System/Library/Frameworks/Python.framework/"*.
63
64 **framework-based**: Output of
65 `python -c "import distutils.sysconfig as c; print(c.get_config_var('PYTHONFRAMEWORK'))"`
66 should be non-empty string. E.g. *Python*.
67
68 **universal**: Output of
69 ``lipo -info `which python` ``
70 should include both i386 and x86_64. E.g *"Architectures in the fat file: /usr/local/bin/python are: i386 x86_64"*.
71
72 **deployment target set to 10.6**: Output of
73 ``otool -l `which python` ``
74 should contain *"cmd LC_VERSION_MIN_MACOSX ... version 10.6"*.
75
76 The easiest way to install it is via [Homebrew](http://mxcl.github.com/homebrew/) using the formula from Cura's repo:
77 `brew install --build-bottle --fresh Cura/scripts/darwin/python.rb --universal`
78 Note if you already have Python installed via Homebrew, you have to uninstall it first.
79
80 You can also install [official build](http://www.python.org/ftp/python/2.7.3/python-2.7.3-macosx10.6.dmg).
81
82
83 ###Configure Virtualenv
84 Create new virtualenv. If you have [virtualenvwrapper](http://virtualenvwrapper.readthedocs.org/en/latest/) installed:
85 `mkvirtualenv Cura`
86
87 wxPython cannot be installed via pip, we have to build it from source by specifing prefix to our virtualenv.
88
89 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/*:
90
91 1. `cd` into *~/Downloads/wxPython-src-2.9.4.0/* and configure the sources:
92
93         ./configure \
94         CFLAGS='-msse2 -mno-sse3 -mno-sse4' \
95         CXXFLAGS='-msse2 -mno-sse3 -mno-sse4' \
96         --disable-debug \
97         --enable-clipboard \
98         --enable-display \
99         --enable-dnd \
100         --enable-monolithic \
101         --enable-optimise \
102         --enable-std_string \
103         --enable-svg \
104         --enable-unicode \
105         --enable-universal_binary=i386,x86_64 \
106         --enable-webkit \
107         --prefix=$HOME/.virtualenvs/Cura/ \
108         --with-expat \
109         --with-libjpeg=builtin \
110         --with-libpng=builtin \
111         --with-libtiff=builtin \
112         --with-macosx-version-min=10.6 \
113         --with-opengl \
114         --with-osx_cocoa \
115         --with-zlib=builtin
116
117 2. `make install`
118     Note to speedup the process I recommend you to enable multicore build by adding the -j*cores* flag:
119     `make -j4 install`
120 3. `cd` into *~/Downloads/wxPython-src-2.9.4.0/wxPython/*
121 4. Build wxPython (Note `python` is the python of your virtualenv):
122
123         python setup.py build_ext \
124         BUILD_GIZMOS=1 \
125         BUILD_GLCANVAS=1 \
126         BUILD_STC=1 \
127         INSTALL_MULTIVERSION=0 \
128         UNICODE=1 \
129         WX_CONFIG=$HOME/.virtualenvs/Cura/bin/wx-config \
130         WXPORT=osx_cocoa
131
132 5. Install wxPython (Note `python` is the python of your virtualenv):
133
134         python setup.py install \
135         --prefix=$HOME/.virtualenvs/Cura \
136         BUILD_GIZMOS=1 \
137         BUILD_GLCANVAS=1 \
138         BUILD_STC=1 \
139         INSTALL_MULTIVERSION=0 \
140         UNICODE=1 \
141         WX_CONFIG=$HOME/.virtualenvs/Cura/bin/wx-config \
142         WXPORT=osx_cocoa
143
144 6. Create file *~/.virtualenvs/Cura/bin/pythonw* with the following content:
145
146         #!/bin/bash
147         ENV=`python -c "import sys; print sys.prefix"`
148         PYTHON=`python -c "import sys; print sys.real_prefix"`/bin/python
149         export PYTHONHOME=$ENV
150         exec $PYTHON "$@"
151
152 At this point virtualenv is configured for wxPython development.
153 Remember to use `python` for pacakging and `pythonw` to run app for debugging.
154
155
156 ###Install Python Packages
157 Required python packages are specified in *requirements.txt* and *requirements_darwin.txt*
158 If you use virtualenv, installing requirements as easy as `pip install -r requirements_darwin.txt`
159
160
161 ###Package Cura into application
162 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:
163 `./package.sh darwin`
164
165 Note that application is only guaranteed to work on Mac OS X version used to build and higher, but may not support lower versions.
166 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.
167