Difference between revisions of "HowTo compile on Solaris"

From AMule Project FAQ
Jump to: navigation, search
m (Removed Version Tag)
 
(56 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
<center>'''English''' | [[HowTo_compile_on_Solaris-de|Deutsch]]</center>
 
<center>'''English''' | [[HowTo_compile_on_Solaris-de|Deutsch]]</center>
  
'''Compiling [[aMule]]/[[aMuleWeb]] on [http://developers.sun.com/sxde/ Solaris Express (11 beta)] x86'''
+
<center>'''Compiling [[aMule]]/[[aMuleWeb]] on [http://www.sun.com/solaris Solaris 10 or 11 beta] x86'''</center>
  
*Install the [http://www.blastwave.org/pkg-get.php pkg-get] script from http://www.blastwave.org/pkg-get.php
+
Compiling [[aMule]]/[[aMuleWeb]] on [http://www.sun.com/solaris Solaris] x86 is not a straight-forward process. There are some issues, like [http://www.sun.com/solaris Solaris] having its own iconv and libintl libraries, its own make command, its own linker (ld) and assembler (as) commands, having a strange default PATH, not having by default some commands and libraries required or them being outdated and having different versions of some commands on different paths. This page is what I used to compile [[aMule]] starting from a fresh, just installed [http://www.sun.com/solaris Solaris] x86 OS. YMMV if you have installed other libraries or software.
  
*Use the [http://www.blastwave.org/pkg-get.php pkg-get] script to install some required libraries, which do not come with [http://www.sun.com/software/solaris Solaris]:
+
'''Solaris 11 only: Read this'''
 +
 
 +
It has been reported that under Solaris 11, aMule compiled fine using this compiler: http://pkg.openindiana.org/sfe/info/0/runtime%2Fgcc%404.6.2%2C5.11-0.151.1%3A20111222T011404Z more info can be obtained in this thread: http://forum.amule.org/index.php?topic=19412.0
 +
 
 +
'''Preliminaries'''
 +
 
 +
First of all, this guide assumes you are using bash as shell (included in solaris 10 and higher). Some steps might be different if you use a different shell.
 +
 
 +
'''Install wxGTK'''
 +
 
 +
*Set your path like this:
 +
PATH=/usr/sfw/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/ucb
 +
export $PATH
 +
 
 +
*Get the latest [[WxWidgets|wxGTK]] package from http://www.wxwidgets.org and compile it. Install it to ''/usr/local''.
 +
 
 +
Hint: this configure line worked for me: ./configure --enable-unicode --with-gtk=2
 +
 
 +
Note: blastwave has packages for wxGTK but they are outdated and will not work with [[aMule]].                                      
 +
*Symlink the [http://www.gnu.org GNU] utilities in ''/usr/sfw/bin'' to their "right" names (''gar=ar'', ''gld=ld'', ''gmake=make'', ''ggrep=grep'', ''gtar=tar'', ''granlib=ranlib'', etc...) somewhere in your path. I sym-linked them to their same directory (''/usr/sfw/bin''). Do not symlink gas to as, since it will not work when compiling cryptopp.
 +
 
 +
'''Install cryptopp'''
 +
 
 +
*Get the cryptopp library 5.5.2 from http://www.cryptopp.com/ compile it and install it to /usr/local. Do not use cryptopp 5.6.0, it will make aMule segfault when compiled (no idea why).
 +
Hint 1: To compile, just change to the folder and type gmake.
 +
Hint 2: To install cryptopp, just copy libcryptopp.a to /usr/local/lib and copy *.h to /usr/local/include/cryptopp
 +
 
 +
'''Install other misc needed software'''
 +
 
 +
*Install the [http://www.blastwave.org/jir/blastwave.fam pkgutil] script from http://www.blastwave.org/
 +
 
 +
*Use the [http://www.blastwave.org/jir/blastwave.fam pkgutil] script to install some required libraries, which do not come with [http://www.sun.com/software/solaris Solaris], or the versions which come will not work for [[aMule]]:
 
**autoconf
 
**autoconf
 
**automake
 
**automake
**flex (2.5.33 or newer)
+
**flex (flex_new, so it will be 2.5.33 or newer, don't forget to link /opt/csw/bin/flex_new to flex)
**gd
+
**libtool
**GNU gettext
+
**GNU sed (gsed)
 +
 
 +
Install them with:
 +
/opt/csw/bin/pkgutil -i autoconf automake flex_new libtool gsed
 +
 
 
These packages will install to ''/opt/csw'' tree
 
These packages will install to ''/opt/csw'' tree
  
*Set your path like this:
+
*Symlink the [http://www.gnu.org GNU] utilities in ''/opt/csw/bin'' to their "right" names (''gsed=sed'', ''gawk=awk'', ''flex_new=flex'', etc...) somewhere in your path. I sym-linked them to their same directory (''/opt/csw/bin'').
  PATH=/usr/local/bin:/opt/csw/bin:/usr/sfw/bin:/usr/bin
+
 
 +
'''Install GeoIP'''
  
 
*Set these environment variables:
 
*Set these environment variables:
  CPPFLAGS='-I/usr/local/include -I/opt/csw/include -I/usr/sfw/include'
+
PATH=/usr/local/bin:/opt/csw/bin:/usr/sfw/bin:/usr/bin:/usr/sbin
  LDFLAGS='-L/usr/local/lib -R/usr/local/lib -L/opt/csw/lib -R/opt/csw/lib -L/usr/sfw/lib -R/usr/sfw/lib'
+
CPPFLAGS='-I/usr/local/include -I/opt/csw/include -I/usr/sfw/include'
  LD_LIBRARY_PATH=/usr/local/lib:/opt/csw/lib:/usr/sfw/lib:/usr/lib
+
LDFLAGS='-L/usr/local/lib -R/usr/local/lib -L/opt/csw/lib -R/opt/csw/lib -L/usr/sfw/lib -R/usr/sfw/lib'
 +
LD_LIBRARY_PATH=/usr/local/lib:/opt/csw/lib:/usr/sfw/lib:/usr/lib
 +
export PATH CPPFLAGS LDFLAGS LD_LIBRARY_PATH
  
*Symlink the [http://www.gnu.org GNU] utilities in ''/usr/sfw/bin'' to their "right" names (''gar=ar'', ''gas=as'', ''gld=ld'', ''gmake=make'', ''ggrep=grep'', ''gtar=tar'', etc...) somewhere in your path. I sym-linked them to their same directory (''/usr/sfw/bin'').
 
 
*Get the latest [[WxWidgets|wxGTK]] package from http://www.wxwidgets.org and compile it. Install it to ''/usr/local''.
 
  Note: blastwave has packages for wxGTK that are usually up to date, however they do not work with aMule because they are not compiled with Unicode
 
  support, which is required.
 
                                     
 
 
*Get the latest GeoIP source code from http://www.maxmind.com/app/c compile it and install it to /usr/local.
 
*Get the latest GeoIP source code from http://www.maxmind.com/app/c compile it and install it to /usr/local.
 +
Hint: this configure line worked for me: ./configure
 +
 +
'''Install gd'''
 +
 +
*Get the latest gd source code from http://www.libgd.org/ compile it and install it to /usr/local.
 +
Hint: this configure line worked for me: ./configure
 +
 +
'''Install libUPnP'''
  
 
*Get the latest libUPnP source code from http://pupnp.sourceforge.net/ compile it and install it to /usr/local.
 
*Get the latest libUPnP source code from http://pupnp.sourceforge.net/ compile it and install it to /usr/local.
  Hint: this configure line worked for me: ./configure CFLAGS="-DSPARC_SOLARIS" --disable-samples
+
Hint 1: this configure line worked for me: ./configure CFLAGS="-DSPARC_SOLARIS" --disable-samples
 +
Hint 2: I needed to add this at the beginning of the file upnp/src/api/upnpapi.c, along with the other #include lines:
 +
 +
#include <sys/sockio.h>
  
*Get the latest cryptopp library from http://www.cryptopp.com/ compile it and install it to /usr/local.
+
'''Install [[aMule]]'''
  Note: This step was necessary for me, since the embedded cryptopp produced an unusable aMule binary file. However, this may be due to some error on my
+
  [http://www.sun.com/software/solaris solaris] install.
+
  
*Get the latest [[aMule CVS]] from http://amule.hirnriss.net and uncompress it somewhere.
+
*Get the latest [[aMule]] from http://www.amule.org and uncompress it somewhere.
  
 
*If you are compiling a SVN version of aMule, run the autogen.sh script. If not, ignore this step (you should first edit this file, and change the first line from ''#!/bin/sh'' to ''#!/bin/bash'' else, it will fail with an error.
 
*If you are compiling a SVN version of aMule, run the autogen.sh script. If not, ignore this step (you should first edit this file, and change the first line from ''#!/bin/sh'' to ''#!/bin/bash'' else, it will fail with an error.
  
 
*Configure [[aMule]]. I used these options, but feel free to remove the ones you don't need:
 
*Configure [[aMule]]. I used these options, but feel free to remove the ones you don't need:
  ./configure --enable-webserver --enable-amule-daemon --enable-amulecmd --enable-amule-gui --enable-cas --enable-wxcas --enable-alc --enable-alcc
+
./configure --enable-webserver --enable-amule-daemon --enable-amulecmd --enable-amule-gui --enable-cas --enable-wxcas --enable-alc --enable-alcc
  --disable-embedded-crypto --with-crypto-prefix=/usr/local/ --enable-geoip --enable-optimize --disable-debug
+
--disable-embedded-crypto --with-crypto-prefix=/usr/local/ --enable-geoip --enable-optimize --disable-debug --with-libupnp-prefix=/usr/local
  
 
*Type ''gmake'', press <ENTER> and hope for the best.
 
*Type ''gmake'', press <ENTER> and hope for the best.
Line 52: Line 93:
 
*ENJOY!
 
*ENJOY!
  
This guide was used for compiling [[aMule]] and [[aMuleWeb]] on [http://developers.sun.com/sxde/ Solaris Express] for x86. I have no idea if it will work or not on previous [http://www.sun.com/software/solaris Solaris] releases or on [http://www.sun.com/processors/ SPARC], but it should. Also, if you got [[aMule]] compiled using other [http://www.sun.com/software/solaris Solaris] than [http://developers.sun.com/sxde/ Solaris Express (11 beta)], please tell me how you did, or if this guide worked for you or any extra things you had to do, etc.
+
This guide was used for compiling [[aMule]] and [[aMuleWeb]] on [http://www.sun.com/solaris Solaris 10 and 11 beta] for x86. I have no idea if it will work or not on previous [http://www.sun.com/software/solaris Solaris] releases or on [http://www.sun.com/processors/ SPARC], but it should. Also, if you got [[aMule]] compiled using other [http://www.sun.com/software/solaris Solaris] than [http://www.sun.com/solaris Solaris 10 or 11 beta], please tell me how you did, or if this guide worked for you or any extra things you had to do, etc.
 +
 
 +
The versions I used for this wiki (the last time I tried it) are:
 +
 
 +
aMule2.2.6, cryptopp 5.5.2, wxGTK 2.8.10, GeoIP 1.4.6, gd 2.0.35 and libupnp 1.6.6.
  
 
Last, but not least, this guide works '''only''' for [[aMule]] versions (either SVN or release) starting March 7th/2005, no previous [[aMule]] version will compile on [http://www.sun.com/software/solaris Solaris] following this guide.
 
Last, but not least, this guide works '''only''' for [[aMule]] versions (either SVN or release) starting March 7th/2005, no previous [[aMule]] version will compile on [http://www.sun.com/software/solaris Solaris] following this guide.
  
 
Thanks goes to all the [[aMule devs|aMule dev team]], specially [[User:Kry|Kry]], who helped me a lot, and [[User:ken|ken]] for the ''CPPFLAGS'' tip.
 
Thanks goes to all the [[aMule devs|aMule dev team]], specially [[User:Kry|Kry]], who helped me a lot, and [[User:ken|ken]] for the ''CPPFLAGS'' tip.

Latest revision as of 05:08, 27 February 2012

English | Deutsch
Compiling aMule/aMuleWeb on Solaris 10 or 11 beta x86

Compiling aMule/aMuleWeb on Solaris x86 is not a straight-forward process. There are some issues, like Solaris having its own iconv and libintl libraries, its own make command, its own linker (ld) and assembler (as) commands, having a strange default PATH, not having by default some commands and libraries required or them being outdated and having different versions of some commands on different paths. This page is what I used to compile aMule starting from a fresh, just installed Solaris x86 OS. YMMV if you have installed other libraries or software.

Solaris 11 only: Read this

It has been reported that under Solaris 11, aMule compiled fine using this compiler: http://pkg.openindiana.org/sfe/info/0/runtime%2Fgcc%404.6.2%2C5.11-0.151.1%3A20111222T011404Z more info can be obtained in this thread: http://forum.amule.org/index.php?topic=19412.0

Preliminaries

First of all, this guide assumes you are using bash as shell (included in solaris 10 and higher). Some steps might be different if you use a different shell.

Install wxGTK

  • Set your path like this:
PATH=/usr/sfw/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/ucb
export $PATH
Hint: this configure line worked for me: ./configure --enable-unicode --with-gtk=2
Note: blastwave has packages for wxGTK but they are outdated and will not work with aMule.                                       
  • Symlink the GNU utilities in /usr/sfw/bin to their "right" names (gar=ar, gld=ld, gmake=make, ggrep=grep, gtar=tar, granlib=ranlib, etc...) somewhere in your path. I sym-linked them to their same directory (/usr/sfw/bin). Do not symlink gas to as, since it will not work when compiling cryptopp.

Install cryptopp

  • Get the cryptopp library 5.5.2 from http://www.cryptopp.com/ compile it and install it to /usr/local. Do not use cryptopp 5.6.0, it will make aMule segfault when compiled (no idea why).
Hint 1: To compile, just change to the folder and type gmake.
Hint 2: To install cryptopp, just copy libcryptopp.a to /usr/local/lib and copy *.h to /usr/local/include/cryptopp

Install other misc needed software

  • Use the pkgutil script to install some required libraries, which do not come with Solaris, or the versions which come will not work for aMule:
    • autoconf
    • automake
    • flex (flex_new, so it will be 2.5.33 or newer, don't forget to link /opt/csw/bin/flex_new to flex)
    • libtool
    • GNU sed (gsed)

Install them with:

/opt/csw/bin/pkgutil -i autoconf automake flex_new libtool gsed

These packages will install to /opt/csw tree

  • Symlink the GNU utilities in /opt/csw/bin to their "right" names (gsed=sed, gawk=awk, flex_new=flex, etc...) somewhere in your path. I sym-linked them to their same directory (/opt/csw/bin).

Install GeoIP

  • Set these environment variables:
PATH=/usr/local/bin:/opt/csw/bin:/usr/sfw/bin:/usr/bin:/usr/sbin
CPPFLAGS='-I/usr/local/include -I/opt/csw/include -I/usr/sfw/include'
LDFLAGS='-L/usr/local/lib -R/usr/local/lib -L/opt/csw/lib -R/opt/csw/lib -L/usr/sfw/lib -R/usr/sfw/lib'
LD_LIBRARY_PATH=/usr/local/lib:/opt/csw/lib:/usr/sfw/lib:/usr/lib
export PATH CPPFLAGS LDFLAGS LD_LIBRARY_PATH
Hint: this configure line worked for me: ./configure

Install gd

Hint: this configure line worked for me: ./configure

Install libUPnP

Hint 1: this configure line worked for me: ./configure CFLAGS="-DSPARC_SOLARIS" --disable-samples
Hint 2: I needed to add this at the beginning of the file upnp/src/api/upnpapi.c, along with the other #include lines:

#include <sys/sockio.h>

Install aMule

  • If you are compiling a SVN version of aMule, run the autogen.sh script. If not, ignore this step (you should first edit this file, and change the first line from #!/bin/sh to #!/bin/bash else, it will fail with an error.
  • Configure aMule. I used these options, but feel free to remove the ones you don't need:
./configure --enable-webserver --enable-amule-daemon --enable-amulecmd --enable-amule-gui --enable-cas --enable-wxcas --enable-alc --enable-alcc
--disable-embedded-crypto --with-crypto-prefix=/usr/local/ --enable-geoip --enable-optimize --disable-debug --with-libupnp-prefix=/usr/local
  • Type gmake, press <ENTER> and hope for the best.
  • If compilation went OK, install aMule with: gmake install.
  • ENJOY!

This guide was used for compiling aMule and aMuleWeb on Solaris 10 and 11 beta for x86. I have no idea if it will work or not on previous Solaris releases or on SPARC, but it should. Also, if you got aMule compiled using other Solaris than Solaris 10 or 11 beta, please tell me how you did, or if this guide worked for you or any extra things you had to do, etc.

The versions I used for this wiki (the last time I tried it) are:

aMule2.2.6, cryptopp 5.5.2, wxGTK 2.8.10, GeoIP 1.4.6, gd 2.0.35 and libupnp 1.6.6.

Last, but not least, this guide works only for aMule versions (either SVN or release) starting March 7th/2005, no previous aMule version will compile on Solaris following this guide.

Thanks goes to all the aMule dev team, specially Kry, who helped me a lot, and ken for the CPPFLAGS tip.