Trouble with compiling on Fedora_18_64

Forum for questions and support relating to the 1.25.x releases only.
Locked
jHeron
Posts: 73
Joined: Sun Jun 16, 2013 5:06 pm

Trouble with compiling on Fedora_18_64

Post by jHeron »

I am trying to compile zm without much joy. I was having trouble with ffmpeg from yum in the begining so I uninstalled it and built it from source, it went well but it didn't help much...
It appears that the problem is ffmpeg but I am not sure what to do next, I am somewhat of a linux noob.
Here is my configure command:

Code: Select all

$ ./configure --with-webdir=/var/www/html/zm --with-cgidir=/var/www/cgi-bin --with-extralibs=-L/usr/lib64 -L/usr/lib64/mysql ZM_SSL_LIB=openssl --with-ffmpeg=-L/usr/local/lib -I/usr/local/include
Attached is the config and make logs, they are just text files but I had to add the tar extension to get them to upload.
Make is giving errors like this:

Code: Select all

In file included from zm_ffmpeg_camera.cpp:24:0:
zm_ffmpeg_camera.h:39:5: error: ‘AVFormatContext’ does not name a type
zm_ffmpeg_camera.h:41:5: error: ‘AVCodecContext’ does not name a type
zm_ffmpeg_camera.h:42:5: error: ‘AVCodec’ does not name a type
zm_ffmpeg_camera.h:44:5: error: ‘AVFrame’ does not name a type
zm_ffmpeg_camera.h:45:5: error: ‘AVFrame’ does not name a type
zm_ffmpeg_camera.cpp: In constructor ‘FfmpegCamera::FfmpegCamera(int, const string&, int, int, int, int, int, int, int, bool)’:
Etc..
Any advice guidance and/or assistance would be greatly appreciated!
Cheers,
Jon
Attachments
makeLog.tar
(18.12 KiB) Downloaded 169 times
config.tar
(125.24 KiB) Downloaded 177 times
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Re: Trouble with compiling on Fedora_18_64

Post by bb99 »

Try changing the FFMPEG to an older version: http://www.zoneminder.com/forums/viewto ... ame+a+type
jHeron
Posts: 73
Joined: Sun Jun 16, 2013 5:06 pm

Re: Trouble with compiling on Fedora_18_64

Post by jHeron »

Thanks!
I am using this box as my pvr too though, (mythtv) which also uses ffmpeg if I am not mistaken?
That thread is over a year old and there has been several updates to ffmpeg in that time....
Has anybody had any success building zm with a current ffmpeg?
OR Has anybody noticed any problems running the older version of ffmpeg?
Or perhaps I can compile it with the older version and then install the newer version once zm is built?
Thanks for the input!
Cheers,
Jon
jHeron
Posts: 73
Joined: Sun Jun 16, 2013 5:06 pm

Re: Trouble with compiling on Fedora_18_64

Post by jHeron »

I just tried it with ffmpeg ver 0.9.2 from here ffmpeg[dot]org/download.html#release_0.9 and it has the same errors in make....
Cheers,
Jon
CKrypto
Posts: 12
Joined: Mon Feb 18, 2013 8:57 pm

Re: Trouble with compiling on Fedora_18_64

Post by CKrypto »

I am running on Fedora 18 x64 and ran into the same issues. I compiled a bunch of different fixes into a patch:
diff -rupN a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp
--- a/src/zm_ffmpeg_camera.cpp 2013-05-13 12:33:58.236394833 -0400
+++ b/src/zm_ffmpeg_camera.cpp 2013-05-13 12:33:58.241394902 -0400
@@ -54,11 +54,11 @@ FfmpegCamera::~FfmpegCamera()
if ( mCodecContext )
{
avcodec_close( mCodecContext );
- mCodecContext = NULL; // Freed by av_close_input_file
+ mCodecContext = NULL; // Freed by avformat_close_input
}
if ( mFormatContext )
{
- av_close_input_file( mFormatContext );
+ avformat_close_input( &mFormatContext );
mFormatContext = NULL;
}

@@ -91,11 +91,11 @@ int FfmpegCamera::PrimeCapture()
Info( "Priming capture from %s", mPath.c_str() );

// Open the input, not necessarily a file
- if ( av_open_input_file( &mFormatContext, mPath.c_str(), NULL, 0, NULL ) !=0 )
+ if ( avformat_open_input( &mFormatContext, mPath.c_str(), NULL, NULL ) !=0 )
Fatal( "Unable to open input %s due to: %s", mPath.c_str(), strerror(errno) );

// Locate stream info from input
- if ( av_find_stream_info( mFormatContext ) < 0 )
+ if ( avformat_find_stream_info( mFormatContext, NULL ) < 0 )
Fatal( "Unable to find stream info from %s due to: %s", mPath.c_str(), strerror(errno) );

// Find first video stream present
@@ -122,7 +122,7 @@ int FfmpegCamera::PrimeCapture()
Fatal( "Can't find codec for video stream from %s", mPath.c_str() );

// Open the codec
- if ( avcodec_open( mCodecContext, mCodec ) < 0 )
+ if ( avcodec_open2( mCodecContext, mCodec, NULL ) < 0 )
Fatal( "Unable to open codec for video stream from %s", mPath.c_str() );

// Allocate space for the native video frame
diff -rupN a/src/zm_ffmpeg.h b/src/zm_ffmpeg.h
--- a/src/zm_ffmpeg.h 2013-05-13 12:33:58.265395234 -0400
+++ b/src/zm_ffmpeg.h 2013-05-13 12:33:58.269395289 -0400
@@ -26,17 +26,17 @@
extern "C" {
#endif
#if HAVE_LIBAVUTIL_AVUTIL_H
-#include <libavutil/avutil.h>
+#include <ffmpeg/libavutil/avutil.h>
#endif
#if HAVE_LIBAVCODEC_AVCODEC_H
-#include <libavcodec/avcodec.h>
+#include <ffmpeg/libavcodec/avcodec.h>
#endif
#if HAVE_LIBAVFORMAT_AVFORMAT_H
-#include <libavformat/avformat.h>
+#include <ffmpeg/libavformat/avformat.h>
#endif
#if HAVE_LIBSWSCALE
#if HAVE_LIBSWSCALE_SWSCALE_H
-#include <libswscale/swscale.h>
+#include <ffmpeg/libswscale/swscale.h>
#endif
#endif // HAVE_LIBSWSCALE
#ifdef __cplusplus
diff -rupN a/src/zm_local_camera.cpp b/src/zm_local_camera.cpp
--- a/src/zm_local_camera.cpp 2013-05-13 12:33:58.246394971 -0400
+++ b/src/zm_local_camera.cpp 2013-05-13 12:33:58.251395040 -0400
@@ -739,7 +739,8 @@ void LocalCamera::Terminate()
{
Debug( 3, "Terminating video stream" );
//enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- enum v4l2_buf_type type = v4l2_data.fmt.type;
+ //enum v4l2_buf_type type = v4l2_data.fmt.type;
+ enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type;
if ( vidioctl( vid_fd, VIDIOC_STREAMOFF, &type ) < 0 )
Error( "Failed to stop capture stream: %s", strerror(errno) );

@@ -1519,7 +1520,8 @@ int LocalCamera::PrimeCapture()

Debug( 3, "Starting video stream" );
//enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- enum v4l2_buf_type type = v4l2_data.fmt.type;
+ //enum v4l2_buf_type type = v4l2_data.fmt.type;
+ enum v4l2_buf_type type = (v4l2_buf_type)v4l2_data.fmt.type;
if ( vidioctl( vid_fd, VIDIOC_STREAMON, &type ) < 0 )
Fatal( "Failed to start capture stream: %s", strerror(errno) );
}
diff -rupN a/src/zm_mpeg.cpp b/src/zm_mpeg.cpp
--- a/src/zm_mpeg.cpp 2013-05-13 12:33:58.256395109 -0400
+++ b/src/zm_mpeg.cpp 2013-05-13 12:33:58.260395165 -0400
@@ -77,7 +77,8 @@ void VideoStream::SetupCodec( int colour
ost = NULL;
if (of->video_codec != CODEC_ID_NONE)
{
- ost = av_new_stream(ofc, 0);
+ ost = avformat_new_stream(ofc, NULL);
+ ost->id = 0;
if (!ost)
{
Panic( "Could not alloc stream" );
@@ -126,16 +127,6 @@ void VideoStream::SetupCodec( int colour
}
}

-void VideoStream::SetParameters()
-{
- /* set the output parameters (must be done even if no
- parameters). */
- if ( av_set_parameters(ofc, NULL) < 0 )
- {
- Panic( "Invalid output format parameters" );
- }
- //dump_format(ofc, 0, filename, 1);
-}

const char *VideoStream::MimeType() const
{
@@ -176,7 +167,7 @@ void VideoStream::OpenStream()
}

/* open the codec */
- if ( avcodec_open(c, codec) < 0 )
+ if ( avcodec_open2(c, codec, NULL) < 0 )
{
Panic( "Could not open codec" );
}
@@ -222,7 +213,7 @@ void VideoStream::OpenStream()
if ( !(of->flags & AVFMT_NOFILE) )
{
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1)
- if ( avio_open(&ofc->pb, filename, URL_WRONLY) < 0 )
+ if ( avio_open(&ofc->pb, filename, AVIO_FLAG_WRITE) < 0 )
#else
if ( url_fopen(&ofc->pb, filename, URL_WRONLY) < 0 )
#endif
@@ -241,7 +232,10 @@ void VideoStream::OpenStream()
}

/* write the stream header, if any */
- av_write_header(ofc);
+ if (avformat_write_header(ofc, NULL) < 0)
+ {
+ Panic( "Invalid output format parameters or unable to write header" );
+ }
}

VideoStream::VideoStream( const char *filename, const char *format, int bitrate, double frame_rate, int colours, int width, int height )
@@ -253,7 +247,6 @@ VideoStream::VideoStream( const char *fi

SetupFormat( filename, format );
SetupCodec( colours, width, height, bitrate, frame_rate );
- SetParameters();
}

VideoStream::~VideoStream()
diff -rupN a/src/zm_mpeg.h b/src/zm_mpeg.h
--- a/src/zm_mpeg.h 2013-05-13 12:33:58.274395358 -0400
+++ b/src/zm_mpeg.h 2013-05-13 12:33:58.279395427 -0400
@@ -55,7 +55,6 @@ protected:

void SetupFormat( const char *p_filename, const char *format );
void SetupCodec( int colours, int width, int height, int bitrate, double frame_rate );
- void SetParameters();

public:
VideoStream( const char *filename, const char *format, int bitrate, double frame_rate, int colours, int width, int height );
diff -rupN a/src/zm_thread.h b/src/zm_thread.h
--- a/src/zm_thread.h 2013-05-13 12:33:58.283395482 -0400
+++ b/src/zm_thread.h 2013-05-13 12:33:58.288395551 -0400
@@ -16,7 +16,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
-
+#include <unistd.h>
#ifndef ZM_THREAD_H
#define ZM_THREAD_H
And run configure as:
CXXFLAGS=-D__STDC_CONSTANT_MACROS ./configure --with-webdir=/usr/share/zoneminder/www --with-cgidir=/usr/libexec/zoneminder/cgi-bin --with-webuser=apache --with-webgroup=apache ZM_DB_HOST=localhost ZM_DB_NAME=<zm user> ZM_DB_USER=<zmpass> ZM_SSL_LIB=openssl --with-extralibs="-L/usr/lib64 -L/usr/lib64/mysql -L/usr/local/lib -lx264 -lv4l2" --with-libarch=lib64 --with-ffmpeg --enable-mmap=yes
* Don't forget to change ZM_DB_NAME, ZM_DB_USER, ZM_DB_PASS to appropriate values
** This also assumes that you have the correct dependencies already installed
jHeron
Posts: 73
Joined: Sun Jun 16, 2013 5:06 pm

Re: Trouble with compiling on Fedora_18_64

Post by jHeron »

Thanks man!
I tried to patch it like this but got this error:

Code: Select all

[pvr@localhost src]$ patch -u zm_ffmpeg_camera.cpp patch.patchpatching file zm_ffmpeg_camera.cpp
patch: **** malformed patch at line 5: if ( mCodecContext )
I am pretty green at this stuff so maybe I am applying the patch incorrectly?
Cheers,
Jon
jHeron
Posts: 73
Joined: Sun Jun 16, 2013 5:06 pm

Re: Trouble with compiling on Fedora_18_64

Post by jHeron »

I patched the files manually and ran your configure line but its saying the compiler is not working now?
Here is my config.log

Code: Select all

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by zm configure 1.25.0, which was
generated by GNU Autoconf 2.65.  Invocation command line was

  $ ./configure --with-webdir=/usr/share/zoneminder/www --with-cgidir=/usr/libexec/zoneminder/cgi-bin --with-webuser=apache --with-webgroup=apache ZM_DB_HOST=localhost ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_SSL_LIB=openssl --with-extralibs=-L/usr/lib64 -L/usr/lib64/mysql -L/usr/local/lib -lx264 -lv4l2 --with-libarch=lib64 --with-ffmpeg --enable-mmap=yes

## --------- ##
## Platform. ##
## --------- ##

hostname = localhost.localdomain
uname -m = x86_64
uname -r = 3.9.6-200.fc18.x86_64
uname -s = Linux
uname -v = #1 SMP Thu Jun 13 18:56:55 UTC 2013

/usr/bin/uname -p = x86_64
/bin/uname -X     = unknown

/bin/arch              = x86_64
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/lib64/ccache
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/local/sbin
PATH: /usr/sbin
PATH: /home/pvr/.local/bin
PATH: /home/pvr/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2443: checking for a BSD-compatible install
configure:2511: result: /usr/bin/install -c
configure:2522: checking whether build environment is sane
configure:2572: result: yes
configure:2713: checking for a thread-safe mkdir -p
configure:2752: result: /usr/bin/mkdir -p
configure:2765: checking for gawk
configure:2781: found /usr/bin/gawk
configure:2792: result: gawk
configure:2803: checking whether make sets $(MAKE)
configure:2825: result: yes
configure:2989: 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:3131: WARNING: You can call configure with the --with-webhost option.
    This tells configure what the host name is for name based virtual hosting. This is only used to populate the sample web/zmHttpd.conf file.
    e.g. --with-webhost=zm.localdomain
configure:3150: 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
configure:3177: WARNING: You can call configure with the --enable-crashtrace=<yes|no> or --disable-crashtrace option.
    This tells configure whether to compile ZoneMinder with crash tracing included. This allows a
    dump of the stack trace when a ZoneMinder binary crashes or is killed by an unexpected signal.
    Although this should work on most systems it does rely on un(or loosely) documented features and
    so should be regarded as experimental. If you experience problems compiling zm_signal.cpp or
    ZoneMinder binaries fail to shut down correctly then you should probably disable this feature.
    e.g. --enable-crashtrace=yes or --disable-crashtrace
configure:3294: checking for g++
configure:3310: found /usr/lib64/ccache/g++
configure:3321: result: g++
configure:3348: checking for C++ compiler version
configure:3357: g++ --version >&5
g++ (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3368: $? = 0
configure:3357: g++ -v >&5
Using built-in specs.
COLLECT_GCC=/usr/bin/g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.7.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.7.2 20121109 (Red Hat 4.7.2-8) (GCC) 
configure:3368: $? = 0
configure:3357: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:3368: $? = 4
configure:3357: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'
g++: fatal error: no input files
compilation terminated.
configure:3368: $? = 4
configure:3388: checking whether the C++ compiler works
configure:3410: g++ -D__STDC_CONSTANT_MACROS -Iyes/include  -Lyes/lib64 -L/usr/lib64/mysql  -L/usr/lib64 -L/usr/lib64/mysql -L/usr/local/lib -lx264 -lv4l2 conftest.cpp  >&5
/usr/bin/ld: cannot find -lv4l2
collect2: error: ld returned 1 exit status
configure:3414: $? = 1
configure:3452: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "zm"
| #define PACKAGE_TARNAME "ZoneMinder"
| #define PACKAGE_VERSION "1.25.0"
| #define PACKAGE_STRING "zm 1.25.0"
| #define PACKAGE_BUGREPORT "http://www.zoneminder.com/forums/ - Please check FAQ first"
| #define PACKAGE_URL "http://www.zoneminder.com/downloads.html"
| #define PACKAGE "ZoneMinder"
| #define VERSION "1.25.0"
| #define ZM_MEM_MAPPED 1
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3457: error: in `/home/pvr/Downloads/zm':
configure:3461: error: C++ compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=set
ac_cv_env_CXXFLAGS_value=-D__STDC_CONSTANT_MACROS
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_ZM_DB_HOST_set=set
ac_cv_env_ZM_DB_HOST_value=localhost
ac_cv_env_ZM_DB_NAME_set=set
ac_cv_env_ZM_DB_NAME_value=zm
ac_cv_env_ZM_DB_PASS_set=
ac_cv_env_ZM_DB_PASS_value=
ac_cv_env_ZM_DB_USER_set=set
ac_cv_env_ZM_DB_USER_value=zmuser
ac_cv_env_ZM_LOGDIR_set=
ac_cv_env_ZM_LOGDIR_value=
ac_cv_env_ZM_MYSQL_ENGINE_set=
ac_cv_env_ZM_MYSQL_ENGINE_value=
ac_cv_env_ZM_RUNDIR_set=
ac_cv_env_ZM_RUNDIR_value=
ac_cv_env_ZM_SSL_LIB_set=set
ac_cv_env_ZM_SSL_LIB_value=openssl
ac_cv_env_ZM_TMPDIR_set=
ac_cv_env_ZM_TMPDIR_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/usr/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_make_make_set=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /home/pvr/Downloads/zm/missing --run aclocal-1.11'
ALLOCA=''
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='${SHELL} /home/pvr/Downloads/zm/missing --run tar'
AUTOCONF='${SHELL} /home/pvr/Downloads/zm/missing --run autoconf'
AUTOHEADER='${SHELL} /home/pvr/Downloads/zm/missing --run autoheader'
AUTOMAKE='${SHELL} /home/pvr/Downloads/zm/missing --run automake-1.11'
AWK='gawk'
BINDIR=''
CC=''
CCDEPMODE=''
CFLAGS='-Iyes/include '
CGI_PREFIX='/usr/libexec/zoneminder/cgi-bin'
CPPFLAGS='-Iyes/include '
CXX='g++'
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS='-D__STDC_CONSTANT_MACROS'
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ENABLE_MMAP='yes'
EXEEXT=''
EXTRA_LIBS='-L/usr/lib64 -L/usr/lib64/mysql -L/usr/local/lib -lx264 -lv4l2'
EXTRA_PERL_LIB=''
FFMPEG_CFLAGS='-Iyes/include'
FFMPEG_LIBS='-Lyes/lib64'
FFMPEG_PREFIX='yes'
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LDFLAGS='-Lyes/lib64 -L/usr/lib64/mysql  -L/usr/lib64 -L/usr/lib64/mysql -L/usr/local/lib -lx264 -lv4l2'
LIBDIR=''
LIBOBJS=''
LIBS=''
LIB_ARCH='lib64'
LN_S=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /home/pvr/Downloads/zm/missing --run makeinfo'
MKDIR_P='/usr/bin/mkdir -p'
MYSQL_CFLAGS='-I/usr/include'
MYSQL_LIBS='-L/usr/lib64/mysql'
MYSQL_PREFIX='/usr'
OBJEXT=''
OPT_FFMPEG=''
OPT_NETPBM=''
PACKAGE='ZoneMinder'
PACKAGE_BUGREPORT='http://www.zoneminder.com/forums/ - Please check FAQ first'
PACKAGE_NAME='zm'
PACKAGE_STRING='zm 1.25.0'
PACKAGE_TARNAME='ZoneMinder'
PACKAGE_URL='http://www.zoneminder.com/downloads.html'
PACKAGE_VERSION='1.25.0'
PATH_BUILD='/home/pvr/Downloads/zm'
PATH_FFMPEG=''
PATH_NETPBM=''
PATH_SEPARATOR=':'
PERL=''
PERL_MM_PARMS=''
POW_LIB=''
RANLIB=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
SYSCONFDIR=''
TIME_BUILD='1373501711'
VERSION='1.25.0'
WEB_GROUP='apache'
WEB_HOST='zm.local'
WEB_PREFIX='/usr/share/zoneminder/www'
WEB_USER='apache'
ZM_CONFIG=''
ZM_DB_HOST='localhost'
ZM_DB_NAME='zm'
ZM_DB_PASS='zmpass'
ZM_DB_USER='zmuser'
ZM_HAS_V4L1=''
ZM_HAS_V4L2=''
ZM_HAS_V4L=''
ZM_LOGDIR='/var/log/zm'
ZM_MYSQL_ENGINE='MyISAM'
ZM_PCRE=''
ZM_PID=''
ZM_RUNDIR='/var/run/zm'
ZM_SSL_LIB='openssl'
ZM_TMPDIR='/tmp/zm'
ac_ct_CC=''
ac_ct_CXX='g++'
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include=''
am__isrc=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/pvr/Downloads/zm/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='/usr/bin/mkdir -p'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "zm"
#define PACKAGE_TARNAME "ZoneMinder"
#define PACKAGE_VERSION "1.25.0"
#define PACKAGE_STRING "zm 1.25.0"
#define PACKAGE_BUGREPORT "http://www.zoneminder.com/forums/ - Please check FAQ first"
#define PACKAGE_URL "http://www.zoneminder.com/downloads.html"
#define PACKAGE "ZoneMinder"
#define VERSION "1.25.0"
#define ZM_MEM_MAPPED 1

configure: exit 77
I am going to dig into this deeper shortly...
Cheers,
Jon
CKrypto
Posts: 12
Joined: Mon Feb 18, 2013 8:57 pm

Re: Trouble with compiling on Fedora_18_64

Post by CKrypto »

Just curious as to why you need to compile your own version of zm? If you don't need h.264 support, then the official Fedora repo should suit you just fine... just do `yum install zoneminder` and you should get everything you need.

I believe the patch I gave you was to fix some issues with h.264 support. In that case you will also need to have x264 support in ffmpeg. Here is a guide: http://eyezm.com/help/

I'll PM you a link to my successfully compiled patched zoneminder source directory for F18-x64 with x264 and mmap options enabled. It looks like I am using an older kernel and have some extra ffmpeg libraries installed, so you will probably have to re configure it.
jHeron
Posts: 73
Joined: Sun Jun 16, 2013 5:06 pm

Re: Trouble with compiling on Fedora_18_64

Post by jHeron »

Thanks for all your help!!
I am trying to compile it for a couple of reasons, one being that its a good exercise for me as I am eager to learn about GNU, compiling etc., I spent too many years wasting my time with windoze and am now trying to catch up with the linux world....
The other reason is that ZM seems to have many issues on Fedora and similar distro's like the socket error, permissions event viewing, setting the zones, etc. as can be seen by the number of posts here with issues.
The Yum repo installs fine but you cant see the image in the event window, ffmpeg doesn't work to display streaming video, when you change the default dir for images and events there is an issue with permissions that when fixed with chown still has issues where I cant set the zones fo rth ecams, etc, etc.
So I figured a good place to start off fresh would be with a freshly compiled version built on my target system?
I downloaded your source but I am still having issues that I believe are related to ffmpeg.
Here is my ffmpeg config.log and the zm config.log from your source
The ZM log has errors like this:
checking libavutil/avutil.h usability... no
checking libavutil/avutil.h presence... yes
configure: WARNING: libavutil/avutil.h: present but cannot be compiled
configure: WARNING: libavutil/avutil.h: check for missing prerequisite headers?
configure: WARNING: libavutil/avutil.h: see the Autoconf documentation
configure: WARNING: libavutil/avutil.h: section "Present But Cannot Be Compiled"
configure: WARNING: libavutil/avutil.h: proceeding with the compiler's result
configure: WARNING: ## ------------------------------------------------------------------------- ##
configure: WARNING: ## Report this to http://www.zoneminder.com/forums/ - Please check FAQ first ##
configure: WARNING: ## ------------------------------------------------------------------------- ##
Etc....
Thanks for all your input!
Cheers,
Jon
Attachments
zmConfig.log.zip
remove .zip extention
(123.9 KiB) Downloaded 165 times
config.log.zip
remove the zip extention
(218.13 KiB) Downloaded 170 times
CKrypto
Posts: 12
Joined: Mon Feb 18, 2013 8:57 pm

Re: Trouble with compiling on Fedora_18_64

Post by CKrypto »

I am trying to compile it for a couple of reasons, one being that its a good exercise for me as I am eager to learn about GNU, compiling etc.
Sometimes the best way to gain experience is by fixing things when they go wrong!
The other reason is that ZM seems to have many issues on Fedora and similar distro's
I previously had the packaged version of ZM install and it was working fine for me. I am thinking that the solutions to most of the issues that you encountered can be found in the forums. I only compiled my own ZM to include x264 support for eyeZM. But, I digress :D

Code: Select all

checking libavutil/avutil.h presence... yes
configure: WARNING: libavutil/avutil.h: present but cannot be compiled
configure: WARNING: libavutil/avutil.h: check for missing prerequisite headers?
configure: WARNING: libavutil/avutil.h: see the Autoconf documentation
configure: WARNING: libavutil/avutil.h: section "Present But Cannot Be Compiled"
configure: WARNING: libavutil/avutil.h: proceeding with the compiler's result
I haven't seen these errors before, but it appears that you don't have the ffmpeg headers installed correctly. Were you able to successfully compile and install ffmpeg? Have you tried installing ffmpeg-devel? Those messages are just warnings, so you should still be able to run 'make'... or at least attempt to...
jHeron
Posts: 73
Joined: Sun Jun 16, 2013 5:06 pm

Re: Trouble with compiling on Fedora_18_64

Post by jHeron »

I previously had the packaged version of ZM install and it was working fine for me. I am thinking that the solutions to most of the issues that you encountered can be found in the forums. I only compiled my own ZM to include x264 support for eyeZM. But, I digress :D
I am curious what you did to get it working?
I have read numerous threads and tried many things but I cant get everything working. I have it working now to the point that I can see video in the live screen, I can see the individual frames from events. The main image in events and exporting to video do not work and worse yet is I cant see the image to set up the zones. errors like this:
socket_sendto( /var/lib/zoneminder/sock/zms-838013s.sock ) failed: No such file or directory
Can't open /usr/share/zoneminder/www//run/media/pvr/bigDisk/zm/3/13/07/12/06/39/37/001-capture.jpg: No such file or directory
It cant open the image because its not getting created....
Anyways, I was going to revisit these issues once I get a fresh version compiled.... ;)
Were you able to successfully compile and install ffmpeg?
Yes, no problems, including pretty much all of the options and all dependencies, I posted the config log above.
Have you tried installing ffmpeg-devel?
Yes its installed too.
Those messages are just warnings, so you should still be able to run 'make'... or at least attempt to...
I believe those warnings are what leads to make failing, here is the fail from make if your interested.
In file included from zm_stream.h:27:0,
from zm_event.h:39,
from zm_zone.h:27,
from zm_monitor.h:26,
from zmc.cpp:28:
zm_mpeg.h:43:7: error: use of enum ‘PixelFormat’ without previous declaration
zm_mpeg.h:44:2: error: ‘AVOutputFormat’ does not name a type
zm_mpeg.h:45:2: error: ‘AVFormatContext’ does not name a type
zm_mpeg.h:46:2: error: ‘AVStream’ does not name a type
zm_mpeg.h:47:2: error: ‘AVFrame’ does not name a type
zm_mpeg.h:48:2: error: ‘AVFrame’ does not name a type
make[2]: *** [zmc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/zm_camera.Tpo .deps/zm_camera.Po
mv -f .deps/zm_comms.Tpo .deps/zm_comms.Po
make[2]: Leaving directory `/home/pvr/Downloads/zmP/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pvr/Downloads/zmP'
make: *** [all] Error 2
[pvr@localhost zmP]$
I will get it sorted eventually! :D
Cheers,
Jon
CKrypto
Posts: 12
Joined: Mon Feb 18, 2013 8:57 pm

Re: Trouble with compiling on Fedora_18_64

Post by CKrypto »

socket_sendto( /var/lib/zoneminder/sock/zms-838013s.sock ) failed: No such file or directory
This is probably related to your httpd configuration. See this thread.
Can't open /usr/share/zoneminder/www//run/media/pvr/bigDisk/zm/3/13/07/12/06/39/37/001-capture.jpg: No such file or directory
This is related to your configuration. The path to your events, images, and sounds directory should be relative to the Zoneminder web directory. If you want to use another disk to store these files, you need to link them in your web directory. For example:

Code: Select all

mkdir /run/media/pvr/bigDisk/zm/events
ln -s /run/media/pvr/bigDisk/zm/events /usr/share/zoneminder/www/
Under "Options -> Paths", DIR_EVENTS value should be "events" (without the quotes)

Do the same for images and sounds and make sure that the directories are writable by the "apache" user.

Also, make sure cambozola.jar is in the root of the zm web directory.
Last edited by CKrypto on Fri Jul 12, 2013 7:49 pm, edited 1 time in total.
jHeron
Posts: 73
Joined: Sun Jun 16, 2013 5:06 pm

Re: Trouble with compiling on Fedora_18_64

Post by jHeron »

Thanks!
I have the yum package working fine now, other than the ffmpeg export but I can work on that later. At least I can set the zones now and finish installing the cams.
I went through the thread you listed as well as many others with no joy, as soon as I made the sym links and changed the paths in options, as you suggested, everything started working and the error log is clean... :mrgreen:
I dont understand why using the direct path in options didnt work? Is this a common thing with multiple disks on linux or just a zm thing?
Without your suggestion I may have never figured that one out lol
Thanks again!
Cheers,
Jon
CKrypto
Posts: 12
Joined: Mon Feb 18, 2013 8:57 pm

Re: Trouble with compiling on Fedora_18_64

Post by CKrypto »

I dont understand why using the direct path in options didnt work? Is this a common thing with multiple disks on linux or just a zm thing?
It's a security issue from the web server stand point. You don't want to expose your entire file system, so the web server only allows access to files/directories in the root. If you look at the httpd config file that comes with ZM, you'll see something like (from the wiki):

Code: Select all

#F18     /etc/httpd/conf.d/zoneminder.conf
 Alias /zm "/usr/share/zoneminder/www"
 <Directory "/usr/share/zoneminder/www">
   Options FollowSymLinks
   AllowOverride All
   # NEW format
   Require all granted
   # The code unfortunately uses short tags in many places
   php_value short_open_tag 1
 #Deny from all # DELETE THIS LINE
 </Directory>
 ScriptAlias /cgi-bin "/usr/libexec/zoneminder/cgi-bin"
 <Directory "/usr/libexec/zoneminder/cgi-bin">
   Options +ExecCGI +MultiViews +SymLinksIfOwnerMatch
   AllowOverride All
   # NEW format
   Require all granted
   php_value short_open_tag 1
 </Directory>
This basically tells the web server to look in /usr/share/zoneminder/www/ when a request is made for http://<server ip>/zm and then defines some options for each directory. The "FollowSymlinks" option is important because without it, the fix you did above wouldn't work. You could explicitly allow access to directories outside the web root, but it is much easier just to link them. Also, in this case, it would require some changes to the ZM source code to go that route.
jHeron
Posts: 73
Joined: Sun Jun 16, 2013 5:06 pm

Re: Trouble with compiling on Fedora_18_64

Post by jHeron »

Got it, thanks for the explanation!
Cheers,
Jon
Locked