[SOLVED] libjpeg-turbo

Issues related to applications and software problems
Post Reply
4hr1m4n
Posts: 11
Joined: 2012/10/30 12:00:22

[SOLVED] libjpeg-turbo

Post by 4hr1m4n » 2012/11/10 07:06:01

Hi,

Have you ever heard about [b]libjpeg-turbo[/b]? Are you interested in speeding up a few things in your computer? If so you better check this out.

From the project's [url=http://sourceforge.net/projects/libjpeg-turbo]webpage[/url]: "[i]libjpeg-turbo is a derivative of libjpeg that uses MMX, SSE, SSE2, and NEON SIMD instructions to accelerate baseline JPEG compression/decompression by about 2-4x on x86, x86-64, and ARM platforms. It is based on libjpeg/SIMD but has numerous enhancements.[/i]"

Unfortunately, at the time I'm writing this message, there is no libjpeg-turbo package (RPM) available for CentOS 6... :-( Actually there is one for [url=http://puias.math.ias.edu]PUIAS 6[/url], in its Computational repository, but in CentOS it conflicts with the standard libjpeg package. So the only way around is to install it from the source.

Here are the steps how to do this:

[b][size=96]1)[/size][/b] Download libjpeg-turbo from [url=http://sourceforge.net/projects/libjpeg-turbo/files/latest/download]here[/url] (at this time the latest version is 1.2.1).

[b][size=96]2)[/size][/b] Go to the directory into where you've downloaded the file. The file name should be something like [i]libjpeg-turbo-1.2.1.tar.gz[/i].

[b][size=96]3)[/size][/b] To unzip the file, execute:[code]tar -xzf libjpeg-turbo-1.2.1.tar.gz[/code]

[b][size=96]4)[/size][/b] Then go into the new directory called [b]libjpeg-turbo-1.2.1[/b] and execute the following commands:[code]
./configure
make[/code]
Note: you might need to install a couple of standard CentOS packages in order to be able to compile libjpeg-turbo. Please refer to the [b]BUILDING.txt[/b] file for more details.

[b]4-a)[/b] Do you want to test it before installing it? No problem, execute:[code]make test[/code] and if all went well you can clean up the test images by executing [code]make testclean[/code]

[b][size=96]5)[/size][/b] Finally, to install it you just need to execute: [code]make install[/code]

[b][size=96]6)[/size][/b] Before you can start using it, you need to tweak the dynamic linker so it will pick first the libjpeg-turbo libraries instead of the standard ones. To do this is very simple:

[b]6-a)[/b] Create a new text file called [b]/etc/ld.so.conf.d/libjpeg-turbo.conf[/b] and add the following single line to it:[code]
/opt/libjpeg-turbo/lib/
[/code]

[b]6-b)[/b] Now, to update the run-time linker's cache, execute:[code]/sbin/ldconfig[/code]

[b][size=96]7)[/size][/b] The last step is to add libjpeg-turbo's bin directory to the path. Just for the sake of completeness, you should create two new text files as below:

[b]7-a)[/b] This is for sh-like shells. Create a new text file called [b]/etc/profile.d/libjpeg-turbo.sh[/b] and add the following line into it:[code]
export PATH=/opt/libjpeg-turbo/bin:${PATH}
[/code]

[b]7-b)[/b] This is for csh-like shells. Create a new text file called [b]/etc/profile.d/libjpeg-turbo.csh[/b] and add the following line into it:[code]
set path = ( /opt/libjpeg-turbo/bin $path )
[/code]

To be honest, I should have used [url=http://centosmanpages.com/manpages/6/man8/alternatives.8.html]alternatives[/url] instead of executing steps [b]6[/b] and [b]7[/b] above, but I'm too lazy to work out all the symbolic links and stuff... Sorry.
I hope I've remembered everything... Please feel free to correct/add anything that I might have missed.

[color=FF0000]As usual these instructions come with no guaratee whatsoever. Use them at your own risk.[/color] 8-)
Enjoy.

drc42
Posts: 1
Joined: 2013/02/07 00:27:54
Contact:

Re: [SOLVED] libjpeg-turbo

Post by drc42 » 2013/02/07 01:21:52

Not sure why you couldn't have just used the RPMs provided on SourceForge:

https://sourceforge.net/projects/libjpeg-turbo/files/

They work fine with CentOS 6 and do not conflict with the system-installed libjpeg RPM.

Post Reply