Page 1 of 3

64 bit build

Posted: Sun Apr 17, 2005 11:25 pm
by caseystone
Hello... I recently upgraded my hardware to AMD 64 processor / nforce3ultra mobo. I just changed it out under my installed version of ZM from the LiveCD. It's almost working, you can see my post in the LiveCD forum if you'd like to help me with that.

But I'm now considering installing Fedora Core 3 for x86-64 and trying to build an installation from scratch. My question is, can I use RPMs to install ZM (and perhaps some other packages I need) if they are not specifically "64-bit" versions or must I compile from source and install that?

If I compile ZM from source on my 64bit machine and OS will it then be a "64-bit" program?

By asking this I'm sure I'm revealing much ignorance of the whole 64-bit concept... but I need to learn.

Should I expect any more difficulty in trying to get things up and running in the 64bit OS?

Thanks.

Casey

Posted: Mon Apr 18, 2005 5:18 am
by cordel
I can say for sure that the RPM versions will not work. I plan on building for the 64 bit platform in the future but at the moment I lack the hardware to do so. ZoneMinder should build fine and may require a little tweaking but should work. You will also be able to find most of the extra packages you need on the Fedora downloads page in the EXTRAS directory.
Cheers,
Cordel

Posted: Tue Apr 26, 2005 6:55 am
by trogie
I just build and installed zoneminder 1.21.0 on my amd64 without any problems.

Trogie

Posted: Tue Apr 26, 2005 8:58 am
by trogie
After I find out my cgi-bin configuration was wrong, zoneminder is now running happy on my amd64.

I just found that the color settings for all cameras must be the same on a single chip 4port card (pv-143a).

Trogie

Posted: Fri Apr 29, 2005 10:54 am
by karlg
Note,

It would be useful in the configure script, to change

Code: Select all

MYSQL_LIBS="-L${MYSQL_PREFIX}/lib/mysql"
to something less specific... if you want to build aginst a 64bit version of the libary, this breaks. should be:

Code: Select all

MYSQL_LIBS="-L${MYSQL_PREFIX}"
this way the user can specify /usr/lib64/mysql instead on the ./configure line.

Posted: Tue May 03, 2005 11:54 am
by zoneminder
The MYSQL_PREFIX is used as the root of both the mysql libraries and header files. So the headers are loaded from $(MYSQL_PREFIX)/include. Unfortunately this means that they would not be found if the prefix was the whole library path.

I'm interested to know what breaks in a 64 bit build, are things put in unusual places?

Phil

Fedora x86_64

Posted: Tue May 03, 2005 3:08 pm
by karlg
64bit versions of many libraries are placed in /usr/lib64 and /lib64. This is done so that 32bit and 64bit libraries and binaries can be run side by side on a 64bit enabled machine with little impact to end user. (even though it makes developer's lives hell)

exmaple, 64bit version of libmysqlclient.a is placed in /usr/lib64/mysql directory. If a user has both the 32bit and 64bit mysql libs installed, then it'll end up using the wrong library and fail to build propery, or if the 32bit version is not installed, zm complains it can't find libmysqlclient.a. With lib being hardcoded, short of modifying the Makefile, you can't compile a 64bit version of ZM out of the box on Fedora core3.

Posted: Tue May 03, 2005 4:40 pm
by caseystone
Well, for what it's worth, my Zoneminder on FC3_x86-64 is working.. mostly.

I had to create a symlink of libmysqlclient.a from /usr/lib64 to /usr/lib before the ./configure would work. Here was my ./configure line:

Code: Select all

./configure --with-mysql=usr/lib64 --with-webdir=var/www/html/zm --with-cgidir=/var/www/cgi-bin --with-ffmpeg=/usr/lib64 --with-lame=usr/lib64
Now, I should point out, I have NOT been able to create video out of the events. It may be the same problem, and perhaps the same solution.

I will be investigating the video problem, and soliciting help from the forum soon. But after spending about three solid days on the project (my first time installing ZM without the LiveCD) I'm still not ready to dive back in.

To be sure though, I have three video cameras and one IP camera connected and I can leave them all in modect and capture events and view events, delete events, archive them.. all that IS working very well. I'm getting excellent performance I think on the AMD Athlon 64 3200+.

-Casey

Posted: Wed May 04, 2005 11:25 pm
by karlg
So, i've figured out the no recording problem... has to do with finding the right libraries when building on x86_64. i'll post a patch soon.

even with the path, there is another problem with pcre-devel package. it symlinks to the 32bit version of the library, instead of the 64bit which is what we want.

Posted: Thu May 05, 2005 12:18 am
by caseystone
When you get it solved, please post in detail how to fix it, karlg. I need pretty detailed instructions sometimes!

Thanks for your help and input.

-Casey

Posted: Thu May 05, 2005 10:27 am
by karlg
okay... so here's the final patch.

Code: Select all

diff -Naur zm-1.21.0/configure zm-1.21.0-mod/configure
--- zm-1.21.0/configure	2005-03-04 07:16:16.000000000 -0500
+++ zm-1.21.0-mod/configure	2005-05-05 05:59:54.000000000 -0400
@@ -861,6 +861,7 @@
   --enable-dependency-tracking   do not reject slow dependency extractors
 
 Optional Packages:
+  --with-libarch=<path>   path to libs for your arch e.g. lib or lib64
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-mysql=<path>     prefix of MySQL installation. e.g. /usr/local or /usr
@@ -1764,6 +1765,13 @@
 PATH_BUILD=`pwd`
 
 
+# test for lib or lib64 is specified
+if test "${with_libarch+set}" = set; then
+  LIB_ARCH=$with_libarch;
+else
+  LIB_ARCH="lib";
+fi;
+
 
 # Check whether --with-mysql or --without-mysql was given.
 if test "${with_mysql+set}" = set; then
@@ -1780,7 +1788,7 @@
 

 fi;
 
-MYSQL_LIBS="-L${MYSQL_PREFIX}/lib/mysql"
+MYSQL_LIBS="-L${MYSQL_PREFIX}/${LIB_ARCH}/mysql"
 MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include"
 
 
@@ -1810,7 +1818,7 @@
 
 fi;
 
-FFMPEG_LIBS="-L${FFMPEG_PREFIX}/lib"
+FFMPEG_LIBS="-L${FFMPEG_PREFIX}/${LIB_ARCH}"
 FFMPEG_CFLAGS="-I${FFMPEG_PREFIX}/include"
 
Procedure to fix libpcre symblink:
-as root, cd into /usr/lib64
-first, make sure you have libpcre.so.0 (if you don't, you need to install the pcre.x86_64 RPM)
-do: ln -s libpcre.so.0 libpcre.so

Procedure to fix zoneminder source:
-download the raw patch file from here: (don't cut and paste the code from the forum)
http://www.spacechimp.net/files/zm-1.21.0_lib64.patch
-move the patch file in to your zoneminder source directory, and then cd into your zoneminder source directory for 1.21.0
-run patch -p1 < zm-1.21.0_lib64.patch

follow the instructions for building, EXCEPT, add a:
"--with-libarch=lib64" to your configure line. Also, make sure you don't specify full path for --with-mysql. it should be "--with-mysql=/usr", not "--with-mysql=/usr/lib64/mysql" on Fedora Core 3. The makefile will know where to look with the above patch if you provide the --with-libarch. (note, you should never add absolute path for mysql, ffmpeg, etc as it will find it on it's own.)

Posted: Thu May 05, 2005 3:17 pm
by caseystone
I'm looking forward to trying that!

One question... Since my system is currently built and running, is there any step I need to take before "re-doing" the ./configure and the rest of the install procedure again? Will it just overwrite things as it needs to?

Can I skip any steps relating to the database since it's already working?

Obviously I'll tell ZM to "stop" before I do it. Will all my settings remain intact? Will my archived events remain? Should I delete that one symlink I did to make it work before?

Thanks.

Posted: Thu May 05, 2005 4:57 pm
by zoneminder
I'm interested in adding this patch to the main development tree. Can you confirm that it stills allows correct configuration on 32 bit systems? If so I'll include it in the next release.

Phil

Posted: Thu May 05, 2005 6:13 pm
by karlg
zoneminder wrote:I'm interested in adding this patch to the main development tree. Can you confirm that it stills allows correct configuration on 32 bit systems? If so I'll include it in the next release.

Phil
I can't confirm 100% because i don't have a 32bit system to test on....

but i'm about 99.9% sure it won't have any adverse affects on 32bit platform... someone should test tho to be absolutely sure.

Posted: Thu May 05, 2005 6:15 pm
by karlg
caseystone wrote:I'm looking forward to trying that!

One question... Since my system is currently built and running, is there any step I need to take before "re-doing" the ./configure and the rest of the install procedure again? Will it just overwrite things as it needs to?

Can I skip any steps relating to the database since it's already working?

Obviously I'll tell ZM to "stop" before I do it. Will all my settings remain intact? Will my archived events remain? Should I delete that one symlink I did to make it work before?

Thanks.
yes, stop zm first...
then, i would do a make clean before you do anything else...
apply the patch
rerun configure with the proper args
rerun make
then finally make install

that should be it. (assuming you have all the 64bit deps installed)