Project

General

Profile

Installing Wt on Ubuntu » History » Version 42

Wim Dumon, 03/10/2014 04:57 PM

1 1 Pieter Libin
h1. Installing Wt on Ubuntu
2
3
{{toc}}
4
5
For installation of Wt on Ubuntu, you have the choice between the official package available in Ubuntu, prebuilt packages by Pau Garcia i Quiles (always updated to the newest Wt version) or installation from source.
6
7 24 Charles Brockman
h2. Installing from the Official Package
8 1 Pieter Libin
9
Since Ubuntu Intrepid (8.10), official packages for Ubuntu are available. To install Wt, run:
10
11
<pre>
12
 $ sudo aptitude install witty witty-dbg witty-dev witty-doc
13
</pre>
14
15 10 Pau Garcia i Quiles
This will automatically install all the required dependencies. If you only want the runtime library, you only need to install the witty package. The witty-dbg package contains the debug versions of the libraries. Make sure you install witty-dev (or libwtwhatever-dev) if you want to develop Wt applications.
16 1 Pieter Libin
17
The official package is usually a bit outdated due to the stabilization periods Debian and Ubuntu need prior to release. If you want to use the newest version of Wt and not build from source, read on.
18
19 24 Charles Brockman
h2. Installing from Prebuilt Packages
20 1 Pieter Libin
21 10 Pau Garcia i Quiles
Since Wt 2.0.3, unofficial packages for Ubuntu are being built by "Pau Garcia i Quiles":http://www.elpauer.org/. To install Wt, add the "Wt PPA":http://launchpad.net/~pgquiles/+archive/wt to your repositories (check "Adding this PPA to your system" in the Wt PPA page). After adding the repository to your system, run:
22 1 Pieter Libin
23
<pre>
24
 $ sudo apt-get update
25
 $ sudo aptitude install libwt*
26
</pre>
27
28 21 Jake Petroules
This will automatically install all the required dependencies. If you only want the runtime library, you only need to install the libwt24, libwthttp24, libwtext24, etc packages (no -dev, -doc or -dbg packages). The libwt-dbg package contains the debug versions of the libraries.
29 1 Pieter Libin
30
These packages are built by the maintainer of the official Debian and Ubuntu packages and are always updated to the latest version of Wt. If you want to use the newest version of Wt and not build from source, this is the preferred method.
31
32
Please note in the past packages were named witty, witty-dev, witty-doc and witty-dbg. These package still exist but only as transitional packages and will be removed in the future. It is recommended that you install libwt*.
33 4 Pau Garcia i Quiles
34 24 Charles Brockman
h2. Installing from Sources
35 1 Pieter Libin
36
h3. Installing System Dependencies
37
38 36 Wim Dumon
Minimal dependencies:
39 1 Pieter Libin
<pre>
40 40 Wim Dumon
sudo apt-get install gcc g++ libboost-all-dev cmake make
41 1 Pieter Libin
</pre>
42
43 36 Wim Dumon
Optional dependencies (among others):
44 1 Pieter Libin
<pre>
45 42 Wim Dumon
# general features
46
sudo apt-get install libssl-dev libfcgi-dev
47
# more database backends
48
sudo apt-get install libpq-dev libmysqlclient-dev firebird-dev
49
# graphics, pdf, font, server-side OpenGL, ...
50
sudo apt-get install libpng12-dev libgraphicsmagick1-dev libhpdf-dev libpng12-dev libpango1.0-dev mesa-common-dev
51
# used by some examples
52
sudo apt-get install asciidoc libqt4-dev
53
# for building documentation
54
sudo apt-get install doxygen graphviz
55 1 Pieter Libin
</pre>
56
57 36 Wim Dumon
Get Wt:
58 1 Pieter Libin
59 36 Wim Dumon
Go to http://www.webtoolkit.eu/wt/download or download using wget:
60 1 Pieter Libin
61
<pre>
62 36 Wim Dumon
 wget -c http://kent.dl.sourceforge.net/sourceforge/witty/wt-x.y.z.tar.gz
63
 tar xvxf wt-x.y.z.tar.gz
64 24 Charles Brockman
</pre>
65 1 Pieter Libin
66 36 Wim Dumon
h3. Build Wt from sources
67 1 Pieter Libin
68 36 Wim Dumon
See also http://www.webtoolkit.eu/wt/doc/reference/html/InstallationUnix.html
69 1 Pieter Libin
70
<pre>
71 36 Wim Dumon
cd wt-x.y.z
72
mkdir build; cd build
73 41 Wim Dumon
cmake .. # if cmake complains about not finding boost_random, add -DWT_NO_BOOST_RANDOM=ON
74 36 Wim Dumon
make
75
make -C examples
76 1 Pieter Libin
</pre>
77 36 Wim Dumon
To install wt in /usr/local:
78 1 Pieter Libin
<pre>
79
 sudo make install
80
 sudo ldconfig
81
</pre>
82
83 36 Wim Dumon
h2. Try the Examples
84 1 Pieter Libin
85 24 Charles Brockman
h4. From the Prebuilt Packages
86 1 Pieter Libin
87 24 Charles Brockman
* To build the examples, call CMake this way:
88 1 Pieter Libin
89
<pre>
90
  cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/ -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples
91
</pre>
92
93
* Then go to */usr/share/doc/witty-doc/examples* and enter the directory of the example you want to run. 
94
95
* When running the example, set the docroot to "."   
96
97 9 Koen Deforche
* For instance, if you compiled the examples in /home/user/dev/wtexamples, you would do:
98 1 Pieter Libin
99
<pre>
100
  $ mkdir /home/user/dev/wtexamples
101
  $ cd /home/user/dev/wtexamples
102
  $ cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/ -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples
103
  $ make
104
  $ cd /usr/share/doc/witty-doc/examples/charts
105
  $ /home/user/dev/wtexamples/charts/charts.wt --http-port 10000 --http-addr 0.0.0.0 --docroot .
106
</pre>
107 33 Anonymous
108
h4. From the Sources
109 34 Anonymous
110 33 Anonymous
* If you installed Wt using the source packages (http://sourceforge.net/projects/witty/files/), then you can find instructions on how to run the examples in the file *INSTALL.html* that is included in the main directory of the respective source package.
111
112
h4. Special Cases
113
114 36 Wim Dumon
* Please note the widget gallery example will not run properly unless you download tinymce and extract it the proper place.
115 35 Anonymous
116
* Please note the wtwithqt example needs Qt 4.x to run
117 33 Anonymous
118 39 Koen Deforche
h2. Using 'ccmake' to Edit Build Options
119 33 Anonymous
This is an easy, graphical way to edit the build options
120
121
<pre>
122 24 Charles Brockman
 cd build
123 18 darren sy
 ccmake .
124
</pre>