source: tspsg/INSTALL.md @ 978fdf3c4b

Last change on this file since 978fdf3c4b was 2aeaea9572, checked in by Oleksii Serdiuk, 11 years ago

Added formatting to README, INSTALL and ChangeLog? files.

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