Linux Build Instructions ======================== The Easy Way: ------------- Atomic Labs has a tarball available from the "Third Party Libraries" page on our website that contains all of the required libraries to build Pion for certain versions of Redhat Linux. To get started quickly, just download and uncompress this file into your /usr/local/ directory, and you should be able to skip down to the last step! Building Boost with ASIO: ------------------------- Please see the README.boost file for instructions. If you have an older version of Boost (pre-1.35) already installed, you will likely will need to first uninstall it so that gcc and libtool do not get confused: # rpm -e boost boost-devel Installing zlib, bzlib & openssl: --------------------------------- Pion requires zlib, bzlib and openssl for compression and SSL/TLS encryption support, respectively. These libraries are normally pre-installed on Linux. If you do not have them already, you should be able to use your favorite package manager (yum, up2date or aptget) to install the latest versions: # yum install openssl openssl-devel zlib zlib-devel bzip2 bzip2-devel bzip2-libs # up2date openssl openssl-devel zlib zlib-devel bzip2 bzip2-devel bzip2-libs # apt-get install openssl openssl-devel zlib zlib-devel bzip2 bzip2-devel bzip2-libs Installing log4cxx: ------------------- Note that the use of a logging framework is entirely optional, so you may skip this step if you like. We recommend that you use log4cxx for logging. Log4cxx 0.10.0 and later requires that you have the Apache Portable Runtime (APR) installed. This library is normally pre-installed on Linux. If you do not have it already, you should be able to grab the latest version using your favorite package manager: # yum install apr apr-devel apr-util apr-util-devel # up2date apr apr-devel apr-util apr-util-devel # apt-get install apr apr-devel apr-util apr-util-devel For Redhat Enterprise and CentOS releases earlier than version 5, you will need to download and build the APR libraries from source since the available RPMs are incompatible with log4cxx. You can download the latest source code tarballs from the "Third Party Libraries" page on our website, or from the following site: http://apr.apache.org You will need to install both the "apr" and the "apr-util" packages. For each, just download the source and run: # bzip2 -dc apr-.tar.bz2 | tar xvf - # cd apr- # ./configure --prefix=/usr/local --enable-threads --with-apr=/usr/local # make all # make install After installing APR, please visit the "Third Party Libraries" page on our website to obtain a source code tarball. Then, just run: # tar xvfj log4cxx-.tar.bz2 # cd log4cxx- # ./configure # make all # make install The final linking stage of building log4cxx 0.10.0 fails for 64-bit versions of Redhat, apparently due to errors with the 64-bit libapr that it includes. If you encounter an error while performing the final link, try running the link_log4cxx.sh script included with Pion from your log4cxx source directory: # /common/build/link_log4cxx.sh If this works, you can complete the log4cxx installation manually by using the following commands: # mv src/main/cpp/.libs/liblog4cxx.so.10.0.0 /usr/local/lib # ln -s /usr/local/lib/liblog4cxx.so.10.0.0 /usr/local/lib/liblog4cxx.so.10 # ln -s /usr/local/lib/liblog4cxx.so.10.0.0 /usr/local/lib/liblog4cxx.so # mv src/main/include/log4cxx /usr/local/include Installing libxml2: ------------------- The Pion Platform requires the libxml2 development library for manipulating configuration files, and other things. This library is not used by the Pion Network Library, so you may skip this step if you are only building the Network Library. The libxml2 library is normally pre-installed on Linux. If you do not have it already, you should be able to grab the latest version using your favorite package manager: # yum install libxml2 libxml2-devel # up2date libxml2 libxml2-devel # apt-get install libxml2 libxml2-devel Installing OSSP uuid: --------------------- The Pion Platform requires the OSSP uuid library to generate universally unique identifiers for most platforms, including Linux. This library is not used by the Pion Network Library, so you may skip this step if you are only building the Network Library. You can download the source code tarball for the uuid library from the "Third Party Libraries" page on our website. After downloading it, just run: # tar xvfz uuid-.tar.gz # cd uuid- # ./configure # make all # make install Installing SQLite: ------------------ SQLite version 3 is required to build support for the embedded database (the SQLiteDatabase plugin). You may skip this step if you do not want to build support for the embedded database. SQLite is normally pre-installed on Linux. If you do not have it already, you should be able to grab the latest version using your favorite package manager: # yum install sqlite sqlite-devel # up2date sqlite sqlite-devel # apt-get install sqlite sqlite-devel Installing YAJL: ---------------- YAJL ("Yet Another JSON Library") is required to build support for the JSONCodec plugin. You may skip this step if you do not want to build support for JSON. To build YAJL, you must first have Ruby and CMake installed on your system. If you do not have them already, you should be able to grab the latest versions using your favorite package manager: # yum install ruby cmake # up2date ruby cmake # apt-get install ruby cmake You can download the source code tarball for YAJL from the "Third Party Libraries" page on our website. After downloading it, just run: # tar xvfz yajl-.tgz # cd yajl- # ./configure # make To install YAJL, we recommend that you just move the build files in the "build/yajl-" subdirectory into /usr/local: # sudo mv build/yajl-/lib/* /usr/local/lib # sudo mv build/yajl-/include/yajl /usr/local/include Building and installing Pion: ----------------------------- Now you should be able to build and install Pion: # tar xvfz pion--.tar.gz # cd pion-- # ./configure [--with-openssl] [--with-log4cxx] [--with-sqlite] [--with-yajl] # make all # make install To build and run Pion's unit tests, run "make check" Known Problems -------------- The Pion executables may complain about loading shared libraries if the Boost and/or other libraries are not in your search path. Try this: export LD_LIBRARY_PATH=/usr/local/lib