Compiling and Installing Yate from SVN on Debian

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Starting Yate)
(Compile the sources)
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  
Follow the steps bellow to install and compile the latest version of Yate from SVN source on Debian GNU/Linux 6.0 system.
+
Follow the steps below to install and compile the latest version of Yate from SVN source on Debian GNU/Linux 6.0 system.
  
 
===Prerequisites===
 
===Prerequisites===
 +
 +
====Prerequisites for compiling the core====
  
 
For fetching and building Yate from SVN you will need the following:
 
For fetching and building Yate from SVN you will need the following:
Line 26: Line 28:
  
 
:: ''configure: error: C++ compiler cannot create executables''
 
:: ''configure: error: C++ compiler cannot create executables''
:: Install package bellow to resolve this error.
+
:: Install package below to resolve this error.
  
 
  apt-get install build-essential
 
  apt-get install build-essential
Line 32: Line 34:
 
     build-essential dpkg-dev g++ g++-4.4 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl
 
     build-essential dpkg-dev g++ g++-4.4 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl
 
   libstdc++6-4.4-dev libtimedate-perl
 
   libstdc++6-4.4-dev libtimedate-perl
 +
 +
====Prerequisites libraries====
  
 
* Development libraries for all optional [[modules]] in Yate you want to compile like:
 
* Development libraries for all optional [[modules]] in Yate you want to compile like:
:*If you want to register users in a database you need libraries like [http://www.mysql.com/ MySQL] or [http://www.postgresql.org/ PostgreSQL].
+
 
:*[[H323 channel module]] - VoIP H.323 driver requires the [http://docs.yate.ro/wiki/OpenH323 OpenH323] Library.
+
:*If you want to register users in a database you need libraries like:
:*[[Fax Transfer Module]] - this module can transmit or receive a fax, is based on [http://soft-switch.org/ spandsp].
+
::* [http://www.mysql.com/ MySQL] library - used by [[MySQL| MySQL Module]].
 +
::* [http://www.postgresql.org/ PostgreSQL] - used by [[PostgreSQL| PostgreSQL Module]].
 +
:* [http://docs.yate.ro/wiki/OpenH323 OpenH323] Library - used by [[H323 channel module]].
 +
:* [http://soft-switch.org/ spandsp] used by [[Fax Transfer Module]] - to transmit or receive a fax
 
: Read more about them and others in [[modules]] page.
 
: Read more about them and others in [[modules]] page.
  
Line 79: Line 86:
 
   g++ -Wall  -I.. -I.. -O2 -fno-check-new  -fno-exceptions -fPIC -DHAVE_GCC_FORMAT_CHECK -DHAVE_BLOCK_RETURN  -c HashList.cpp
 
   g++ -Wall  -I.. -I.. -O2 -fno-check-new  -fno-exceptions -fPIC -DHAVE_GCC_FORMAT_CHECK -DHAVE_BLOCK_RETURN  -c HashList.cpp
 
   ........
 
   ........
 +
 +
Once the sources are compiled into binaries you may run them in place but this way is not recommended. Instead you should install them in your system.
 +
 +
Installing will need that you become root and execute this command:
 +
 +
make install-noapi
 +
 +
At the end of this stage all Yate binaries and support files are installed in various subdirectories under the /usr/local subdirectory. You may change that from the configure options but it's not recommended - you should keep the programs you compiled yourself separate from the system provided ones.
 +
 +
If you used '''make install''' and got an error then you probably don't have kdoc or doxygen package.
 +
 +
''make: *** [install-api] Error 1''
 +
 +
You can install package or use '''make install-noapi''' instead.
 +
Kdoc or doxygen is necessary just for documentation so you may skip that.
  
 
===Starting Yate===
 
===Starting Yate===
  
Check version of Yate:
+
Check version of Yate from the directory where you build Yate:
  
 
  ./run -V
 
  ./run -V
Line 89: Line 111:
 
Start Yate:
 
Start Yate:
  
  ./run -vvvvvv -CDo
+
  ./run -vvvvv -CDo
 
  ...
 
  ...
 
  Yate engine is initialized and starting up on debian
 
  Yate engine is initialized and starting up on debian
 
  ...
 
  ...
 +
 +
To run Yate outside your build dir you need to set LD_LIBRARY_PATH so Yate can find libyate.so
 +
 +
echo "/usr/local/lib" >> /etc/ld.so.conf
 +
ldconfig
 +
 +
===Service installation===
 +
 +
If you will run Yate as server you will need some extra steps so Yate will start automatically when your server starts.
 +
 +
==== Prepare the init script====
 +
 +
You need to copy and rename the proper '''yate.init''' from a subdirectory of packing/ to '''/etc/init.d''' where all service start scripts are installed.
 +
 +
Info: You may edit the init/upstart file to point to the correct path (/usr/bin -> /usr/local/bin ).
 +
 +
This operation needs that you run as root:
 +
 +
cd /usr/src/yate
 +
cp packing/deb/yate.init /etc/init.d/yate
 +
chown root.root /etc/init.d/yate
 +
 +
You will then need to edit the init file and change the path to the executable from /usr/bin to /usr/local/bin.
 +
 +
====Set the service script to start automatically====
 +
 +
update-rc.d yate defaults
 +
 +
====Start the service manually====
 +
 +
Unless you are going to reboot the server you need to do the following once as root:
 +
 +
  service yate restart
 +
  Restarting YATE: yate.
 +
 +
As a general note, use restart instead of start to avoid accidentally running multiple instances.
 +
 +
For testing the status:
 +
 +
service yate status
 +
YATE is running (pid 1848).
 +
 +
====Stopping the service manually====
 +
 +
service yate stop
 +
 +
Test :
 +
 +
service yate status
 +
YATE is not running ... failed!
 +
 +
==== Disabling the service ====
 +
 +
If you want to disable the service you need to disable autostart and also stop it manually:
 +
 +
update-rc.d -f yate remove
 +
service yate stop
 +
 +
===Configuration files in Yate===
  
 
Next step will be to learn more about [[Configuration Files|configuration files]] and the [[modules]] and [[routing]] to configure Yate for your needs.
 
Next step will be to learn more about [[Configuration Files|configuration files]] and the [[modules]] and [[routing]] to configure Yate for your needs.
Line 101: Line 182:
 
*[[Starting Yate]]
 
*[[Starting Yate]]
 
*[[Stopping and restarting Yate]]
 
*[[Stopping and restarting Yate]]
 +
 +
[[Category:Install]] [[Category:Debian]]

Latest revision as of 14:10, 30 January 2014

Follow the steps below to install and compile the latest version of Yate from SVN source on Debian GNU/Linux 6.0 system.

Contents

[edit] Prerequisites

[edit] Prerequisites for compiling the core

For fetching and building Yate from SVN you will need the following:

  • A subversion(svn) client to fetch Yate from SVN source.
apt-get install subversion
The following NEW packages will be installed:
    libapr1 libaprutil1 libserf-0-0 libsvn1 subversion
  • Basic software development tools:
  • The autoconf configuration script builder. After fetching Yate you will have to run autogen.sh to generate the configure file, but if autoconf is missing, an error will be given:
Please install Gnu autoconf to build from CVS.
apt-get install autoconf
The following NEW packages will be installed:
    autoconf automake autotools-dev
When running ./configure, this error will be given to you :
configure: error: C++ compiler cannot create executables
Install package below to resolve this error.
apt-get install build-essential
The following NEW packages will be installed:
    build-essential dpkg-dev g++ g++-4.4 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libdpkg-perl
 libstdc++6-4.4-dev libtimedate-perl

[edit] Prerequisites libraries

  • Development libraries for all optional modules in Yate you want to compile like:
  • If you want to register users in a database you need libraries like:
Read more about them and others in modules page.

[edit] Get the sources

Once you have the svn client installed getting the sources is a simple command:

cd /usr/src
svn checkout http://voip.null.ro/svn/yate/trunk yate
cd yate

This will fetch a copy of the SVN TRUNK in a new directory called yate.

[edit] Prepare and configure the sources

Run autogen.sh script to generate the configure file.

./autogen.sh
Finished! Now run configure. If in doubt run ./configure --help

This script will warn if autoconf is missing and will prepare a configure script for you if everything is OK.

You can now run the configure script:

./configure
checking for local operating system type... Linux
checking for libraries directory name... lib
checking for g++... g++
...

Look at the configure output and check that all features you need are detected. If not, install what is missing.

[edit] Compile the sources

Use make command:

 make
 make -C ./engine all
 make[1]: Entering directory `/usr/src/yate/engine'
 g++ -Wall   -I.. -I.. -O2 -fno-check-new  -fno-exceptions -fPIC -DHAVE_GCC_FORMAT_CHECK -DHAVE_BLOCK_RETURN  -DATOMIC_OPS -c TelEngine.cpp
 g++ -Wall   -I.. -I.. -O2 -fno-check-new  -fno-exceptions -fPIC -DHAVE_GCC_FORMAT_CHECK -DHAVE_BLOCK_RETURN  -c ObjList.cpp
 g++ -Wall   -I.. -I.. -O2 -fno-check-new  -fno-exceptions -fPIC -DHAVE_GCC_FORMAT_CHECK -DHAVE_BLOCK_RETURN  -c HashList.cpp
 ........

Once the sources are compiled into binaries you may run them in place but this way is not recommended. Instead you should install them in your system.

Installing will need that you become root and execute this command:

make install-noapi

At the end of this stage all Yate binaries and support files are installed in various subdirectories under the /usr/local subdirectory. You may change that from the configure options but it's not recommended - you should keep the programs you compiled yourself separate from the system provided ones.

If you used make install and got an error then you probably don't have kdoc or doxygen package. 

make: *** [install-api] Error 1

You can install package or use make install-noapi instead. 
Kdoc or doxygen is necessary just for documentation so you may skip that.

[edit] Starting Yate

Check version of Yate from the directory where you build Yate:

./run -V
Yate 4.2.1 alpha1

Start Yate:

./run -vvvvv -CDo
...
Yate engine is initialized and starting up on debian
...

To run Yate outside your build dir you need to set LD_LIBRARY_PATH so Yate can find libyate.so

echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig

[edit] Service installation

If you will run Yate as server you will need some extra steps so Yate will start automatically when your server starts.

[edit] Prepare the init script

You need to copy and rename the proper yate.init from a subdirectory of packing/ to /etc/init.d where all service start scripts are installed.

Info: You may edit the init/upstart file to point to the correct path (/usr/bin -> /usr/local/bin ).

This operation needs that you run as root:

cd /usr/src/yate 
cp packing/deb/yate.init /etc/init.d/yate
chown root.root /etc/init.d/yate

You will then need to edit the init file and change the path to the executable from /usr/bin to /usr/local/bin.

[edit] Set the service script to start automatically

update-rc.d yate defaults

[edit] Start the service manually

Unless you are going to reboot the server you need to do the following once as root:

 service yate restart
 Restarting YATE: yate.

As a general note, use restart instead of start to avoid accidentally running multiple instances.

For testing the status:

service yate status
YATE is running (pid 1848).

[edit] Stopping the service manually

service yate stop

Test :

service yate status
YATE is not running ... failed!

[edit] Disabling the service

If you want to disable the service you need to disable autostart and also stop it manually:

update-rc.d -f yate remove
service yate stop

[edit] Configuration files in Yate

Next step will be to learn more about configuration files and the modules and routing to configure Yate for your needs.


See also

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers