Page 1 of 1

Notes to compile and install ZM 1.24.2 on openSuSE 11.2

Posted: Sat Feb 06, 2010 3:33 pm
by BlankMan
This is what I had to do to compile and install ZoneMinder 1.24.2 on openSuSE 11.2. Thought it might be helpful to others.

src/zm_ffmpeg_camera.cpp
add #include <errno>

src/zm_mpeg.cpp
add #include <errno>

zm_utils.cpp
add #include <cstdio>

Need packman ffmpeg install and packman libavutil, libavcodec, libavformat, & libswscale, then this needs to be done:

Code: Select all

In /usr/include/ffmpeg/ (create directory if not exist then cd to it)
        ln -s /usr/include/libavutil/avutil.h
                ln -s /usr/include/libavutil/common.h
                ln -s /usr/include/libavutil/mathematics.h
                ln -s /usr/include/libavutil/rational.h
                ln -s /usr/include/libavutil/intfloat_readwrite.h
                ln -s /usr/include/libavutil/log.h
                ln -s /usr/include/libavutil/pixfmt.h
                ln -s /usr/include/libavutil/mem.h
        ln -s /usr/include/libavcodec/avcodec.h
        ln -s /usr/include/libavformat/avformat.h
                ln -s /usr/include/libavformat/avio.h
        ln -s /usr/include/libswscale/swscale.h

In /usr/include/pcre/   (create directory if not exist then cd to it)
        ln -s /usr/include/pcre.h
I added

Code: Select all

php5-devel
php5-mcrypt
php5-openssl
php5-sockets
Not sure if all are needed think sockets is for sure but it doesn't hurt to half them all
This is the full list of php5 modules I have installed:

Code: Select all

php5                                                                                     
php5-iconv                                                                               
php5-hash                                                                                
php5-mysql                                                                               
php5-openssl                                                                             
php5-dom                                                                                 
php5-tokenizer                                                                           
php5-xmlwriter                                                                           
php5-json                                                                                
php5-xmlreader                                                                           
php5-mcrypt                                                                              
php5-ctype                                                                               
php5-devel                                                                               
php5-sqlite                                                                              
php5-pdo                                                                                 
php5-sockets
My configure command

Code: Select all

./configure --with-ffmpeg --with-libarch=lib64 --with-mysql=/usr --with-webdir=/srv/www/htdocs/ZM --with-cgidir=/srv/www/cgi-bin --with-webuser=wwwrun --with-webgroup=www --enable-crashtrace=no --enable-debug=yes --disable-mmap ZM_SSL_LIB=openssl --enable-sockets --with-extralibs="-lfaac -lmp3lame -logg -lvorbis -lamrnb -lamrwb"
once built and installed edit the zm/index.php
replace: error_reporting( E_ALL );
with : error_reporting( E_ALL ^ E_DEPRECATED );
to stop function deprecated messages in apache's error log

SuSE sets
kernel.shmmax = 18446744073709551615
kernel.shmall = 1152921504606846720
if you have trouble increasing "Source (actual device) -> Buffers -> Image Buffer Size (frames)" for a capture device cut those values in half they'll still be plenty big

Code: Select all

echo 9223372036854775807 > /proc/sys/kernel/shmall
echo 576460752303423360 > /proc/sys/kernel/shmmax
Then set it up to always set these values on boot

zmaudit.pl uses Perl find and it has a problem with some characters in filenames like colons and spaces so if there are any files in the /tmp tree that contain those characters zmaudit.pl will fail with an exit status 9 -- suggest using it's own unique location tmp space that Zoneminder will use (set in Options -> Path)

Code: Select all

mkdir /tmp/ZM 
chmod 1777 /tmp/ZM
This is documented, just have it here so I don't have to go looking for it
mysql> grant select,insert,update,delete on zm.* to 'zmuser'@localhost identified by 'zmpass' ;
Note: replace zmpass with your password

Don't start or stop ZoneMinder while cwd is the source directory where you compiled it, it will attempt to use the zm.conf file located there instead of the one in /usr/local/etc/zm.conf (if that's where your real one is. Also suggest you make acopy of your real one before doing a make install if you recompiled it and are re-installing it WILL be overwritten by the make install.)

Notes to compile and install ZM 1.24.2 on openSuSE 11.3

Posted: Tue Nov 02, 2010 7:20 am
by BlankMan
Just in case anyone is referencing this to compile on open SuSE 11.3.

For one don't create the /usr/include/ffmpeg/ and all the links in it as stated above and if you have created that directory and the links delete them and it when compiling on openSuSE 11.3. Especially of you see

Code: Select all

configure: WARNING: libavutil/avutil.h: present but cannot be compiled     
and this
configure: WARNING: ffmpeg/avutil.h: present but cannot be compiled
when you're running configure, and not just for this library for any and all of the ffmpeg libraries. It seems the libraries are now found in 11.3 whereas they weren't found in 11.2.

Then or if you get this

Code: Select all

configure: WARNING: libavutil/avutil.h: present but cannot be compiled
for this or any of the ffmpeg libraries when running configure, add this configure option

Code: Select all

CPPFLAGS="-D__STDC_CONSTANT_MACROS"
And then when doing the make if you see something like this

Code: Select all

zm_jpeg.h:39:85: error: declaration of C function ‘void jpeg_mem_src(jpeg_decompress_struct*, const JOCTET*, int)’ conflicts with /usr/include/jpeglib.h:959:14: error: previous declaration ‘void jpeg_mem_src(jpeg_decompress_struct*, unsigned char*, long unsigned int)’ here
zm_jpeg.h:40:81: error: declaration of C function ‘void jpeg_mem_dest(jpeg_compress_struct*, JOCTET*, int*)’ conflicts with
/usr/include/jpeglib.h:956:14: error: previous declaration ‘void jpeg_mem_dest(jpeg_compress_struct*, unsigned char**, long unsigned int*)’ here
for jpeg_mem_src or jpeg_mem_dest apply the gentoo patches found here

http://bugs.gentoo.org/attachment.cgi?i ... ction=view

Or here where I separated each into it's own patch file and tarball'd them

ZoneMinder openSuSE 11.3 patches

They're the same gentoo patches and these worked so just in case gentoo changes them...