1 | TSP Solver and Generator Installation Guide |
---|
2 | =========================================== |
---|
3 | |
---|
4 | Thank you for trying **TSP Solver and Generator**. This document will |
---|
5 | guide you through the steps necessary to compile and run **TSPSG**. |
---|
6 | |
---|
7 | |
---|
8 | 1. Requirements |
---|
9 | --------------- |
---|
10 | |
---|
11 | To be able compile **TSPSG** you need to have |
---|
12 | *[Qt libraries](http://qt-project.org/)*. The minimum supported version |
---|
13 | of *Qt* is **4.5.0**. The recommended version is **4.6.x** or higher. |
---|
14 | |
---|
15 | **NOTE:** Please, note that there will be some regressions in |
---|
16 | functionality if your version of *Qt* is lower than the recommended. |
---|
17 | |
---|
18 | |
---|
19 | 2. Assumptions |
---|
20 | -------------- |
---|
21 | |
---|
22 | This guide assumes that you already have *Qt* libraries and all |
---|
23 | necessary prerequisites installed. |
---|
24 | |
---|
25 | Also, the following assumptions are made: |
---|
26 | |
---|
27 | - For **Linux/UNIX/BSD**: `lrelease` and `qmake` are avilable in |
---|
28 | `$PATH`. |
---|
29 | - For **Windows** (*MinGW*) and **Symbian**: you have installed *Qt |
---|
30 | SDK* or prebuilt libraries and have Start Menu items for *Qt* tools. |
---|
31 | - For **Windows** (*Visual Studio*) and **Windows Mobile**: the *Qt* |
---|
32 | libraries reside in `C:\Qt\`. |
---|
33 | - For **Windows Mobile**: *Windows Mobile 5.0 Pocket PC SDK* or later |
---|
34 | is installed. |
---|
35 | |
---|
36 | |
---|
37 | 3. Supported Platforms |
---|
38 | ---------------------- |
---|
39 | |
---|
40 | **TSPSG** is oficially supported and tested on the following platforms: |
---|
41 | |
---|
42 | - **Linux**: *Gentoo AMD64* and *Kubuntu 9.10 64-bit AMD*. |
---|
43 | - **Windows**: *Windows XP 32-bit* and *Windows 7 64-bit*. |
---|
44 | - **Windows Mobile**: *Windows Mobile 6.5 Professional Edition*. |
---|
45 | |
---|
46 | |
---|
47 | 4. Building and Installation <a name="s4"></a> |
---|
48 | ---------------------------------------------- |
---|
49 | |
---|
50 | ### 4.1. Common Information ### |
---|
51 | |
---|
52 | To be able ot build **TSPSG** you need to have the following *Qt* |
---|
53 | modules: *QtCore*, *QtGui* and *QtSvg*. The first two are required, the |
---|
54 | last one is optional. To get support for additional image formats (i.e., |
---|
55 | **JPEG** and **TIFF**) you'll additionally need corresponding *Qt |
---|
56 | imageformats* plugins. |
---|
57 | |
---|
58 | If you want to build **TSPSG** without **SVG** support add `nosvg` to |
---|
59 | *qmake* `CONFIG` parameter, so that *qmake* command will typically be: |
---|
60 | |
---|
61 | qmake CONFIG+=release CONFIG+=nosvg |
---|
62 | |
---|
63 | This way you will not depend on *QtSvg* module but will not be able to |
---|
64 | export solution graph in **SVG** format. |
---|
65 | |
---|
66 | |
---|
67 | **TSPSG** uses *qmake* `PREFIX` parameter to determine installation path |
---|
68 | for make install command. If you don't specify it when running qmake, it |
---|
69 | will be assigned the default value depending on the platform: |
---|
70 | |
---|
71 | | Platform | Default `PREFIX` value | |
---|
72 | |-----------------------|-----------------------------------------| |
---|
73 | | **Linux/UNIX/BSD** | `/usr` | |
---|
74 | | **Windows** | `%PROGRAMFILES%` environment variable\* | |
---|
75 | | **Windows CE/Mobile** | `\Program Files` | |
---|
76 | | **Symbian** | *\<ignored\>* | |
---|
77 | |
---|
78 | \* - usually, it is `C:\Program Files`. |
---|
79 | |
---|
80 | **NOTE:** Please, note that there are no installation and/or packaging |
---|
81 | rules for **MacOS** and other platforms not mentioned in this table. |
---|
82 | |
---|
83 | |
---|
84 | By default, **TSPSG** uses precompiled header when being built. If you |
---|
85 | experience problems with it you may add `CONFIG+=nopch` parameter to |
---|
86 | *qmake* to disable the generation and use of the precompiled header. |
---|
87 | |
---|
88 | |
---|
89 | ### 4.2. General Procedure <a name="s42"></a> ### |
---|
90 | |
---|
91 | On most platforms the general building and installation procedure is: |
---|
92 | |
---|
93 | 1. Run `lrelease` to generate binary translation files (*.qm*) from |
---|
94 | the source (*.ts*). |
---|
95 | 2. Run `qmake` with `CONFIG+=release` parameter to generate makefiles. |
---|
96 | 3. Run `make` utility (e.g., *make*, *nmake*, *mingw32-make*) to build |
---|
97 | **TSPSG**. |
---|
98 | 4. Run `make` utility with `install` parameter. |
---|
99 | |
---|
100 | **NOTE:** It is important to run `lrelease` before `qmake`, or `qmake` |
---|
101 | will not "pick up" the translations when generating installation rules. |
---|
102 | |
---|
103 | |
---|
104 | ### 4.3. Linux/UNIX/BSD ### |
---|
105 | |
---|
106 | Open a shell, navigate to the directory where you have **TSPSG** source |
---|
107 | downloaded and type |
---|
108 | |
---|
109 | tar xvjf tspsg-<VERSION>-src.tar.bz2 |
---|
110 | cd tspsg-<VERSION>-src |
---|
111 | |
---|
112 | where *\<VERSION\>* is the version of **TSPSG** you downloaded. Now run |
---|
113 | |
---|
114 | lrelease tspsg.pro |
---|
115 | qmake tspsg.pro |
---|
116 | make |
---|
117 | |
---|
118 | In some cases you may need to type |
---|
119 | |
---|
120 | qmake tspsg.pro CONFIG+=release |
---|
121 | |
---|
122 | |
---|
123 | If make step finished without errors you can install **TSPSG** by |
---|
124 | running |
---|
125 | |
---|
126 | sudo make install |
---|
127 | |
---|
128 | or |
---|
129 | |
---|
130 | su |
---|
131 | make install |
---|
132 | |
---|
133 | depending on your distribution. |
---|
134 | |
---|
135 | The executable goes to `<PREFIX>/bin`; *COPYING*, *ChangeLog.md*, |
---|
136 | *README.md* and *INSTALL.md* go to `<PREFIX>/share/doc/TSPSG-<VERSION>`. |
---|
137 | |
---|
138 | |
---|
139 | ### 4.4. Windows ### |
---|
140 | |
---|
141 | **TSPSG** will be installed to `<PREFIX>\TSPSG` folder. |
---|
142 | |
---|
143 | **NOTE:** Please, read the [Section 7](#s7) after reading this Section. |
---|
144 | |
---|
145 | |
---|
146 | #### 4.4.1. Using MinGW #### |
---|
147 | |
---|
148 | Unpack the downloaded source code of **TSPSG** with your favourite |
---|
149 | compression software. Now launch the **Qt Command Prompt** from the |
---|
150 | Start Menu, navigate to the directory where you unpacked the source and |
---|
151 | run |
---|
152 | |
---|
153 | lrelease tspsg.pro |
---|
154 | qmake tspsg.pro CONFIG+=release |
---|
155 | mingw32-make |
---|
156 | |
---|
157 | **NOTE:** Make process may fail with a crash of *windres.exe*. If |
---|
158 | you've run into this issue, please, read the [Section 6.1](#s61). |
---|
159 | |
---|
160 | If make step finished without errors you can install **TSPSG** by |
---|
161 | running |
---|
162 | |
---|
163 | mingw32-make install |
---|
164 | |
---|
165 | |
---|
166 | #### 4.4.2. Using Visual Studio #### |
---|
167 | |
---|
168 | Unpack the downloaded source code of **TSPSG** with your favourite |
---|
169 | compression software. Now launch the **Visual Studio Command Prompt** |
---|
170 | from the Start Menu, navigate to the directory where you unpacked the |
---|
171 | source and run |
---|
172 | |
---|
173 | C:\Qt\bin\lrelease tspsg.pro |
---|
174 | C:\Qt\bin\qmake tspsg.pro CONFIG+=release |
---|
175 | nmake |
---|
176 | |
---|
177 | If *make* step finished without errors you can install **TSPSG** by |
---|
178 | running |
---|
179 | |
---|
180 | nmake install |
---|
181 | |
---|
182 | |
---|
183 | ### 4.5. Windows CE/Mobile ### |
---|
184 | |
---|
185 | Unpack the downloaded source code of **TSPSG** with your favourite |
---|
186 | compression software. Now launch the **Visual Studio Command Prompt** |
---|
187 | from the Start Menu and run |
---|
188 | |
---|
189 | set PATH=C:\Qt\bin;%PATH% |
---|
190 | setcepaths wincewm50pocket-msvc2008 |
---|
191 | |
---|
192 | Now navigate to the directory where you unpacked the source and run |
---|
193 | |
---|
194 | lrelease tspsg.pro |
---|
195 | qmake tspsg.pro CONFIG+=release |
---|
196 | nmake |
---|
197 | |
---|
198 | There is no automated installation process for **Windows Mobile** build. |
---|
199 | To install **TSPSG** on your PDA you need to create a folder on your |
---|
200 | device and copy the following files to it: |
---|
201 | |
---|
202 | - *tspsg.exe* from release folder in the source directory. |
---|
203 | - *QtCore4.dll* and *QtGui4.dll* from `C:\Qt\bin` folder. |
---|
204 | - *msvcr90.dll* from |
---|
205 | `C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\dll\armv4i` |
---|
206 | folder. |
---|
207 | - all *.qm* files from `l10n` folder in the source directory to |
---|
208 | `l10n` subfolder. |
---|
209 | |
---|
210 | |
---|
211 | ### 4.6. Symbian ### |
---|
212 | |
---|
213 | Unpack the downloaded source code of **TSPSG** with your favourite |
---|
214 | compression software. Now launch the **Qt for Symbian Command Prompt** |
---|
215 | from the Start Menu, navigate to the directory where you unpacked the |
---|
216 | source and run |
---|
217 | |
---|
218 | lrelease tspsg.pro |
---|
219 | qmake tspsg.pro CONFIG+=release |
---|
220 | make release-gcce |
---|
221 | |
---|
222 | **WARNING:** You need to unpack source code to the same drive as **Symbian |
---|
223 | SDK** and the path must not contain any spaces or **TSPSG** won't build. |
---|
224 | |
---|
225 | If make step finished without errors you can generate sis installation |
---|
226 | file by running |
---|
227 | |
---|
228 | make sis |
---|
229 | |
---|
230 | You'll get *tspsg.sis* file in the source directory. Copy it to your |
---|
231 | phone and run or install using **Nokia PC Suite**. |
---|
232 | |
---|
233 | **NOTE:** You need to install *Qt* libraries on your device before |
---|
234 | installing **TSPSG**. Usually, it should be enough to install |
---|
235 | *qt_installer.sis* from the *Qt* installation directory. |
---|
236 | |
---|
237 | Alternatively, if you have installed **Nokia Smart Installer** you can |
---|
238 | run |
---|
239 | |
---|
240 | make installer_sis |
---|
241 | |
---|
242 | You'll get an *tspsg_installer.sis* that will automatically download and |
---|
243 | install the required *Qt* libraries on **TSPSG** installation. |
---|
244 | |
---|
245 | **NOTE:** Please, be aware that you have to sign the sis file to be able |
---|
246 | to install it on your device. You can use [Open Signed Online][1] to |
---|
247 | quickly sign the sis file for your device. Alternatively, you can try to |
---|
248 | enable the installation of self-signed files in the phone settings. |
---|
249 | Please, refer to your phone manual on the instructions how to do this. |
---|
250 | |
---|
251 | |
---|
252 | ### 4.7. Other Platforms, Supported by Qt ### |
---|
253 | |
---|
254 | While **TSPSG** is oficially supported only on **Linux**, **Windows** |
---|
255 | and **Windows Mobile** it should be possible to compile it on any |
---|
256 | platform, supported by *Qt*. To do so, please, refer to the |
---|
257 | [Section 4.2](#s42) for the general build and installation procedure. |
---|
258 | |
---|
259 | |
---|
260 | 5. Uninstallation |
---|
261 | ----------------- |
---|
262 | |
---|
263 | Usually, it is enough to replace `install` parameter with `uninstall` |
---|
264 | in the installation command from the [Section 4](#s4). Also, you can |
---|
265 | manually delete all installed **TSPSG** files and directories. |
---|
266 | |
---|
267 | |
---|
268 | 6. Troubleshooting |
---|
269 | ------------------ |
---|
270 | |
---|
271 | ### 6.1. WINDRES.EXE Crash <a name="s61"></a> ### |
---|
272 | |
---|
273 | When building under **Windows** using **MinGW toolchain** make process |
---|
274 | may fail with *windres.exe* crash (access violation). This is a known |
---|
275 | bug in *windres.exe* regarding processing resource files with *UTF-8 |
---|
276 | (cp65001)* encoding ([Bug 10165][2]). To be able to successfully build |
---|
277 | **TSPSG** you will need to download and replace *windres.exe* with a |
---|
278 | fixed version. To do this: |
---|
279 | |
---|
280 | 1. Open <https://sourceforge.net/projects/mingw/files/> in your |
---|
281 | favourite browser. |
---|
282 | 2. Find and download the latest version of GNU Binutils. At the time |
---|
283 | of writing this guide it was |
---|
284 | *binutils-2.20.1-2-mingw32-bin.tar.gz*. |
---|
285 | 3. Unpack the file *bin\windres.exe* from the downloaded archive to |
---|
286 | `<Your Qt installation path>\mingw\bin\` replacing the existing |
---|
287 | one. |
---|
288 | 4. Now run |
---|
289 | |
---|
290 | mingw32-make distclean |
---|
291 | |
---|
292 | in the **TSPSG** directory and repeat the installation process. |
---|
293 | |
---|
294 | |
---|
295 | 7\. Notes <a name="s7"></a> |
---|
296 | -------------------------- |
---|
297 | |
---|
298 | *qmake* doesn't always enclose installation paths in quotes. This may |
---|
299 | cause some files not to be installed or removed when their path |
---|
300 | contains spaces. In this case it is safe to delete these files and |
---|
301 | **TSPSG** installation directory manually. |
---|
302 | |
---|
303 | |
---|
304 | [1]: https://www.symbiansigned.com/app/page/public/openSignedOnline.do |
---|
305 | [2]: http://sourceware.org/bugzilla/show_bug.cgi?id=10165 |
---|
306 | |
---|
307 | |
---|
308 | <!-- |
---|
309 | $Id: $Format:%h %ai %an$ $ |
---|
310 | $URL: http://tspsg.info/ $ |
---|
311 | --> |
---|