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