installing on ARM9

Forum for questions and support relating to the 1.24.x releases only.
stanke
Posts: 13
Joined: Mon Mar 16, 2009 11:35 am

installing on ARM9

Post by stanke »

Hello all

I've been trying to install from source on an ARM9 machine.
As far as I can tell, nobody before tried it.

Anyway, I have an Elro c800ip network camera, and it's compatible with D-Link 900 camera, so I guess it should work with ZoneMinder.

I chose to install ZoneMinder on my cracked Western Digital MyBook World Edition, which is a network storage device that runs on Linux and has a gumstix1151 motherboard with ARM9 CPU at 400MHz.

Anyway, after days of installing prerequisites for ZM on the machine (it takes 18 hours to compile mysql :) ), I've finally succeeded to run ./configure without errors, but then, when I ran "make", here is what I got:

Code: Select all

[root@MyBookWorld zoneminder]# make
make  all-recursive
make[1]: Entering directory `/shares/internal/stanke/zoneminder'
Making all in src
make[2]: Entering directory `/shares/internal/stanke/zoneminder/src'
make[3]: Entering directory `/shares/internal/stanke/zoneminder'
make[3]: Leaving directory `/shares/internal/stanke/zoneminder'
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/lib/include -I/opt/lib/include -Wall -Wno-sign-compare -fno-inline -I/opt/lib/include  -frepo -g -O2 -c -o zmc.o zmc.cpp
In file included from zmc.cpp:27:
zm_signal.h:24:22: execinfo.h: No such file or directory
In file included from zm_monitor.h:27,
                 from zmc.cpp:28:
zm_image.h:29:18: zlib.h: No such file or directory
In file included from zm_jpeg.h:22,
                 from zm_image.h:34,
                 from zm_monitor.h:27,
                 from zmc.cpp:28:
jinclude.h:20:55: jconfig.h: No such file or directory
In file included from zm_image.h:34,
                 from zm_monitor.h:27,
                 from zmc.cpp:28:
zm_jpeg.h:23:21: jpeglib.h: No such file or directory
zm_jpeg.h:24:20: jerror.h: No such file or directory
In file included from zm_image.h:34,
                 from zm_monitor.h:27,
                 from zmc.cpp:28:
zm_jpeg.h:29: error: field `pub' has incomplete type
zm_jpeg.h:35: error: variable or field `zm_jpeg_error_exit' declared void
zm_jpeg.h:35: error: `j_common_ptr' was not declared in this scope
zm_jpeg.h:36: error: variable or field `zm_jpeg_emit_message' declared void
zm_jpeg.h:36: error: `j_common_ptr' was not declared in this scope
zm_jpeg.h:36: error: expected primary-expression before "int"
zm_jpeg.h:36: error: initializer expression list treated as compound expression
zm_jpeg.h:39: error: variable or field `jpeg_mem_src' declared void
zm_jpeg.h:39: error: `j_decompress_ptr' was not declared in this scope
zm_jpeg.h:39: error: expected primary-expression before "const"
zm_jpeg.h:39: error: expected primary-expression before "int"
zm_jpeg.h:39: error: initializer expression list treated as compound expression
zm_jpeg.h:40: error: variable or field `jpeg_mem_dest' declared void
zm_jpeg.h:40: error: `j_compress_ptr' was not declared in this scope
zm_jpeg.h:40: error: `JOCTET' was not declared in this scope
zm_jpeg.h:40: error: `outbuffer' was not declared in this scope
zm_jpeg.h:40: error: expected primary-expression before "int"
zm_jpeg.h:40: error: initializer expression list treated as compound expression
In file included from zm_monitor.h:27,
                 from zmc.cpp:28:
zm_image.h:82: error: ISO C++ forbids declaration of `jpeg_compress_struct' with no type
zm_image.h:82: error: expected `;' before '*' token
zm_image.h:83: error: ISO C++ forbids declaration of `jpeg_decompress_struct' with no type
zm_image.h:83: error: expected `;' before '*' token
zm_image.h:93: error: ISO C++ forbids declaration of `JSAMPLE' with no type
zm_image.h:93: error: expected `;' before '*' token
zm_image.h:107: error: `JSAMPLE' has not been declared
zm_image.h:107: error: ISO C++ forbids declaration of `p_buffer' with no type
zm_image.h:116: error: ISO C++ forbids declaration of `JSAMPLE' with no type
zm_image.h:116: error: `JSAMPLE' declared as an `inline' field
zm_image.h:116: error: expected `;' before '*' token
zm_image.h:117: error: expected `;' before "inline"
zm_image.h:117: error: ISO C++ forbids declaration of `JSAMPLE' with no type
zm_image.h:117: error: `JSAMPLE' declared as an `inline' field
zm_image.h:117: error: expected `;' before '*' token
zm_image.h:119: error: expected `;' before "void"
zm_image.h:142: error: expected `,' or `...' before '*' token
zm_image.h:142: error: ISO C++ forbids declaration of `JOCTET' with no type
zm_image.h:143: error: expected `;' before '(' token
zm_image.h:145: error: expected `,' or `...' before '*' token
zm_image.h:145: error: ISO C++ forbids declaration of `Bytef' with no type
zm_image.h:146: error: expected `;' before '(' token
zm_image.h: In member function `void Image::CopyBuffer(const Image&)':
zm_image.h:129: error: `buffer' undeclared (first use this function)
zm_image.h:129: error: (Each undeclared identifier is reported only once for each function it appears in.)
zm_image.h:129: error: 'const class Image' has no member named 'buffer'
zm_image.h: In member function `Image& Image::operator=(const unsigned char*)':
zm_image.h:133: error: `buffer' undeclared (first use this function)
zm_image.h: In member function `void Image::Clear()':
zm_image.h:167: error: `buffer' undeclared (first use this function)
make[2]: *** [zmc.o] Error 1
make[2]: Leaving directory `/shares/internal/stanke/zoneminder/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/shares/internal/stanke/zoneminder'
make: *** [all] Error 2
I'm really at the end of my nerves, can please someone help me?
Because it took me 3 days just to get the ./configure to run.

thanks,
Milosh
User avatar
Blazer
Posts: 234
Joined: Sun Jun 05, 2005 12:57 pm

Post by Blazer »

I think you need to install libjpeg and libjpeg-devel.

P.S. If you get this working, you should make an RPM of it, which would save other people hours of work. They might even donate $ to you in gratitude :)

You could also look into cross-compiling, which basically means, compiling ARM binaries on a regular fast machine, its not the easiest thing to do though.
stanke
Posts: 13
Joined: Mon Mar 16, 2009 11:35 am

Post by stanke »

I did compile libjpeg from source on the ARM9, since there was no libjpeg-devel available for the distro, and ZM requires libjpeg.a.

I will sure make a RPM or whatever, because the work is tedious believe me.

I did consider cross-compiling, but I think that acquiring and compiling an ARM9 (armv5tejl) toolchain would be even more tedious.

I was looking for VMWare virtual appliance, to try to compile on it, but no luck.

Any other ideas?
stanke
Posts: 13
Joined: Mon Mar 16, 2009 11:35 am

Post by stanke »

could it be that the makefile is looking for my libjpeg headers in /opt/lib/include which doesn't exist, while they actually are located at /opt/include ???

How do I tell ./configure to look into /opt/include?

I ran ./configure with options:

--with-libarch=/opt/lib --with-mysql=/usr/lib --with-ffmpeg=/opt/lib

should I change that? and what should I change it to?


thanks,
Milosh
newvisionantenna
Posts: 381
Joined: Sat Jan 17, 2009 7:49 pm
Location: Germany

Post by newvisionantenna »

Stanke,

I had Debian Etch running on my Dlink DNS 323. I'll fire it back up and see what I can do with Zoneminder. The DNS I seem to recall was also based on ARM, could be wrong but I'll give it a shot.
stanke
Posts: 13
Joined: Mon Mar 16, 2009 11:35 am

Post by stanke »

thanks newvisionantenna

I tried fooling it by copying the /opt/include to /opt/lib/include

now I get this:

Code: Select all

[root@MyBookWorld zoneminder]# make
make  all-recursive
make[1]: Entering directory `/shares/internal/stanke/zoneminder'
Making all in src
make[2]: Entering directory `/shares/internal/stanke/zoneminder/src'
make[3]: Entering directory `/shares/internal/stanke/zoneminder'
make[3]: Leaving directory `/shares/internal/stanke/zoneminder'
g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/lib/include -I/opt/lib/include -Wall -Wno-sign-compare -fno-inline -I/opt/lib/include  -frepo -g -O2 -c -o zmc.o zmc.cpp
In file included from zmc.cpp:27:
zm_signal.h:24:22: execinfo.h: No such file or directory
In file included from jinclude.h:20,
                 from zm_jpeg.h:22,
                 from zm_image.h:34,
                 from zm_monitor.h:27,
                 from zmc.cpp:28:
/opt/lib/include/jconfig.h:11:1: warning: "HAVE_STDDEF_H" redefined
In file included from zm_config.h:20,
                 from zm.h:28,
                 from zmc.cpp:24:
../config.h:186:1: warning: this is the location of the previous definition
In file included from jinclude.h:20,
                 from zm_jpeg.h:22,
                 from zm_image.h:34,
                 from zm_monitor.h:27,
                 from zmc.cpp:28:
/opt/lib/include/jconfig.h:12:1: warning: "HAVE_STDLIB_H" redefined
In file included from zm_config.h:20,
                 from zm.h:28,
                 from zmc.cpp:24:
../config.h:192:1: warning: this is the location of the previous definition
make[2]: *** [zmc.o] Error 1
make[2]: Leaving directory `/shares/internal/stanke/zoneminder/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/shares/internal/stanke/zoneminder'
make: *** [all] Error 2
thanks,
Milosh
stanke
Posts: 13
Joined: Mon Mar 16, 2009 11:35 am

Post by stanke »

oh, I forgot to mention full distro name:

Code: Select all

[root@MyBookWorld /]# uname -a
Linux MyBookWorld 2.6.17.14 #1 PREEMPT Mon Mar 26 12:36:33 BST 2007 armv5tejl GNU/Linux
stanke
Posts: 13
Joined: Mon Mar 16, 2009 11:35 am

Post by stanke »

ok, I fooled the compiler by copying the execinfo.h into the include path

so the above problem is solved.

Now a new problem appears :)

Code: Select all

g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/lib/include -I/opt/lib/include -Wall -Wno-sign-compare -fno-inline -I/opt/lib/include  -frepo -g -O2 -c -o zm_comms.o zm_comms.cpp
In file included from zm_comms.cpp:20:
zm_comms.h: In member function `virtual int CommsBase::readV(const iovec*, int)':
zm_comms.h:91: error: `::readv' has not been declared
zm_comms.h: In member function `virtual int CommsBase::writeV(const iovec*, int)':
zm_comms.h:98: error: `::writev' has not been declared
zm_comms.h: In member function `virtual int Socket::send(const void*, int) const':
zm_comms.h:307: error: `::send' has not been declared
zm_comms.h: In member function `virtual int Socket::recv(void*, int) const':
zm_comms.h:314: error: `::recv' has not been declared
zm_comms.h: In member function `virtual int Socket::send(const std::string&) const':
zm_comms.h:321: error: `::send' has not been declared
zm_comms.h: In member function `virtual int Socket::recv(std::string&) const':
zm_comms.h:330: error: `::recv' has not been declared
zm_comms.h: In member function `virtual int Socket::recv(std::string&, size_t) const':
zm_comms.h:343: error: `::recv' has not been declared
zm_comms.h: In member function `virtual int UdpSocket::sendto(const void*, int, const SockAddr*) const':
zm_comms.h:552: error: `::sendto' has not been declared
zm_comms.h: In member function `virtual int UdpSocket::recvfrom(void*, int, SockAddr*) const':
zm_comms.h:564: error: `::recvfrom' has not been declared
zm_comms.h:576: error: `::recvfrom' has not been declared
zm_comms.cpp: In member function `virtual int CommsBase::readV(int, ...)':
zm_comms.cpp:41: error: invalid application of `sizeof' to incomplete type `iovec'
zm_comms.cpp:46: error: invalid use of undefined type `struct iovec'
/usr/include/bits/socket.h:220: error: forward declaration of `struct iovec'
zm_comms.cpp:46: error: invalid use of undefined type `struct iovec'
/usr/include/bits/socket.h:220: error: forward declaration of `struct iovec'
zm_comms.cpp:47: error: invalid use of undefined type `struct iovec'
/usr/include/bits/socket.h:220: error: forward declaration of `struct iovec'
zm_comms.cpp:47: error: invalid use of undefined type `struct iovec'
/usr/include/bits/socket.h:220: error: forward declaration of `struct iovec'
zm_comms.cpp:51: error: `::readv' has not been declared
zm_comms.cpp: In member function `virtual int CommsBase::writeV(int, ...)':
zm_comms.cpp:61: error: invalid application of `sizeof' to incomplete type `iovec'
zm_comms.cpp:66: error: invalid use of undefined type `struct iovec'
/usr/include/bits/socket.h:220: error: forward declaration of `struct iovec'
zm_comms.cpp:66: error: invalid use of undefined type `struct iovec'
/usr/include/bits/socket.h:220: error: forward declaration of `struct iovec'
zm_comms.cpp:67: error: invalid use of undefined type `struct iovec'
/usr/include/bits/socket.h:220: error: forward declaration of `struct iovec'
zm_comms.cpp:67: error: invalid use of undefined type `struct iovec'
/usr/include/bits/socket.h:220: error: forward declaration of `struct iovec'
zm_comms.cpp:71: error: `::writev' has not been declared
zm_comms.cpp: In member function `virtual bool Socket::socket()':
zm_comms.cpp:253: error: `::socket' has not been declared
zm_comms.cpp:261: error: `::setsockopt' has not been declared
zm_comms.cpp:262: error: `::setsockopt' has not been declared
zm_comms.cpp: In member function `virtual bool Socket::connect()':
zm_comms.cpp:274: error: `::connect' has not been declared
zm_comms.cpp: In member function `virtual bool Socket::bind()':
zm_comms.cpp:291: error: `::bind' has not been declared
zm_comms.cpp: In member function `virtual bool Socket::listen()':
zm_comms.cpp:302: error: `::listen' has not been declared
zm_comms.cpp: In member function `virtual bool Socket::accept()':
zm_comms.cpp:320: error: `::accept' has not been declared
zm_comms.cpp: In member function `virtual bool Socket::accept(int&)':
zm_comms.cpp:341: error: `::accept' has not been declared
zm_comms.cpp: In member function `bool Socket::getSendBufferSize(int&) const':
zm_comms.cpp:425: error: `getsockopt' undeclared (first use this function)
zm_comms.cpp:425: error: (Each undeclared identifier is reported only once for each function it appears in.)
zm_comms.cpp: In member function `bool Socket::getRecvBufferSize(int&) const':
zm_comms.cpp:436: error: `getsockopt' undeclared (first use this function)
zm_comms.cpp: In member function `bool Socket::setSendBufferSize(int)':
zm_comms.cpp:446: error: `setsockopt' undeclared (first use this function)
zm_comms.cpp: In member function `bool Socket::setRecvBufferSize(int)':
zm_comms.cpp:456: error: `setsockopt' undeclared (first use this function)
zm_comms.cpp: In member function `bool Socket::getRouting(bool&) const':
zm_comms.cpp:468: error: `getsockopt' undeclared (first use this function)
zm_comms.cpp: In member function `bool Socket::setRouting(bool)':
zm_comms.cpp:480: error: `setsockopt' undeclared (first use this function)
zm_comms.cpp: In member function `bool Socket::getNoDelay(bool&) const':
zm_comms.cpp:492: error: `getsockopt' undeclared (first use this function)
zm_comms.cpp: In member function `bool Socket::setNoDelay(bool)':
zm_comms.cpp:505: error: `setsockopt' undeclared (first use this function)
make[2]: *** [zm_comms.o] Error 1
make[2]: Leaving directory `/shares/internal/stanke/zoneminder/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/shares/internal/stanke/zoneminder'
make: *** [all] Error 2
any ideas?

could it be due to -fno-inline option of the compiler?

thanks,
Milosh
User avatar
Blazer
Posts: 234
Joined: Sun Jun 05, 2005 12:57 pm

Post by Blazer »

Hmm I think the purpose of --with-libarch is to specify 32bit or 64bit libdir, maybe what you need is --with-extralibs=/opt/lib
stanke
Posts: 13
Joined: Mon Mar 16, 2009 11:35 am

Post by stanke »

solved last problem

had to add

Code: Select all

#include <sys>
#include <sys>
into zm_comms.h

yeah, Blazer, that's it... but doesn't reflect on the problems I had later

thanks anyway

edit: hmm the phpBB has been truncating uio.h and socket.h from the above include statements
stanke
Posts: 13
Joined: Mon Mar 16, 2009 11:35 am

Post by stanke »

I will keep posting resolutions to problems if someone else needs to compile for ARM9

in zm_signal.cpp, line 90

Code: Select all

Error ("Signal blah blah %p, blah" , context.cr2);
should be replaced by:

Code: Select all

Error ("Signal blah blah %p, blah" , context.fault_address);
since that is the machine specific register for ARM9 as opposed to i386 arch.
stanke
Posts: 13
Joined: Mon Mar 16, 2009 11:35 am

Post by stanke »

ok now everything is compiled in ./src

but linker reports errors:

Code: Select all

make  all-recursive
make[1]: Entering directory `/shares/internal/stanke/zoneminder'
Making all in src
make[2]: Entering directory `/shares/internal/stanke/zoneminder/src'
make[3]: Entering directory `/shares/internal/stanke/zoneminder'
make[3]: Leaving directory `/shares/internal/stanke/zoneminder'
g++ -frepo -g -O2  -L/opt/lib//opt/lib -L/usr/lib//opt/lib/mysql   -o zmc zmc.o zm_box.o zm_buffer.o zm_camera.o zm_comms.o zm_config.o zm_coord.o zm.o zm_db.o zm_debug.o zm_event.o zm_exception.o zm_file_camera.o zm_ffmpeg_camera.o zm_image.o zm_jpeg.o zm_local_camera.o zm_monitor.o zm_ffmpeg.o zm_mpeg.o zm_poly.o zm_regexp.o zm_remote_camera.o zm_remote_camera_http.o zm_remote_camera_rtsp.o zm_rtp.o zm_rtp_ctrl.o zm_rtp_data.o zm_rtp_source.o zm_rtsp.o zm_signal.o zm_stream.o zm_thread.o zm_time.o zm_timer.o zm_user.o zm_utils.o zm_zone.o  -lbz2 -lm -lcrypto -lmysqlclient -lpthread -ldl -lz -ljpeg
zm_image.o: In function `Image::Outline(unsigned int, Polygon const&)':
/shares/internal/stanke/zoneminder/src/zm_image.cpp:1314: undefined reference to `round'
/shares/internal/stanke/zoneminder/src/zm_image.cpp:1289: undefined reference to `round'
/shares/internal/stanke/zoneminder/src/zm_image.cpp:1321: undefined reference to `round'
/shares/internal/stanke/zoneminder/src/zm_image.cpp:1282: undefined reference to `round'
zm_image.o: In function `Image::Fill(unsigned int, int, Polygon const&)':
/shares/internal/stanke/zoneminder/src/zm_image.cpp:1415: undefined reference to `round'
zm_image.o:/shares/internal/stanke/zoneminder/src/zm_image.cpp:1416: more undefined references to `round' follow
zm_signal.o: In function `zm_die_handler(int, sigcontext)':
/shares/internal/stanke/zoneminder/src/zm_signal.cpp:94: undefined reference to `backtrace'
zm_zone.o: In function `Zone::CheckAlarms(Image const*)':
/shares/internal/stanke/zoneminder/src/zm_zone.cpp:637: undefined reference to `round'
/shares/internal/stanke/zoneminder/src/zm_zone.cpp:638: undefined reference to `round'
zm_zone.o: In function `Box::Centre() const':
/shares/internal/stanke/zoneminder/src/zm_box.h:60: undefined reference to `round'
/shares/internal/stanke/zoneminder/src/zm_box.h:61: undefined reference to `round'
collect2: ld returned 1 exit status
make[2]: *** [zmc] Error 1
make[2]: Leaving directory `/shares/internal/stanke/zoneminder/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/shares/internal/stanke/zoneminder'
make: *** [all] Error 2
seems from some reason linker doesn't link the functions 'round' and 'backtrace'...

from what I read on other forums, 'round' has appeared only in C99 standard.

I'll post resolution of problem if and when I find it...

meanwhile if anybody wants to spare me the searching, be my guest :)

thanks,
Milosh
User avatar
Blazer
Posts: 234
Joined: Sun Jun 05, 2005 12:57 pm

Post by Blazer »

Does adding -lm (which sould add libm which is math lib that has the round() function) to the flags help at all?

Hmm I also read that:

Code: Select all

2. undefined reference to 'round'  - arm libraries don't have round function implemented. The simplest solution is to add such a function to a device server class, i.e:

double round (double x) {
         int x_int = (int)(x+0.5);
         return(x_int);
}
Hah so they are basically saying to add your own round function :-\
User avatar
Blazer
Posts: 234
Joined: Sun Jun 05, 2005 12:57 pm

Post by Blazer »

BTW, this might be worth playing with:

http://netwinder.osuosl.org/users/j/jse ... RPMS/i386/

:-)

Would probably make your life easier if you could just run arm-linux-gcc on a fast box and then scp -r the dir to your arm machine and then "make install" :)
stanke
Posts: 13
Joined: Mon Mar 16, 2009 11:35 am

Post by stanke »

Blazer wrote:Does adding -lm (which sould add libm which is math lib that has the round() function) to the flags help at all?

Hmm I also read that:

Code: Select all

2. undefined reference to 'round'  - arm libraries don't have round function implemented. The simplest solution is to add such a function to a device server class, i.e:

double round (double x) {
         int x_int = (int)(x+0.5);
         return(x_int);
}
Hah so they are basically saying to add your own round function :-\
I found that too, however, the smart makers of zoneminder have thought about it, as it seems from the following code snippet taken from zm.h:

Code: Select all

extern "C"
{
#if !HAVE_DECL_ROUND
double round(double);
#endif
}
but for some reason it doesn't do...

if all fails, I will have to try crosscompiling

I even tried adding -lm

no go

thanks Blazer,
Milosh
Locked