Project

General

Profile

Installing Wt on Ubuntu » History » Revision 48

Revision 47 (Wim Dumon, 03/10/2014 05:05 PM) → Revision 48/61 (Wim Dumon, 03/10/2014 05:08 PM)

h1. Installing Wt on Ubuntu 

 {{toc}} 

 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. 

 h2. Installing from the Official Package 

 Since Ubuntu Intrepid (8.10), official packages for Ubuntu are available. To install Wt, run: 

 <pre> 
  $ sudo aptitude install witty witty-dbg witty-dev witty-doc 
 </pre> 

 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. 

 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. 

 h2. Installing from Prebuilt Packages 

 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: 

 <pre> 
  $ sudo apt-get update 
  $ sudo aptitude install libwt* 
 </pre> 

 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. 

 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. 

 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*. 

 h2. Installing from Sources 

 h3. Installing System Dependencies 

 Minimal dependencies: 
 <pre> 
 sudo apt-get install gcc g++ libboost-all-dev cmake make 
 </pre> 

 Optional dependencies (this list changes sometimes): 
 <pre> 
 # general features 
 sudo apt-get install libssl-dev libfcgi-dev 
 # more database backends 
 sudo apt-get install libpq-dev libmysqlclient-dev firebird-dev 
 # graphics, pdf, font, server-side OpenGL, ... 
 sudo apt-get install libpng12-dev libgraphicsmagick1-dev libhpdf-dev libpng12-dev libpango1.0-dev mesa-common-dev 
 # used by some examples 
 sudo apt-get install asciidoc libqt4-dev 
 # for building documentation 
 sudo apt-get install doxygen graphviz 
 </pre> 

 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, ...) 

 h3. Get Wt 

 Go to http://www.webtoolkit.eu/wt/download or download using wget: 

 <pre> 
  wget -c http://kent.dl.sourceforge.net/sourceforge/witty/wt-x.y.z.tar.gz 
  tar xvxf wt-x.y.z.tar.gz 
 </pre> 

 h3. Build Wt from sources 

 See also http://www.webtoolkit.eu/wt/doc/reference/html/InstallationUnix.html 

 <pre> 
 cd wt-x.y.z 
 mkdir build 
 cd build 
 # cmake options: 
 # if cmake complains about not finding boost_random, add -DWT_NO_BOOST_RANDOM=ON 
 # if you installed graphicsmagick, add -DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick 
 cmake ..  
 make 
 make -C examples 
 </pre> 
 To install wt in /usr/local: 
 <pre> 
  sudo make install 
  sudo ldconfig 
 </pre> 

 h2. Try the Examples 

 h4. From the Prebuilt Packages 

 * To build the examples, call CMake this way: 

 <pre> 
   cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/ -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples 
 </pre> 

 * Then go to */usr/share/doc/witty-doc/examples* and enter the directory of the example you want to run.  

 * When running the example, set the docroot to "."    

 * For instance, if you compiled the examples in /home/user/dev/wtexamples, you would do: 

 <pre> 
   $ mkdir /home/user/dev/wtexamples 
   $ cd /home/user/dev/wtexamples 
   $ cmake -DWT_SOURCE_DIR=/usr/share/doc/witty-doc/ -DEXAMPLES_CONNECTOR="wt;wthttp" /usr/share/doc/witty-doc/examples 
   $ make 
   $ cd /usr/share/doc/witty-doc/examples/charts 
   $ /home/user/dev/wtexamples/charts/charts.wt --http-port 10000 --http-addr 0.0.0.0 --docroot . 
 </pre> 

 h4. From the Sources 

 * 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. 

 The README file in an example's the example directory may contain important information regarding the example. If you followed the instructions above, an example is typically started like this: 
 <pre> 
 cd build/examples/webgl 
 make # compile one example separately, only need to do this once 
 cd ../../../examples/webgl 
 ln -s ../../resources . 
 ../../build/examples/webgl/webgl.wt --docroot . --http-address 0.0.0.0 --http-port 8080 
 </pre> 

 If the example has a docroot directory, replace @--docroot .@ by @--docroot docroot@ and put the link to the resources directory in the docroot directory: 
 <pre> 
 cd docroot 
 ln -s ../../../resources . 
 cd .. 
 </pre> 

 If the example has an approot directory, add the startup parameter @--approot approot@ 



 

 h4. Special Cases 

 * Please note the widget gallery example will not run properly unless you download tinymce and extract it the proper place. 

 * Please note the wtwithqt example needs Qt 4.x to run 

 h2. Using 'ccmake' to Edit Build Options 
 This is an easy, graphical way to edit the build options 

 <pre> 
  cd build 
  ccmake . 
 </pre>