Difference between revisions of "HowTo Compile In Ubuntu"

From AMule Project FAQ
Jump to: navigation, search
(temp)
(Build wxWidgets)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Work in progress, stop reading NOW.
+
This page describes how to compile aMule and its required libraries CryptoPP and wxWidgets on Ubuntu 9.04. We will install everything in our home directory in this example. Make a directory where you want to build and install aMule (we will use <code>/home/me/amule</code> and I'll call it <code>"amule"</code>).  
 
+
 
+
This page describes how to compile aMule and its required libraries CryptoPP and wxWidgets on Ubuntu 9.04. We will install everything in our home directory in this example.
+
  
 
= Install packages =
 
= Install packages =
Line 9: Line 6:
 
* g++
 
* g++
 
* binutils-dev
 
* binutils-dev
 +
* libcrypto++-dev
 
* libgtk2.0-dev
 
* libgtk2.0-dev
 
* libgd2-xpm-dev
 
* libgd2-xpm-dev
Line 14: Line 12:
 
* libupnp3-dev
 
* libupnp3-dev
 
* zlib1g-dev
 
* zlib1g-dev
 +
* autopoint (only Maverick and above)
  
 
= Build CryptoPP =
 
= Build CryptoPP =
Make directory where you want to build and install aMule (we will use <code>/home/me/amule</code> and I'll call it <code>"amule"</code>). Download [http://www.cryptopp.com/cryptopp560.zip CryptoPP 5.6.0]. Unzip it to <code>/home/me/amule/cryptopp</code> and run <code>make</code>. Then run <code>./cryptest.exe v</code> to validate it (it must print <code>All tests passed!</code>).
+
You shouldn't try to build CryptoPP on Ubuntu from source. The original CryptoPP headers are broken and cause a zillion warnings later building aMule. The Ubuntu developers provide fixed headers so you should use the lib that comes with it. However you should also install the cryptest tool and verify if CryptoPP really runs on your machine:
  
= Build wxWidgets =
+
<code>sudo apt-get install libcrypto++-utils</code>
Make directory <code>amule/wx</code>. Download [http://www.wxwidgets.org/downloads/ latest stable wxGTK] (2.8.10 writing this). Wx 2.9 is still experimental, if you feel adventurous you can try it (but only with aMule 2.3).
+
  
Extract it with <code>tar xzf wxGTK-2.8.10.tar.gz</code>. Make and cd to wx/build and run
+
<code>cd /usr/share/crypto++</code>
  
<code>../wxGTK-2.8.10/configure --prefix=/home/me/amule/wx --with-gtk --enable-unicode --enable-optimise --disable-shared</code>
+
<code>cryptest v</code>
  
then <code>make</code> and <code>make install</code> .  
+
If you still want to build it, download [http://www.cryptopp.com/cryptopp561.zip CryptoPP 5.6.1]. Unzip it to <code>/home/me/amule/cryptopp</code> . Run <code>make</code>. Then run <code>./cryptest.exe v</code> to validate it (it must print <code>All tests passed!</code>).
  
= Build aMule =
+
= Build wxWidgets =
 +
Make directory <code>amule/wx</code>. Download [http://www.wxwidgets.org/downloads/ latest stable wxGTK] (2.8.12 writing this). Wx 2.9 is still experimental, if you feel adventurous you can try it (but only with aMule 2.3).
  
 +
Extract it with <code>tar xzf wxGTK-2.8.12.tar.gz</code>. Make and cd to wx/build and run
  
./configure --prefix=/home/martin/aMule/bin --enable-debug --enable-optimize --with-denoise-level=3 --enable-upnp --enable-geoip --enable-nls --enable-amule-gui --enable-amule-daemon --enable-amulecmd --enable-webserver --enable-alcc -enable-alc --enable-cas --enable-wxcas --enable-mmap --with-wx-config=/home/martin/aMule/wx/bin/wx-config --with-crypto-prefix=/home/martin/aMule/cryptopp
+
<code>../wxGTK-2.8.12/configure --with-gtk --without-libtiff  --without-subdirs --enable-unicode --enable-optimise</code>
  
== Info: What aMule release needs what wxwidgets release? ==
+
then <code>make</code> . Do not <code>make install</code> !
* Debian Etch includes aMule 2.1.3 and wxwidgets 2.6.3
+
  
* aMule 2.1.x needs wxwidgets 2.6. You cannot compile it with newer versions of wxwidgets.
+
Once Ubuntu starts shipping wx 2.8.12 you can also simply install libwxgtk2.8-dev . Older versions can cause out-of-memory crashes and should be avoided!
* aMule 2.2.x needs wxwidgets 2.8. You cannot compile it with older versions of wxwidgets.
+
  
== What developement packages do I need for compiling? ==
+
= Build aMule =
For compiling [[aMule SVN]] you need the following packages installed:
+
Make dir and download and unpack aMule's source ([http://www.amule.org/files/ Release] or [[AMule_SVN|current SVN]]), then
 
+
* libcrypto++-dev
+
* libgd2-xpm-dev
+
* libgeoip-dev
+
* libglib2.0-dev
+
* libpng12-dev
+
* libreadline5-dev
+
* libupnp3-dev
+
* libwxgtk2.8-dev
+
* wx2.8-i18n
+
* zlib1g-dev
+
* binutils-dev
+
 
+
'''Warning''': ''64 bit users need to install a libxcb >= 1.1.92 if they want long uptimes.''
+
 
+
== Preparing: Compiling and installing wxwidgets ==
+
This algorithm works for all Debian flavours.
+
 
+
''Note: Recent versions of Ubuntu (Jaunty) have an (almost unpatched) libwxgtk good enough for use with aMule. Note that aMule developers require you compile your own wxWidgets.''
+
 
+
To compile aMule, You need to have a current version of [[wxWidgets]] installed. To achieve that:
+
Uninstall every possibly previously installed wxwidgets stuff (see [[How to uninstall wxWidgets]]
+
and [[Check if wx is installed twice]])
+
You need the following packages installed:
+
 
+
* flex
+
* bison
+
* gettext
+
* libgtk2.0-dev
+
* python-all-dev (>= 2.4.3)
+
* python-all-dbg
+
* zlib1g-dev
+
* libjpeg62-dev
+
* libpng12-dev
+
* libtiff4-dev
+
* libsm-dev
+
* libgl1-mesa-dev '''or''' libgl-dev
+
* libglu1-mesa-dev '''or''' libglu-dev
+
* libesd0-dev
+
* libgnomeprintui2.2-dev
+
* libgconf2-dev
+
* libgstreamer0.10-dev
+
* libgstreamer-plugins-base0.10-dev
+
* bc
+
 
+
# Download current wxwidgets wxGTK stable release source code tar ball from <tt>http://www.wxwidgets.org/downloads/</tt>
+
# <tt>$ tar xvzf wxgtk-''version''.tar.gz</tt>
+
# <tt>$ cd wxGTK-''version''</tt>
+
# <tt>$ ./configure --prefix=/usr --with-gtk --enable-unicode --disable-compat24 --enable-optimise</tt>
+
# <tt>$ make</tt>
+
# <tt># make install</tt>
+
# <tt># ldconfig</tt>
+
 
+
$ = command executed with normal user account<br>
+
<nowiki>#</nowiki> = command executed with root account
+
 
+
== Compiling and installing aMule ==
+
Now that You have installed current wxGTK, go on to compile aMule:
+
# Install the needed packages mentioned in '''"What developement packages do I need for compiling?"'''
+
# Download aMule source code tar ball from <tt>http://www.amule.org</tt> (note: For compiling aMule 2.1.3 you'll need a patch aviable [http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/aMule-wx.patch?rev=1.2 HERE]
+
# <tt>$ tar xvjf aMule-''version''.tar.bz2</tt>
+
# <tt>$ cd aMule-''version''</tt>
+
# To have a look what features of aMule You can enable or disable: <tt>$ ./configure --help</tt>
+
# You should be right with <tt>$ ./configure --disable-debug --enable-optimize</tt>
+
# <tt>$ make</tt>
+
# <tt># make install</tt>
+
 
+
$ = command executed with normal user account<br>
+
<nowiki>#</nowiki> = command executed with root account
+
  
That's it! Now You can start aMule with command "amule".
+
<code>./configure --prefix=/home/me/amule/bin --enable-debug --enable-optimize --with-denoise-level=3 --enable-upnp --enable-geoip --enable-nls --enable-amule-gui --enable-amule-daemon --enable-amulecmd --enable-webserver --enable-alcc --enable-alc --enable-cas --enable-wxcas --enable-mmap --with-wxdir=/home/me/amule/wx/build --with-crypto-prefix=/home/me/amule/cryptopp</code>
  
 +
Leave out the --with-crypto-prefix when using the Ubuntu CryptoPP. Also leave out the --enable-upnp if you don't need UPnP (that is if you are able to set up port forwarding in your router). Also leave out --with-wxdir when using libwxgtk2.8-dev .
  
 +
Now just run <code>make</code> and <code>make install</code> and that's it! You can start aMule with command "/home/me/amule/bin/amule".
  
== You're done... ==
+
If you get an error <code>undefined reference to symbol 'XGetWindowAttributes'</code> add <code>LIBS=-lX11</code> to ./configure .
That's it! Your own compiled [[aMule]] is installed on your system and ready to go.
+
  
To run [[aMule]], just type <code>"amule"</code>. You can check if everything worked by typing <code>"amule -v"</code> and check if the displayed version corresponds with the one you were compiling/installing.
+
= Build from repository export =
 +
If your aMule source doesn't come with a configure script you have a direct export from the development repository. To set up configure you need to run ./autogen.sh first. You need additional packages:
  
If this HowTo didn't help, you have a rare problem on your system ;-) Take a look at http://www.amule.org (aMule Forums at http://forum.amule.org ) or visit us in #amule on irc.freenode.net and (don't doubt) we'll try to do our best to help you.
+
*autoconf
 +
*cvs (only versions before Maverick)

Latest revision as of 20:30, 26 May 2011

This page describes how to compile aMule and its required libraries CryptoPP and wxWidgets on Ubuntu 9.04. We will install everything in our home directory in this example. Make a directory where you want to build and install aMule (we will use /home/me/amule and I'll call it "amule").

Install packages

Use Synaptic Package Manager (if you use GNOME) or KPackageKit/Adept (if you use KDE) to install the following packages:

  • g++
  • binutils-dev
  • libcrypto++-dev
  • libgtk2.0-dev
  • libgd2-xpm-dev
  • libgeoip-dev
  • libupnp3-dev
  • zlib1g-dev
  • autopoint (only Maverick and above)

Build CryptoPP

You shouldn't try to build CryptoPP on Ubuntu from source. The original CryptoPP headers are broken and cause a zillion warnings later building aMule. The Ubuntu developers provide fixed headers so you should use the lib that comes with it. However you should also install the cryptest tool and verify if CryptoPP really runs on your machine:

sudo apt-get install libcrypto++-utils

cd /usr/share/crypto++

cryptest v

If you still want to build it, download CryptoPP 5.6.1. Unzip it to /home/me/amule/cryptopp . Run make. Then run ./cryptest.exe v to validate it (it must print All tests passed!).

Build wxWidgets

Make directory amule/wx. Download latest stable wxGTK (2.8.12 writing this). Wx 2.9 is still experimental, if you feel adventurous you can try it (but only with aMule 2.3).

Extract it with tar xzf wxGTK-2.8.12.tar.gz. Make and cd to wx/build and run

../wxGTK-2.8.12/configure --with-gtk --without-libtiff --without-subdirs --enable-unicode --enable-optimise

then make . Do not make install !

Once Ubuntu starts shipping wx 2.8.12 you can also simply install libwxgtk2.8-dev . Older versions can cause out-of-memory crashes and should be avoided!

Build aMule

Make dir and download and unpack aMule's source (Release or current SVN), then

./configure --prefix=/home/me/amule/bin --enable-debug --enable-optimize --with-denoise-level=3 --enable-upnp --enable-geoip --enable-nls --enable-amule-gui --enable-amule-daemon --enable-amulecmd --enable-webserver --enable-alcc --enable-alc --enable-cas --enable-wxcas --enable-mmap --with-wxdir=/home/me/amule/wx/build --with-crypto-prefix=/home/me/amule/cryptopp

Leave out the --with-crypto-prefix when using the Ubuntu CryptoPP. Also leave out the --enable-upnp if you don't need UPnP (that is if you are able to set up port forwarding in your router). Also leave out --with-wxdir when using libwxgtk2.8-dev .

Now just run make and make install and that's it! You can start aMule with command "/home/me/amule/bin/amule".

If you get an error undefined reference to symbol 'XGetWindowAttributes' add LIBS=-lX11 to ./configure .

Build from repository export

If your aMule source doesn't come with a configure script you have a direct export from the development repository. To set up configure you need to run ./autogen.sh first. You need additional packages:

  • autoconf
  • cvs (only versions before Maverick)