We can check your plugins and stuff

Monday, February 14, 2011

How to pull the latest stable code of DIGIKAM and SHOWFOTO

Digikam and ShowFoto are two great programs that anyone who is into photography whether as an amateur or professional should have. It is one of the best open source software that I use on almost on a daily bases. If photography is your passion and you have a lots of pictures clicked via cellphones, point and shoot cameras, and high end pro kit.
There will come a time when you will need to have a Digital Workflow/Photo management in place. It does not matter if you are just looking for a quick and dirty solution to do some resizing, cropping, color correction or you on the lookout for serious professional features like converting RAW files, RAW to DNG conversion, noise reduction in batch mode. Digikam and ShowFoto fit the bill perfectly. The best part is both of the software are fully Open source and available on multiple platforms like Windows, Mac OS and Linux.

If you have been reading my blog you know I love to tinker with code and compile stuff... No no do not get worried as I said even if you are a amateur shutterbug  you can use Digikam and ShowFoto. The following steps are for the absolute new user on Fedora Linux with the KDE Desktop Environment. Digikam and ShowFoto are part of the KDE graphics core. They are simple to install via yum.


[root@localhost ~]# yum install digikam

This will install both digikam and showfoto and can be  found under the Graphic Menu. Give it a spin, you will love it.

Ok now for readers who are already using digikam and showfoto esp on Fedora Linux, you all know the great developers are constantly working hard to fix any bugs and bring out new features for the users to try out. New version are being rolled out every now and then. As Fedora Linux is not a rolling distro, the default fedora repos will have the older version of the software. Now some would question why do we need the latest and greatest version anyway ???
The answer is some what simple, bug fixes, new features that you may need, speed. The most important of all support for new cameras and RAW file formats that you have or plan to buy soon.

Now we will see how we can have latest stable build in no time without waiting for the repos to be updated ;) In order to compile digikam and showfoto we need to some software per installed. Why compile -- two words speed and stability. Here we go ... Please note photo processing and editing is a very complex process and requires a lot of different type of software and libraries and third party software. It is best of you have the latest stable build of KDE and dev tools install as this will reduce the time taken to download the files required.

[root@localhost ~]# yum-builddep digikam -y

This command will check all the missing software, programs and libaries that are need to compile digikam and showfoto. This can take some time depending how fast internet access you have and what all packages are installed/missing.


No source RPM found for digikam-1.7.0-1.fc14.1.kde46.x86_64
No source RPM found for digikam-1.6.0-1.fc14.x86_64
Getting requirements for digikam-1.7.0-1.fc14.src
 --> Already installed : libgphoto2-devel-2.4.10-2.fc14.x86_64
 --> Already installed : 7:kdegraphics-devel-4.6.0-0.1.fc14.x86_64
 --> Already installed : mysql-devel-5.1.55-1.fc14.x86_64
 --> Already installed : kdepimlibs-devel-4.6.0-0.1.fc14.x86_64
 --> Already installed : desktop-file-utils-0.16-1.fc14.x86_64
 --> Already installed : gettext-0.18.1.1-4.fc14.x86_64
 --> Already installed : lensfun-devel-0.2.5-3.fc14.1.x86_64
 --> Already installed : mysql-server-5.1.55-1.fc14.x86_64
 --> Already installed : kdeedu-devel-4.6.0-0.1.fc14.x86_64
 --> Already installed : 7:kdegraphics-devel-4.6.0-0.1.fc14.x86_64
 --> Already installed : lcms-devel-1.19-2.fc14.x86_64
 --> Already installed : 2:libpng-devel-1.2.44-1.fc14.x86_64
 --> Already installed : 7:kdegraphics-devel-4.6.0-0.1.fc14.x86_64
 --> Already installed : liblqr-1-devel-0.4.1-1.fc12.x86_64
 --> Already installed : sqlite-devel-3.6.23.1-1.fc14.x86_64
 --> Already installed : libtiff-devel-3.9.4-1.fc14.x86_64
 --> Already installed : glib2-devel-2.26.0-2.fc14.x86_64
 --> Already installed : 1:doxygen-1.7.3-1.fc14.x86_64
 --> Already installed : 6:kdelibs-devel-4.6.0-0.2.fc14.x86_64
 --> Already installed : jasper-devel-1.900.1-16.fc14.x86_64
 --> Already installed : soprano-devel-2.6.0-0.1.fc14.x86_64
No uninstalled build requires

On my system as I have already all the required files installed. Once we have all the necessary software installed we will download the latest code of digikam and showfoto.


#wget -c http://anongit.kde.org/digikam/digikam-latest.tar.gz
Once the source tree is downloaded extract the tarball and execute the shell script inside. This will build the source tree. Change the directory to digikam 
[root@localhost Downloads]# cd digikam/
[root@localhost digikam]# git pull
remote: Counting objects: 168, done.
remote: Compressing objects: 100% (97/97), done.
remote: Total 97 (delta 90), reused 0 (delta 0)
Unpacking objects: 100% (97/97), done.
From http://anongit.kde.org/digikam
   a699bc9..28a90d6  development/2.0 -> origin/development/2.0
Already up-to-date.

By doing a git pull the code will be sync to the latest stable release. On your system it should pull and update the source tree. My system has been updated against the latest stable tree.

Ok now we come to the final build steps... [yep this is a long post ;)]
[root@localhost digikam]# mkdir build && cd build
[root@localhost build]# export CFLAGS='-O3 -pipe -march=native' && export  CXXFLAGS='-O3 -pipe -march=native'
We did say we were after the fastest build possible ;)
[root@localhost build]#cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` -DCMAKE_BUILD_TYPE='release'

After cmake does a lot of checking and writes out the required files..  you should see
-- Adjusting compilation flags for GCC version ( 4.5.1 )
-- Configuring done
-- Generating done
-- Build files have been written to: /root/Downloads/digikam/build

Now just to be sure that we are making the fastest possible build for the given system, open CMakeCache.txt in a editor and make sure it has these lines.
//Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING='-O3 -pipe -march=native '

[root@localhost build]#make -j6  (start the compilation, can take some time depending on the system) 
Linking CXX executable digikam                                                                                                                                                   
[100%] Built target digikam ( wow we are in business :D )
Play around with the build inside the digikam and showfoto folders and check for any stability issues. (I never had any)
[root@localhost build]#make install (to install the build)

woot woot!!!!!!!! That's it enjoy :D :D

No comments:

Post a Comment