EMG 5.2.6+ and Perl plugins Print
Friday, 13 December 2013


EMG 5 includes support for plugins written in Perl thereby eliminating the need for developing and compiling C shared libraries.

From EMG 5.2.6 embedded perl is provided statically linked into the emgd binary. This has the advantage of avoiding the dependency towards libperl.so, which complicates EMG setup process, especially for customers not even planning to use Perl plugins. The drawback of this approach is that the default search paths for Perl modules will be compiled into emgd. This, more or less, introduces the requirement that Perl is setup identically on the customer server as the setup on the server where emgd was compiled if Perl plugins with dependencies on, for example, CPAN modules will be used.

Please note that if Perl plugins will not be used or for Perl plugins without the dependency of external/CPAN modules the steps below will not be necessary.

Installing Perl 5.12.2 from source

If possible, please use the precompiled distributions at the bottom of this page. Otherwise follow the insttructions below to install Perl 5.12.2 from source code.

  • Download Perl 5.12.2 from http://www.cpan.org/src/5.0/perl-5.12.2.tar.gz
  • Extract it, for example under "/tmp"
  • Configure, compile it and install it using "./Configure -Dcc=gcc -e -d -Dprefix=/opt/perl-5.12.2-emg -Duseithreads -Dusethreads -Duselargefiles && make && make test && make install"

This will put a Perl distribution with multi-thread capabilities (important for plugins with INSTANCES > 1) in the directory "/opt/perl-5.12.2-emg".

The "make install" part above most likely needs to be run as "root" unless "/opt" is writable as the current user. You may consider changing ownership of the directory structure to the user that emg will run as after installation, "chmod -R emg /opt/perl-5.12.2-emg".

Additional CPAN modules can then be installed from the CPAN shell by running "/opt/perl-5.12.2-emg/bin/perl -MCPAN -e shell".

Please note that this Perl installation will be completely separated from any other Perl installation which may already be in place on the server.

32-bit vs 64-bit

For EMG 5.4 and later there are 64-bit versions of EMG available and they must be used with Perl compiled on a 64-bit server (using procedure under "Installing Perl 5.12.2" above).

EMG 5.2 is a 32-bit application which will run just fine on 64-bit Linux as well. However, it will depend on Perl 5.12.2 32-bit and therefore Perl 5.12.2 cannot be compiled on a 64-bit Linux when used with EMG 5.2. So, if EMG 5.2 will be used and the target server is a 64-bit server, Perl 5.12.2 must be built on a 32-bit server and then transferred to the 64-bit server. For convenience we have made available a binary 32-bit Perl 5.12.2 distribution which can simply be extracted under "/opt" on the target server, 32-bit or 64-bit.

Pre-compiled Perl

The distributions must be extracted under "/opt" and will then create a directory "perl-5.12.2-emg".

Pre-compiled Perl 5.12.2 for Linux 32-bit (12 MB) »
Pre-compiled Perl 5.12.2 for Linux 64-bit (12 MB) »