Installing ZM from source

Support and queries relating to all previous versions of ZoneMinder
Locked
riik
Posts: 11
Joined: Sat Dec 31, 2005 11:18 am

Installing ZM from source

Post by riik »

Hi,
I can´´t start the zm service due to some perl issue.

It looks like this:Can't locate ZoneMinder.pm in @INC (@INC contains: /usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2 /usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl) at /usr/local/bin/zmpkg.pl line 45.
BEGIN failed--compilation aborted at /usr/local/bin/zmpkg.pl line 45.
ZoneMinder is stopped

The server has perl on two locations, /usr/lib/perl and in a local directory for another application. And it seems that , when compiling zm it is using that applications perl libs (which it probably should since that is the path I get if i do a: ' which perl' command.)
Need I say that the compilation reports "all well"

But, when I try to start zm the above error implicates that zm is using /usr/lib/perl ...


Any clues?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Assuming you have actually installed ZM, then my guess would be that the root user and the build user have different paths and so pick up your two different versions of perl. Is this possible?
Phil
keyboardgnome
Posts: 63
Joined: Sat Apr 08, 2006 10:18 pm

Post by keyboardgnome »

I've also noticed that the configure script allows you to go right thought without erroring out on missing libs. Check to make sure you're not missing anything again my running 'make clean; ./configure' again; atleast paste the output for it here with the username you're compiling with. If you get any errors/warnings for the perl modules, use

perl -MCPAN -e shell

and simply type

install Some::Module

to install, for instance, a module named Some::Module. Replace Some::Module with the real module names that ./configure would complain about.
riik
Posts: 11
Joined: Sat Dec 31, 2005 11:18 am

Re:Installing ZM from source

Post by riik »

As I did compile zm as root and also try to run it as root I believe we can rule out different paths. Or am I wrong?
riik
Posts: 11
Joined: Sat Dec 31, 2005 11:18 am

Re:Installing ZM from source

Post by riik »

Ok, Here are the complete ./configure results. And as I said it is run as root:

ZoneMinder-1.22.0]# ./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
configure: WARNING: You can call configure with the --with-libarch option.
This tells configure where to find architecture specific libraries.
The default of 'lib' is usually ok but 64 bit machines may require lib64.
e.g. --with-libarch=lib or --with-libarch=lib64
configure: WARNING: You can call configure with the --with-mysql option.
This tells configure where to find the MySql C library and headers if configure cannot
locate them automatically.
e.g. --with-mysql=/usr/local or --with-mysql=/usr
configure: WARNING: You can call configure with the --with-ffmpeg option.
This tells configure where to find the ffmpeg root directory within which are the libavcodec
and libavformat files that can be used to build true MPEG streaming into ZoneMinder. Ensure that
your copy of ffmpeg has installed libraries as well as binaries (use 'make installlib'). If you
are using a local install of ffmpeg you may have to remove or rename a previous real installation
as the headers and libraries from that will probably be picked up before your local copy.
e.g. --with-ffmpeg=/usr/local
configure: WARNING: You can call configure with the --with-extralibs option.
Ordinarily you will need to use this option only when your copy of ffmpeg has been built
with support for additional formats and you would use this option to detail which additional
libraries ffmpeg was built with so that it is able to link successfully with ZoneMinder.
You will need to wrap this option in quotes if it contains any spaces.
e.g. --with-extralibs="-lmp3lame"
configure: WARNING: You can call configure with the --with-webuser option.
This tells configure what the user name of the web user is if it is not the default of 'apache'.
e.g. --with-webuser=apache or --with-webuser=web
configure: WARNING: You can call configure with the --with-webgroup option.
This tells configure what the group name of the web group is if it is not the default of 'apache'.
e.g. --with-webgroup=apache or --with-webgroup=web
configure: WARNING: You can call configure with the --enable-debug=<yes|no> or --disable-debug option.
This tells configure whether to compile ZoneMinder with debug included. Although debug is included
by default it is not output unless explicitly switched on elsewhere. These checks may induce a
small penalty on performance and if you are after squeezing the maximum possible performance out
of ZoneMinder you may use this switch to prevent debug from being compiled in.
e.g. --enable-debug=yes or --disable-debug
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking whether make sets $(MAKE)... (cached) yes
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking how to run the C++ preprocessor... g++ -E
checking mysql/mysql.h usability... yes
checking mysql/mysql.h presence... yes
checking for mysql/mysql.h... yes
checking pcre/pcre.h usability... no
checking pcre/pcre.h presence... no
checking for pcre/pcre.h... no
checking pcre.h usability... no
checking pcre.h presence... no
checking for pcre.h... no
checking whether round is declared... yes
checking whether strsignal is declared... yes
checking whether MD5 is declared... yes
checking for jpeg_start_compress in -ljpeg... yes
checking for compress in -lz... yes
checking for dlsym in -ldl... yes
checking for mysql_init in -lmysqlclient... yes
checking for MD5 in -lcrypto... yes
checking for pcre_compile in -lpcre... no
configure: WARNING: libpcre.a may be required for remote/network camera support
checking for ff_gcd in -lavutil... yes
checking for avcodec_init in -lavcodec... yes
checking for av_new_stream in -lavformat... yes
checking for perl... perl
checking for perl version greater than or equal to 5.6.0... ok
checking for perl module Sys::Syslog... ok
checking for perl module DBI... ok
checking for perl module DBD::mysql... ok
checking for perl module Getopt::Long... ok
checking for perl module Time::HiRes... ok
checking for perl module Date::Manip... ok
checking for perl module LWP::UserAgent... ok
checking for perl module Device::SerialPort... ok
checking for perl module Net::FTP... ok
checking for perl module Archive::Tar... ok
checking for perl module Archive::Zip... ok
checking for perl module Net::SMTP... ok
checking for perl module MIME::Lite... no
configure: WARNING: MIME::Lite may be required for automatic event email notification
checking for perl module MIME::Entity... no
configure: WARNING: MIME::Entity may be required for automatic event email notification
checking for perl module X10::ActiveHome... no
configure: WARNING: X10::ActiveHome is required for X.10 support
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating web/Makefile
config.status: creating web/graphics/Makefile
config.status: creating scripts/Makefile
config.status: creating db/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating web/Makefile
config.status: creating web/graphics/Makefile
config.status: creating scripts/Makefile
config.status: creating db/Makefile
config.status: creating zm.conf
config.status: creating src/zm_config.h
config.status: creating web/zm_config.php
config.status: creating scripts/zm
config.status: creating db/zm_create.sql
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating web/Makefile
config.status: creating web/graphics/Makefile
config.status: creating scripts/Makefile
config.status: creating db/Makefile
config.status: creating zm.conf
config.status: creating src/zm_config.h
config.status: creating web/zm_config.php
config.status: creating scripts/zm
config.status: creating db/zm_create.sql
config.status: creating scripts/ZoneMinder/lib/ZoneMinder/Base.pm
config.status: creating scripts/ZoneMinder/lib/ZoneMinder/Config.pm
config.status: creating scripts/ZoneMinder/lib/ZoneMinder/ConfigAdmin.pm
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
checking for scripts/ZoneMinder/Makefile... no
Checking if your kit is complete...
Looks good
Writing Makefile for ZoneMinder

Thanks!

Regards
riik
Posts: 11
Joined: Sat Dec 31, 2005 11:18 am

perl is the problem

Post by riik »

I realize that not all the modules are existent, but this should not generate the above error.

The problem is that somehow the compiled ZM does not find all modules that the ZM compilation have put in various places, some of them under the other applikations perl5/libs.

I have tried to set PERL5LIB at boot and when I do a :perl -V i get the "std lib path" and in @INC that new path and the other applications perl5 lib path exists. I ran make clean and a new ./configure, make and make install but zmpkg.pm still fail to find things:
looks like this now:
[root@viking2 ~]# zmpkg.pl start
Can't load '/usr/local/AppX/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI/DBI.so' for module DBI: /usr/local/AppX/lib/perl5/site_perl/5.8.7/i686-linux/auto/DBI/DBI.so: undefined symbol: PL_dowarn at /usr/lib/perl5/5.8.5/i386-linux-thread-multi/DynaLoader.pm line 230.
at /usr/local/AppX/lib/perl5/site_perl/5.8.7/i686-linux/DBI.pm line 254
BEGIN failed--compilation aborted at /usr/local/AppX/lib/perl5/site_perl/5.8.7/i686-linux/DBI.pm line 254.
Compilation failed in require at /usr/local/AppX/lib/perl5/site_perl/5.8.7/ZoneMinder/Config.pm line 87.
BEGIN failed--compilation aborted at /usr/local/AppX/lib/perl5/site_perl/5.8.7/ZoneMinder/Config.pm line 87.
Compilation failed in require at /usr/local/AppX/lib/perl5/site_perl/5.8.7/ZoneMinder.pm line 33.
BEGIN failed--compilation aborted at /usr/local/AppX/lib/perl5/site_perl/5.8.7/ZoneMinder.pm line 33.
Compilation failed in require at /usr/local/bin/zmpkg.pl line 46.
BEGIN failed--compilation aborted at /usr/local/bin/zmpkg.pl line 46.
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

If a module is optional then configure will not stop. So you installed modules look ok. However an error is generated when ZM tries to use one (configure just checks for it's existence) so it looks like your installation of perl is a bit broken.

If you create a simple perl script like

Code: Select all

#!/usr/bin/perl -w

use strict;

use DBI;
and then run it, what do you get?
Phil
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

You should not run zm as root.

Cheers,
Corey
riik
Posts: 11
Joined: Sat Dec 31, 2005 11:18 am

Perl broken

Post by riik »

Hi, Eastern got in the way,
Anyway,
I tried to run in a test.pl:


#!/usr/bin/perl -w

use strict;

use DBI;

And it returns:
./test.pl
./test.pl: line 4: use: command not found
./test.pl: line 6: use: command not found

I tried to create a new installation of the application who has its own perl on another machine in order to remove it on and get around this issue but that new installation gets the default perl as default and because of that that application won´t work.

So Perl installation is turning out to be a real pain in the b-t.

In addition, uninstalling the distributions perl will render uninstallation of half of everything else installed by the OS installation.

I realize that the initial ZM related topic really is Perl only but I have googled a lot and there are thousends of pages discussing how to add Perl modules from different paths.

It would be nice if some Perl guru could point to a "how to configure Perl environment and @INC variables so they match ...yagedijack. I have to get the other application up and running on the new server before I can pick ZM up.

Regards

Rikard
Locked