View unanswered posts | View active topics It is currently Sun May 19, 2013 9:05 pm



Reply to topic  [ 3 posts ] 
Building with the Intel optimizing compiler (icc) 
Author Message

Joined: Mon Jun 22, 2009 1:18 am
Posts: 1
Post Building with the Intel optimizing compiler (icc)
Here is my setup:

2x Panasonic IP cameras, 5fps, 640x480, JPEG
Intel Q6600 (quad core)
Ubuntu 8.04, 64-bit

I rebuilt libjpeg and zoneminder using the Intel compiler (icc/icpc). This reduced my total zma "top" CPU utilization from 30% to 17%. I am posting the procedure here in the hopes that it will be useful to other ZM users.


icc download here (NON COMMERCIAL USE ONLY):

https://registrationcenter.intel.com/Re ... NCOM&lang=
or: http://software.intel.com/en-us/article ... velopment/

For commercial use, you need to buy a license. (It is probably cheaper just to upgrade your PC. Not that Intel cares; they get your money either way.)

You can install as an ordinary user if you want. Beware: the installer tries to dump a couple gigs of stuff in /tmp . Very rude.

I installed to /opt/intel/Compiler/11.0/ . You cannot (easily) move it around after installation, because it writes some paths into the shell scripts.


Rebuild libjpeg62 with icc:

apt-get source libjpeg62
cd libjpeg6b-6b

Edit debian/rules:

was: CFLAGS += -O2
now: CFLAGS += -O2 -xHOST -ip -fno-builtin

Edit makefile.cfg:

was: LIBTOOL = @LIBTOOL@
now: LIBTOOL = @LIBTOOL@ --tag=foo

Next steps:

source /opt/intel/Compiler/11.0/bin/iccvars.sh intel64
CC=icc fakeroot debian/rules binary
cd ..


Rebuild zoneminder with icc:

apt-get source zoneminder
cd zoneminder-1.22.3

Edit src/zm_jpeg.c:jpeg_mem_src() for const correctness:

was: src->inbuffer = inbuffer;
now: src->inbuffer = (JOCTET *)inbuffer;

Add after unistd.h at the top: #include <stdlib>

Edit debian/rules:

was: CFLAGS += -O2
now: CFLAGS += -O2 -xHOST -ip

Next steps:

source /opt/intel/Compiler/11.0/bin/iccvars.sh intel64
CC=icc CXX=icpc fakeroot debian/rules binary
cd ..


Install the new deb's (dpkg -i *.deb) and you should be good to go.

Notes:

-xHOST uses the fastest ISA available for the system you are running on. i.e. my binaries probably will not run at all on an older CPU, and will not be optimal on a newer CPU. So you are best off building them from source on your system.

You will need to install a whole bunch of development packages to do the build. Off the top of my head:

ia32-libs (for icc)
debhelper
dh-make
libpcre3-dev
libavfomat-dev
libavcodec-dev
libavutil-dev
libmime-lite-perl
libgnutls-dev
libmysqlclient15-dev

Most of these are mandatory (configure will halt if they are missing). A few are optional (libav*) or have highly annoying side effects if they are missing (libpcre3).


Mon Jun 22, 2009 1:50 am
Profile
Site Admin
User avatar

Joined: Wed Jul 09, 2003 3:07 pm
Posts: 5221
Location: Bristol, UK
Post 
Thanks for this. This would be a good post to put in the Wiki if you have the time (and the inclination).

_________________
Phil


Mon Jun 29, 2009 10:57 am
Profile ICQ YIM WWW

Joined: Wed Jan 30, 2008 6:53 pm
Posts: 519
Location: St. Louis, MO, USA
Post 
Has anyone tried this with a more recent version, say 1.24.2? Also, I found 1.24.2 wouldn't complile with libjpeg6, had to bump it up to 7.

Theoretically I installed the intel compiler, but compliation's not my strong point. Do I need to rerun configure? The instructions in the post seemed to indicate it was going to give me .deb's when it was done, but I can't seem to locate "debian/rules" to edit in intel's stuff or ZoneMinders.

I'm starting to push the boundaries of this machine, so any tweaks would be nice, and I have a feeling the core 2 quad could benefit from intel's compiler.


Mon Dec 14, 2009 5:33 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group