Project

General

Profile

Installing Wt on Ubuntu » History » Version 50

Koen Deforche, 02/26/2015 04:32 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 49 Koen Deforche
Since Ubuntu Intrepid (8.10), official packages for Ubuntu are available, see https://launchpad.net/ubuntu/+source/witty
10 1 Pieter Libin
11 50 Koen Deforche
To install all of it, do:
12 1 Pieter Libin
<pre>
13 50 Koen Deforche
 $ sudo aptitude install libwt*
14 10 Pau Garcia i Quiles
</pre>
15 1 Pieter Libin
16
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.
17
18 24 Charles Brockman
h2. Installing from Prebuilt Packages
19 1 Pieter Libin
20 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:
21 1 Pieter Libin
22
<pre>
23
 $ sudo apt-get update
24
 $ sudo aptitude install libwt*
25
</pre>
26
27 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.
28 1 Pieter Libin
29
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.
30
31
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*.
32 4 Pau Garcia i Quiles
33 24 Charles Brockman
h2. Installing from Sources
34 1 Pieter Libin
35
h3. Installing System Dependencies
36
37 36 Wim Dumon
Minimal dependencies:
38 1 Pieter Libin
<pre>
39 40 Wim Dumon
sudo apt-get install gcc g++ libboost-all-dev cmake make
40 1 Pieter Libin
</pre>
41
42 43 Wim Dumon
Optional dependencies (this list changes sometimes):
43 1 Pieter Libin
<pre>
44 42 Wim Dumon
# general features
45
sudo apt-get install libssl-dev libfcgi-dev
46
# more database backends
47
sudo apt-get install libpq-dev libmysqlclient-dev firebird-dev
48
# graphics, pdf, font, server-side OpenGL, ...
49
sudo apt-get install libpng12-dev libgraphicsmagick1-dev libhpdf-dev libpng12-dev libpango1.0-dev mesa-common-dev
50
# used by some examples
51
sudo apt-get install asciidoc libqt4-dev
52
# for building documentation
53
sudo apt-get install doxygen graphviz
54 1 Pieter Libin
</pre>
55
56 45 Wim Dumon
If an optional dependency is not found, you can still compile and use Wt. Some features may not be available in that Wt (e.g. no pdf rendering, or no server-side 2D image rendering, ...)
57
58 46 Wim Dumon
h3. Get Wt
59 1 Pieter Libin
60 36 Wim Dumon
Go to http://www.webtoolkit.eu/wt/download or download using wget:
61 1 Pieter Libin
62
<pre>
63 36 Wim Dumon
 wget -c http://kent.dl.sourceforge.net/sourceforge/witty/wt-x.y.z.tar.gz
64
 tar xvxf wt-x.y.z.tar.gz
65 24 Charles Brockman
</pre>
66 1 Pieter Libin
67 36 Wim Dumon
h3. Build Wt from sources
68 1 Pieter Libin
69 36 Wim Dumon
See also http://www.webtoolkit.eu/wt/doc/reference/html/InstallationUnix.html
70 1 Pieter Libin
71
<pre>
72 36 Wim Dumon
cd wt-x.y.z
73 44 Wim Dumon
mkdir build
74
cd build
75
# cmake options:
76
# if cmake complains about not finding boost_random, add -DWT_NO_BOOST_RANDOM=ON
77
# if you installed graphicsmagick, add -DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick
78
cmake .. 
79 36 Wim Dumon
make
80
make -C examples
81 1 Pieter Libin
</pre>
82 36 Wim Dumon
To install wt in /usr/local:
83 1 Pieter Libin
<pre>
84
 sudo make install
85
 sudo ldconfig
86
</pre>
87
88 36 Wim Dumon
h2. Try the Examples
89 1 Pieter Libin
90 24 Charles Brockman
h4. From the Prebuilt Packages
91 1 Pieter Libin
92 24 Charles Brockman
* To build the examples, call CMake this way:
93 1 Pieter Libin
94
<pre>
95
  cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/ -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples
96
</pre>
97
98
* Then go to */usr/share/doc/witty-doc/examples* and enter the directory of the example you want to run. 
99
100
* When running the example, set the docroot to "."   
101
102 9 Koen Deforche
* For instance, if you compiled the examples in /home/user/dev/wtexamples, you would do:
103 1 Pieter Libin
104
<pre>
105
  $ mkdir /home/user/dev/wtexamples
106
  $ cd /home/user/dev/wtexamples
107
  $ cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/ -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples
108
  $ make
109
  $ cd /usr/share/doc/witty-doc/examples/charts
110
  $ /home/user/dev/wtexamples/charts/charts.wt --http-port 10000 --http-addr 0.0.0.0 --docroot .
111
</pre>
112 33 Anonymous
113
h4. From the Sources
114 34 Anonymous
115 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.
116
117 48 Wim Dumon
The README file in an example's directory may contain important information regarding the example. If you followed the instructions above, an example is typically started like this:
118 47 Wim Dumon
<pre>
119
cd build/examples/webgl
120
make # compile one example separately, only need to do this once
121
cd ../../../examples/webgl
122
ln -s ../../resources .
123
../../build/examples/webgl/webgl.wt --docroot . --http-address 0.0.0.0 --http-port 8080
124 1 Pieter Libin
</pre>
125 48 Wim Dumon
126
If the example has a docroot directory, replace @--docroot .@ by @--docroot docroot@ and put the link to the resources directory in the docroot directory:
127
<pre>
128
cd docroot
129
ln -s ../../../resources .
130
cd ..
131
</pre>
132
133
If the example has an approot directory, add the startup parameter @--approot approot@
134
135
136 47 Wim Dumon
137 33 Anonymous
h4. Special Cases
138
139 36 Wim Dumon
* Please note the widget gallery example will not run properly unless you download tinymce and extract it the proper place.
140 35 Anonymous
141
* Please note the wtwithqt example needs Qt 4.x to run
142 33 Anonymous
143 39 Koen Deforche
h2. Using 'ccmake' to Edit Build Options
144 33 Anonymous
This is an easy, graphical way to edit the build options
145
146
<pre>
147 24 Charles Brockman
 cd build
148 18 darren sy
 ccmake .
149
</pre>