Documents Download Building Support Wiki Stuff |
Main /
Building Opal on UnixThis page describes how to build Opal from revision 3.4.2 (Wolf) or later. For information on building earlier releases of Opal, see this page Contents
1. IntroductionOpal is built from source using If you want to install Opal into a shared location accessible by all users of the system (normally /usr/local), and you have root access, then you can use the default configure and install procedure Introduction described here. If you want do not want to install Opal into a shared location, because you do not have root access or because you want to have more than one version of Opal on the same host, then follow this procedure. 2. PrerequisitesYou will need the following:
For Ubuntu etc, there are the following optional packages: apt install libsrtp-dev libgsm1-dev libspeex-dev libopus-dev libavcodec-dev libx264-dev libvpx-dev libtheora-dev libspandsp-dev capiutils dahdi For CentOS, Fedora etc, use: yum install libsrtp-devel gsm-devel speex-devel opus-devel avcodec-devel x264-devel libvpx-devel theora-devel libspandsp-devel capiutils dahdi To use the Cisco OpenH.264 library, download http://ciscobinary.openh264.org/libopenh264-1.8.0-linux64.4.so.bz2, unzip and rename it to /usr/local/lib/libopenh264.so 3. Default build and installBy default, Opal will install into the /usr/local tree. In order for other packages locate Opal, the directory /usr/local/lib/pkgconfig must be added to the search path for pkg-config. This is usually done by setting the PKG_CONFIG_PATH environment variable. It is also necessary to set the LD_LIBRARY_PATH environment variable so that programs can find the Opal libraries at link or run time. If you are using plugins, the PTLIBPLUGINDIR environment variable must be set to the location of the installed plugins. By default, this is /usr/local/lib/opal-a.b.c, where a.b.c is the version of PTlib being used. For the current revision of Wolf, this is /usr/local/lib/opal-3.4.2, but please check your installation as the version numbers may have changed. Note that the PTLib plugin path must also be included For bash/sh export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig export LD_LIBRARY_PATH=/usr/local/lib export PTLIBPLUGINDIR=/usr/local/lib/ptlib-x.y.z:/usr/local/lib/opal-a.b.c For tcsh/csh setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig setenv LD_LIBRARY_PATH /usr/local/lib setenv PTLIBPLUGINDIR /usr/local/lib/ptlib-x.y.z:/usr/local/lib/opal-a.b.c Use the following command to build and install the release version (optimised) as a shared library cd srcdir ./configure make sudo make install Use the following command to build and install the release version (optimised) as a static library cd srcdir ./configure --disable-shared make sudo make install Use the following command to build and install the debug version (includes debugging symbols) as a shared library cd srcdir ./configure --enable-debug make debug sudo make install Use the following command to build and install the debug version (includes debugging symbols) as a static library cd srcdir ./configure --enable-debug --disable-shared make debug sudo make install Multiple versions can be built in the same directory tree and installed separately 3. Build and use without installSet the OPALDIR environment variable to point to srcdir as follows. This allows other libraries that use Opal to find the code without using pkg-config. IMPORTANT: you must set the environment variable before executing the configure script or the system will get very confused. It is also necessary to set the LD_LIBRARY_PATH environment variable so that programs can find the Opal libraries at link or run time. The correct directory name depends on the host architecture: For Linux x86 32 bit ${OPALDIR}/lib_linux_x86 For Linux x86 64 bit ${OPALDIR}/lib_linux_x86_64 If you are using plugins, the PTLIBPLUGINDIR environment variable must be set to the location of the compiled plugins. This will be the same directory as used above for the LD_LIBRARY_PATH For bash/sh export OPALDIR=srcdir export LD_LIBRARY_PATH=/usr/local/lib:${PTLIBDIR}/linux_x86:${OPALDIR}/lib_linux_x86 export PTLIBPLUGINDIR=${PTLIBDIR}/lib_linux_x86:${OPALDIR}/lib_linux_x86 For tcsh/csh setenv OPALDIR srcdir setenv LD_LIBRARY_PATH /usr/local/lib:${PTLIBDIR}/linux_x86:${OPALDIR)/lib_linux_x86 setenv PTLIBPLUGINDIR ${PTLIBDIR}/lib_linux_x86:${OPALDIR}/lib_linux_x86 Once this is done, configure and build the appropriate version of the code using the same commands as described in section 3 above, but omit the sudo make install Note that it may be necessary to add /usr/local/lib to LD_LIBRARY_PATH and set PKG_CONFIG_PATH to /usr/local/lib/pkgconfig in order for other packages to be detected correctly. 4. Editing configure.ac, and running aclocal and autoconfIf you are developer, it may be necessary to modify the configure.ac file and regenerate the configure script using autoconf. The following message may appear configure.ac:5: error: possibly undefined macro: dnl If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. If this occurs, then you need to regnerate the aclocal.m4 file by running the following command: aclocal |