Installing Wt on Ubuntu

Version 9 (Koen Deforche, 07/02/2010 11:02 am)

1 1
h1. Installing Wt on Ubuntu
2 1
3 1
{{toc}}
4 1
5 1
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 1
7 1
8 1
h2. Installing from the official package 
9 1
10 1
Since Ubuntu Intrepid (8.10), official packages for Ubuntu are available. To install Wt, run:
11 1
12 1
<pre>
13 1
 $ sudo aptitude install witty witty-dbg witty-dev witty-doc
14 1
</pre>
15 1
16 1
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.
17 1
18 2 Pieter Libin
_Note: If boost headers are missing, you may also need:_ 
19 1
20 1
<pre>
21 1
 $ sudo apt-get install libboost*1.35*
22 1
</pre>
23 1
24 1
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.
25 1
26 1
27 1
h2. Installing from prebuilt packages 
28 1
29 1
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 following lines to your /etc/apt/sources.list file:
30 1
31 1
<pre>
32 4 Pau Garcia i Quiles
 deb http://ppa.launchpad.net/pgquiles/ubuntu karmic main restricted universe multiverse
33 4 Pau Garcia i Quiles
 deb-src http://ppa.launchpad.net/pgquiles/ubuntu karmic main restricted universe multiverse
34 1
</pre>
35 1
36 4 Pau Garcia i Quiles
(that's for Ubuntu 9.10, replace 'karmic' with 'hardy' for Ubuntu 8.04, 'jaunty' for Ubuntu 9.04 or 'lucid' for Ubuntu 10.04)
37 1
38 1
Then run:
39 1
40 1
<pre>
41 1
 $ sudo apt-get update
42 4 Pau Garcia i Quiles
 $ sudo aptitude install libwt*
43 1
</pre>
44 1
45 4 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 libwt-dbg package contains the debug versions of the libraries.
46 1
47 1
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.
48 1
49 4 Pau Garcia i Quiles
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*.
50 1
51 1
h2. Installing from sources 
52 1
53 1
54 1
h3. Howto for wthttpd on gutsy 
55 1
56 1
I made this for a freshly installed ubuntu 7.10 (gutsy gibbon).
57 1
It's without unicode,mysql and extjs support.
58 1
Should work similar for debian 4.0 etch.
59 1
As I wrote this down after installation, I hope all steps are correct. If you encounter problems, please let me know.
60 1
61 1
62 1
h3. installing system dependencies 
63 1
64 1
Note : this information is partially out of date. Instead of installing the 1.34 versions of the boost projects, use the 1.35 ones (also in ubuntu with sudo apt-get install libboost1.35-dev)
65 1
66 1
Open a terminal and enter the following commands:
67 1
68 1
<pre>
69 1
 sudo apt-get install gcc
70 1
 sudo apt-get install g++
71 1
 sudo apt-get install zlib1g
72 1
 sudo apt-get install zlib1g-dev
73 1
 sudo apt-get install cmake
74 1
 sudo apt-get install libboost-date-time-dev libboost-date-time1.34.1
75 1
 sudo apt-get install libboost-program-options-dev libboost-program-options1.34.1
76 1
 sudo apt-get install libboost-regex-dev libboost-regex1.34.1
77 1
 sudo apt-get install libboost-signals-dev libboost-signals1.34.1
78 1
 sudo apt-get install libboost-thread-dev libboost-thread1.34.1
79 1
 sudo apt-get remove libgd-noxpm-dev (as libgd therein seems to be to old for examples - see link below)
80 1
 sudo apt-get install libgd2-xpm libgd2-xpm-dev
81 1
 sudo apt-get install libssl-dev
82 1
 sudo apt-get install libboost-filesystem-dev libboost-filesystem1.34.1
83 1
 sudo apt-get install libboost-test-dev libboost-test1.34.1
84 1
</pre>
85 1
86 1
If you also want support for deploying applications using FastCGI, you'll need the following library, and set FCGI to true when configuring Wt:
87 1
88 1
<pre>
89 1
 sudo apt-get install libfcgi-dev
90 1
</pre>
91 1
92 1
93 1
h3. getting external sources 
94 1
95 1
96 1
h4. get asio (http://asio.sourceforge.net) 
97 1
98 1
<pre>
99 1
 wget -c http://kent.dl.sourceforge.net/sourceforge/asio/asio-0.3.9.tar.bz2
100 1
 tar xvfj asio-0.3.9.tar.bz2
101 1
</pre>
102 1
103 1
104 1
h4. get Wt (http://www.webtoolkit.eu/wt) 
105 1
106 1
<pre>
107 1
 wget -c http://kent.dl.sourceforge.net/sourceforge/witty/wt-2.1.0.tar.gz
108 1
 tar xvfz wt-2.1.0.tar.gz
109 1
</pre>
110 1
111 1
112 1
h3. buidling and installing sources 
113 1
114 1
115 1
h4. asio 
116 1
117 1
<pre>
118 1
 cd asio-0.3.9
119 1
 ./configure
120 1
 sudo make install
121 1
 sudo ldconfig
122 1
</pre>
123 1
124 1
125 1
h4. Wt 
126 1
127 1
<pre>
128 1
 cd wt-2.1.0
129 1
 mkdir build; cd build
130 1
 cmake ..
131 1
 make
132 1
 sudo make install
133 1
 sudo ldconfig
134 1
</pre>
135 1
136 1
137 1
h3. Try the examples 
138 1
139 1
140 1
h4. From the prebuilt packages: 
141 1
142 1
* To build the examples, call CMake this way:
143 1
144 1
<pre>
145 1
  cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/ -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples
146 1
</pre>
147 1
148 1
* Then go to */usr/share/doc/witty-doc/examples* and enter the directory of the example you want to run. 
149 1
150 9 Koen Deforche
* When running the example, set the docroot to "."   
151 1
152 1
* For instance, if you compiled the examples in /home/user/dev/wtexamples, you would do:
153 1
154 1
<pre>
155 1
  $ mkdir /home/user/dev/wtexamples
156 1
  $ cd /home/user/dev/wtexamples
157 1
  $ cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/ -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples
158 1
  $ make
159 1
  $ cd /usr/share/doc/witty-doc/examples/charts
160 1
  $ /home/user/dev/wtexamples/charts/charts.wt --http-port 10000 --http-addr 0.0.0.0 --docroot .
161 1
</pre>
162 1
163 1
164 1
h4. From the sources: 
165 1
166 1
* 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.
167 1
168 1
169 1
170 1
h4. Special cases: 
171 1
172 1
* Please note the wt-homepage example will not run properly unless you download ExtJS (http://extjs.com) and extract it the proper place.
173 1
174 1
* Please note the wtwithqt example needs Qt 4.x to run
175 1
176 1
177 1
h3. Using 'ccmake' to edit build options 
178 1
179 1
This is an easy, graphical way to edit the build options
180 1
181 1
<pre>
182 1
 cd build
183 1
 ccmake .
184 1
</pre>
185 1
186 1
187 1
h3. if it fails with SSL problem (as mine did) 
188 1
189 1
Edit the HTTP_WITH_SSL to OFF, and try again (or you could install openssl-dev and try again)
190 1
191 1
<pre>
192 1
 CMake Error: This project requires some variables to be set,
193 1
 and cmake can not find them.
194 1
 Please set the following variables:
195 1
 OPENSSL_INCLUDE
196 1
</pre>
197 1
 OPENSSL_LIB
198 3 Vincenzo Romano
199 3 Vincenzo Romano
200 3 Vincenzo Romano
201 3 Vincenzo Romano
h2. Ubuntu's official documentation
202 3 Vincenzo Romano
203 3 Vincenzo Romano
You can find it "here":https://help.ubuntu.com/community/BuildingWtFromSource