chiark / gitweb /
Merge pull request #908 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, FreeBSD). 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 FreeBSD
84 --------
85 On FreeBSD simply use the Port Tree (`cd /usr/ports/cad/cura`) to create (`make package`) and install (`make install`) the package as root. Port will check for all necessary dependencies. You can also use the provided binary package with `pkg install Cura`.
86
87 If you want to create an archive for local use the `package.sh freebsd` script (as an ordinary user) will give you a tarball with the program.
88
89
90 ###Configure Virtualenv
91 Create new virtualenv. If you have [virtualenvwrapper](http://virtualenvwrapper.readthedocs.org/en/latest/) installed:
92 `mkvirtualenv Cura`
93
94 wxPython cannot be installed via pip, we have to build it from source by specifing prefix to our virtualenv.
95
96 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/*:
97
98 1. `cd` into *~/Downloads/wxPython-src-2.9.4.0/* and configure the sources:
99
100         ./configure \
101         CFLAGS='-msse2 -mno-sse3 -mno-sse4' \
102         CXXFLAGS='-msse2 -mno-sse3 -mno-sse4' \
103         --disable-debug \
104         --enable-clipboard \
105         --enable-display \
106         --enable-dnd \
107         --enable-monolithic \
108         --enable-optimise \
109         --enable-std_string \
110         --enable-svg \
111         --enable-unicode \
112         --enable-universal_binary=i386,x86_64 \
113         --enable-webkit \
114         --prefix=$HOME/.virtualenvs/Cura/ \
115         --with-expat \
116         --with-libjpeg=builtin \
117         --with-libpng=builtin \
118         --with-libtiff=builtin \
119         --with-macosx-version-min=10.6 \
120         --with-opengl \
121         --with-osx_cocoa \
122         --with-zlib=builtin
123
124 2. `make install`
125     Note to speedup the process I recommend you to enable multicore build by adding the -j*cores* flag:
126     `make -j4 install`
127 3. `cd` into *~/Downloads/wxPython-src-2.9.4.0/wxPython/*
128 4. Build wxPython (Note `python` is the python of your virtualenv):
129
130         python setup.py build_ext \
131         BUILD_GIZMOS=1 \
132         BUILD_GLCANVAS=1 \
133         BUILD_STC=1 \
134         INSTALL_MULTIVERSION=0 \
135         UNICODE=1 \
136         WX_CONFIG=$HOME/.virtualenvs/Cura/bin/wx-config \
137         WXPORT=osx_cocoa
138
139 5. Install wxPython (Note `python` is the python of your virtualenv):
140
141         python setup.py install \
142         --prefix=$HOME/.virtualenvs/Cura \
143         BUILD_GIZMOS=1 \
144         BUILD_GLCANVAS=1 \
145         BUILD_STC=1 \
146         INSTALL_MULTIVERSION=0 \
147         UNICODE=1 \
148         WX_CONFIG=$HOME/.virtualenvs/Cura/bin/wx-config \
149         WXPORT=osx_cocoa
150
151 6. Create file *~/.virtualenvs/Cura/bin/pythonw* with the following content:
152
153         #!/bin/bash
154         ENV=`python -c "import sys; print sys.prefix"`
155         PYTHON=`python -c "import sys; print sys.real_prefix"`/bin/python
156         export PYTHONHOME=$ENV
157         exec $PYTHON "$@"
158
159 At this point virtualenv is configured for wxPython development.
160 Remember to use `python` for pacakging and `pythonw` to run app for debugging.
161
162
163 ###Install Python Packages
164 Required python packages are specified in *requirements.txt* and *requirements_darwin.txt*
165 If you use virtualenv, installing requirements as easy as `pip install -r requirements_darwin.txt`
166
167
168 ###Package Cura into application
169 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:
170 `./package.sh darwin`
171
172 Note that application is only guaranteed to work on Mac OS X version used to build and higher, but may not support lower versions.
173 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.
174