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