Tutorial : How To Compile digiKam Under Microsoft Windows Seven

digikam1.5.0-windows-lensfuntools

This tutorial is dedicated to guide users who want to compile current whole digiKam implementation from KDE subversion repository under Microsoft Windows.

I will use Windows Seven and KDE 4.4.1. Windows system is installed to C:, and an empty 10Gb hard drive partition E: is ready to use for KDE4 and digiKam.

Note: this tutorial can be also used under Microsoft Windows XP and Vista.

Stage 1: KDE4 Installation

win7-001 win7-045

With your Web browser, go to KDE Windows project page and start last version of KDE GUI installer. You must install KDE4 in a simple path, without use blank space, else compilation can be broken. Here we use E:\kde4-mingw, where E: is an empty hard-drive dedicated to host KDE4 component and all source code to compile.

win7-003 win7-004

Select Package Manager mode using MinGW4 compiler and right repository to download packages.

win7-005 win7-006

Select right KDE version to use. In this tutorial we use KDE 4.4.1, but you can use a more recent release of course. Start to select all components that we will needs. First group to set is Debug Tools: gdb to get crash back-trace, and debugview to show all debug messages (normally reported in the console under Linux).

win7-007 win7-008

Packages to download from KDE group are: kate text editor, all kdebase, kdeedu which contains Marble for digiKam geo-location, kdelibs, kdepimlibs for digiKam tags link with address book. Pre-compiled digiKam and kipi-plugins packages are not necessary here, because we will recompile it from scratch.

win7-046 win7-010

On KDEsupport group, it's very important to select automoc, kdewin, oxygen-icons, strigi all Phonon packages to be able to manage video files, and qca to export on the web.

In qt group all is of course mandatory to compile and run digiKam and whole KDE components.

win7-011 win7-012

In win32libs group, respect all shared libraries selected here, else Exiv2, kdegraphics/libs, digiKam, and kipi-plugins cannot be compiled.

win7-013 win7-014

After that, you can download and install packages. When all is done, check the option to run KDE system settings.

win7-015 win7-016

In KDE control Panel, go to General/Look and Feel/Appearance section and select Oxygen widget style.

Also, in Colors Settings section switch colors scheme to Wonto Soup. This last one improve contract between digiKam interface and photo and provide a pro-look to your favorite photo management program...

After to close KDE control center, restart your computer to stop all KDE sub-process started in background, and to be able to install MinGW properly in your computer.

Stage 2: Install MinGw development environment for Windows

win7-017 win7-018

To compile source code, we needs to download and install MinGW environment on your computer. MinGW project page is there.

Download page is hosted by Sourceforge.net. We will use Automated MinGW Installer.

win7-019 win7-020

You will install current version on MinGW. Select right components: base tools, g++ compiler, and make

win7-021 win7-022

Install MinGW at the same place than KDE4: E:\kde4-mingw.

When all done, you need to tune some internal settings...

Stage 3: Install additional development tools for Windows

win7-023 win7-024

The first tool that we will need to checkout code from KDE subversion repository is TortoiseSVN. The page to download this program is there. Install it to you windows partition C: at usual place with all default settings.

win7-025 win7-026

The second tool that we will need to configure compilation environment is CMake. The page to download this program is there. Install it to you windows partition C: at usual place. Set up installer to register CMake install path for all users.

win7-042 win7-041

The last tool to install is subversion command line tool. The page to download this program is there. Install it to you windows partition C: at usual place with all default settings.

Stage 4: Set-up Your System To Compile

win7-027 win7-028

This part is very important, else you will not be able to compile and link source code on your computer. In first, go to My Computer control panel and Advanced section, and go to Environment Variables setup dialog to. Also patch PATH entry with this value: ;E:\kde4-mingw\bin. You need to close your current Windows session to set on these values.

Another important task is to patch some CMake scripts installed in KDE which use a wrong default KDE install dir.

win7-029

Files are installed in E:\kde4-mingw\share\apps\cmake\modules. Just use Kate editor (available in E:\kde4-mingw\bin) and open these files: KDELibsDependencies.cmake, KDELibs4LibraryTargets-release.cmake.

Replace C:/kde/kde-mingw4-stable by E:/kde4-mingw.

Finaly, i recommend to make a copy of E:\kde4-mingw\bin\mingw32-make.exe to E:\kde4-mingw\bin\make.exe to just only type make on the console (as under Linux).

Stage 5: Checkout Source Code From Subversion Repositories

win7-030 win7-031

It's time now to checkout source code from subversion repositories. For that, use Tortoise-svn tool integrated to Windows Explorer. It's very easy to use. Create a new folder to host code (here E:\devel-mingw) and download files using right subversion urls.

win7-032 win7-033

You need to checkout 3 components : the meta-data management library exiv2, all shared libs developed by digiKam team hosted in kdegraphics/libs, and extragear/graphics where digiKam and kipi-plugins can be found.

You can find all KDE subversion urls at this page. For Exiv2 subversion url, take a look at this page

win7-034 win7-035

When all source code is downloaded to your computer, just remove all unwanted sub-folders than you don't need to compile.

From kdegraphics directory, you just need to compile cmake and libs sub-dirs.

From graphics directory, you just need to compile cmake, doc, digikam and kipi-plugins sub-dirs.

Stage 6: Compile Source Code

win7-037 win7-036

Under Windows, I don't know a good open source alternative to Microsoft console. So you need to tune some settings to make it more user friendly. Go to console properties dialog and change historic to maximum. Also, i use Midnight Commander for Windows to navigate into my hard drive.

win7-038 win7-039

The first component to compile is Exiv2. Go to E:\kde4-mingw\exiv2 and copy at this place the digiKam bootstrap script available at E:\kde4-mingw\graphics\digikam\project\scripts\bootstrap.bat. Before to run it, check if KDE install path is fine. Just run it to initialize compilation environment. When it's done, run make and make install as under Linux.

win7-044 win7-043

The 2nd component to compile is kdegraphics. Go to E:\kde4-mingw\kdegraphics, use bootstrap.bat script, and compile/install libkdcraw, libkexiv2, and libkipi. Do the same in E:\kde4-mingw\graphics about digiKam and Kipi-plugins.

Stage 7: Running digiKam

win7-047 win7-048

Compilation can take a while. If all is fine, you will be able to run last version of digiKam. Go to your Startup Windows menu to find digiKam entry...

win7-049 win7-051

First-run assistant appear. Set-up your minimum digiKam configuration. digiKam will scan your collection. All is ready to play with it. Enjoy !

win7-052 win7-053

As under Linux version, all usual tools are there: Image editor, Batch Queue Manager, Light Table, and Camera Interface are there.

win7-054 win7-055

Kipi-plugins tool are also there, especially to export photos to your prefered web services.

Showfoto, the stand alone version of digiKam image editor is available too...

raw2dng.dir

The "make" on graphics aborts on% with following message:

CMakeFiles\raw2dng.dir\__\dngwriter\extra\dng_sdk\dng_image_writer.obj: file not recognized: File format not recognized collect2: ld returned 1 exit status
[bin/raw2dng.exe] Error 1
[kipi-plugins/dngconverter/test/CMakeFiles/raw2dng.dir/all] Error 2

There is no solution in the internet.

Are you sure to have enough

Are you sure to have enough space on your hard drive ? Sound like the output obj file is broken

Anyway, 'make clean' and 'make' into dngconverter dir must solve this problem.

Gilles Caulier

Bootstrap script requires modification

You didn't mention that if you're installing KDE and your dev root to different locations, the bootstrap bat script needs to be modified to point to the actual KDE install dir.

fixed thanks...

Fixed. thanks for your feedback...

bootstrap error

I get an error on Stage 6, step 2. When the .bat runs, it says:

-- Performing Test ICONV_COMPILES - Failed
-- Could NOT find ICONV (missing: ICONV_INCLUDE_DIR ICONV_COMPILES)
-- Could NOT find ZLIB (missing: ZLIB_INCLUDE_DIR ZLIB_COMPILES)
-- Could NOT find XPAT (missing: XPAT_INCLUDE_DIR)

The .bat seems to fall apart after that.

Any help would be greatly appreciated.

Shawn

It's clear. It cannot found

It's clear. It cannot found some development packages installed with shared libaries. 2 possibilities :

- You have forget to install development packages relevant. All can be installed with KDE-windows installer.
- You have forget to adapt the KDE install path in bootstrap script.

It's not at all clear

It's not exactly that clear, I have the same problem (using KDE 4.4.4, however), and I do have installed the necessary libraries and adapted the KDE install path. Have a look:


E:\devel-mingw\exiv2>bootstrap.bat
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: E:/kde/bin/gcc.exe
-- Check for working C compiler: E:/kde/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: E:/kde/bin/g++.exe
-- Check for working CXX compiler: E:/kde/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Performing Test ICONV_COMPILES
-- Performing Test ICONV_COMPILES - Failed
-- Could NOT find ICONV (missing: ICONV_INCLUDE_DIR ICONV_COMPILES)
-- Could NOT find ZLIB (missing: ZLIB_INCLUDE_DIR)
-- Could NOT find EXPAT (missing: EXPAT_INCLUDE_DIR)
CMake Error at config/ConfigureChecks.cmake:63 (MESSAGE):
missing library expat required for XMP
Call Stack (most recent call first):
CMakeLists.txt:75 (INCLUDE)


CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
EXPAT_INCLUDE_DIR (ADVANCED)
used as include directory in directory E:/devel-mingw/exiv2
ZLIB_INCLUDE_DIR (ADVANCED)
used as include directory in directory E:/devel-mingw/exiv2


-- Configuring incomplete, errors occurred!
E:\devel-mingw\exiv2>dir e:\kde\bin\libexpat.dll
Directory e:\kde\bin
26.07.2010 19:37 151'552 libexpat.dll
E:\devel-mingw\exiv2>dir e:\kde\bin\libiconv.dll
Directory e:\kde\bin
26.07.2010 19:36 33'868 libiconv.dll
E:\devel-mingw\exiv2>dir e:\kde\bin\zlib1.dll
Directory e:\kde\bin
26.07.2010 19:36 75'264 zlib1.dll
E:\devel-mingw\exiv2>echo %PATH%
E:\kde\bin;C:\CMake 2.8\bin;E:\kde\bin;E:\kde\plugins

Even explicitly setting the required paths of those supposedly missing libraries, who for some strange reasons reside in ..\kde\bin instead of ..\kde\lib, in the bootstrap.bat file as follows does not help the situation:


SET EXPAT_INCLUDE_DIR=%KDE4_INSTALL_DIR%\bin
SET ZLIB_INCLUDE_DIR=%KDE4_INSTALL_DIR%\bin

Any suggestions? I have tried to trace the call-chain of cmake, however it's a windy road ...

Thanks for any pointers
Roberto

Roberto, I've got exactly the

Roberto,

I've got exactly the same error messsage (except the different install-directories) until line

"-- Configuring incomplete, errors occurred!"

and was returned to the dos-promt: d:\kde\exiv2>_

and didn't get your other error messages.

Any ideas?

Cheers Wolfram

A wee bit further

G'day Wolfram

My first mistake was that I did not install the accompanying header files or development packages. Once I installed those, the configuration when pretty smoothly. However, after that the compilation did not work, or better yet, the linking failed, because in some of the cmake definitions in the call chain there was still a hard-coded and wrong library path which for the life of me I could not find. After a couple of hours I gave up and removed the whole setup. I will be waiting for someone to build a nice package for digikam, as I'd really like to use it on my Windows machine. I'd be willing to pay USD$50 for an installable package with a working Digikam Software under Windows. For now, I will remain with Adobe Lightroom 3, which is a very stable, albeit expensive, workhorse.

Take care
Roberto

How to get source code from subversion repositories

Bonjour Gilles.
Merci pour ce très, très grand didacticiel ! J'ai aimé beaucoup vos photos avec le texte français dans le didacticiel anglais. :)
Okay, just kidding; I can't possibly explain my problem in French. Anyway, I've worked through this process and everything was just fine until stage 5. See, I have no idea what most of this is for; I'm just following exactly your instructions because I want digikam. But in stage 5, I don't understand how to get the source code. In your photos for stage 5, I don't know how to get the "Checkout" window that shows the URL of the repository. I tried looking at the URL www.exiv2.org/download.html and I just didn't find anything that looks like the URL that shows in the "Checkout" window.
Can you please clarify what's going on in stage 5? I can't believe I got this far into this and now I'm stumped! J'attends avec impatience votre réponse. (J'ai quelques correspondantes française alors je connais juste un peu le français.)
Merci beaucoup.
John

Exiv2 svn url

In stage 5, subversion repository url is this one : svn://dev.exiv2.org/svn/trunk

Fine for you ?

Gilles Caulier

Well, I don't know what to do

Well, I don't know what to do with the URL. It looks like I'm supposed to put it in the Checkout window, but I don't know where the Checkout window comes from.

Okay, I see. My TortoiseSVN

Okay, I see. My TortoiseSVN wasn't working. I reinstalled it and I have the Checkout window now.

Another question about Stage 5

In the last paragraph in Stage 5, you say, "When all source code is downloaded to your computer, just remove all unwanted sub-folders than you don't need to compile." Why did we download all of them if we don't need all of them?

Thanks

one svn url to checkout...

because you checkout whole kdegraphics and extragear/graphics using 2 subversion urls. It's more easy to manage through windows GUI. Removing unnecessary folders will take few second with Windows explorer. Windows is not the best system to write script and use command line.

questiions about stage 6

hello again Gilles.
The stuff in stage 6 is all new to me, so I've had to do some reading. In the second paragraph, you say,"When it's done, run make and make install as under Linux." Well, I use Windows, not Linux, so I don't know what that means. I assume you're talking about running them in Midnight Commander.

Can you clarify how to follow your instructions concerning Midnight Commander? I'm not sure what your screenshots are showing.

Thanks

I tried to forge ahead and

I tried to forge ahead and figure out how to do things and I really don't know how it went. :)
I got the batch file changed to show the correct install directory but couldn't get it to run from within MC, so I ran it from within Windows. A console window came up and the batch ran, with quite a few failure messages, and then the window disappeared.
So, I don't know what's going on now... But I know I'm close... Help! :)
Thanks

Well, I got exiv2 compiled (I

Well, I got exiv2 compiled (I think). (I'm slogging through, a little bit at a time.)
When I tried to run bootstrap.bat on kdegraphics, I got failure messages "Could not find OpenMP_C_FLAGS and Open MP_CXX_FLAGS."
This seems like a similar problem to what Shawn had in another comment. Can you possibly tell me where those files are supposed to come from?

Thanks

Well, actually, when I tried

Well, actually, when I tried to run bootstrap.bat in kdegraphics, it says a LOT of files are missing:
SOPRANO_INCLUDE_DIR
SHAREDDESKTOPONTOLOGIES_ROOT_DIR
NEPOMUK_INCLUDE_DIR
and some others. Also it says, "fix the KFILE plugins for STRIGI-ANALYZER."

I tried to run bootstrap in the graphics folder also, and it also says a lot of files are missing. I thought I was getting everything okay as I went through your process, but obviously I wasn't. So unless you've got some idea where all my missing files are, I think I'm going to have to give up on digikam.

packages are missing

You need to install development packages for nepomuk : "soprano", "ontologies", and "strigi".

In windows installer you have a search bar where you can type package name. Just select "All" package list before.

OpenMP is not important here..

OpenMP is a GCC compiler extension to be able to execute code on multiprocessor. This is not an error, it's just a warnings. libkdcraw use this extension to demosaicke RAW files.

The reason that OpenMP is not available is about the GCC version installed on your computer. Current stable GCC form windows through MinGW project is 3.x version which do not include OpenMP.

create a windows shortcut to script...

... and set shortcut properties to don't close windows at end...

Anyway, you can run script under MC to just press enter under it...

open a windows console

Open a windows console (use 'cmd' command in Start/Execute menu) and go to right root rot where source code is hosted. Just entry "make" to compile. when it's done, type "make install" to install software on your computer...

Cannot compile due to libkipi

-- digiKam 1.4.0 dependencies results
--
-- Qt4 SQL module found..................... YES
-- MySQL Server found....................... YES
-- libtiff library found.................... YES
-- libpng library found..................... YES
-- libjasper library found.................. YES
-- liblcms library found.................... YES
-- libkipi library found.................... NO

And I cannot find libkipi in the windows installer, tried to compile it from svn as well but that failed due to missing CMakeLists.txt...
Any ideas?

btw, Thanks for an excellent guide!

Changing mirror to winkde.org

Changing mirror to winkde.org which updated a lot of the packages seems to have solved that issue...
Now I just gotta fix some problem with some path in some file:
make[2]: *** No rule to make target `U:/lib/libkdewin.dll.a', needed by `bin/Ext
ernalDraw.dll'. Stop.

Solved by changing some

Solved by changing some U:/... paths in KDELibsDependencies.cmake and KDELibs4LibraryTargets-release.cmake.

Look on stage 5...

Stage 5, screen-shot 5 : you checkout whole kdegraphics from KDE svn and you remove all subdirectory, expected "cmake" and "libs" and ALL files from root dir, where you will find the famous CMakeLists.txt.

You copy and run bootstrap dir at this place. This will prepare "libs" dir to be compiled, where is hosted libkipi.

Gilles Caulier

Thanks for taking time to

Thanks for taking time to reply but it seems to have been solved, when I changed mirror libkipi got installed so for now I do not have to compile it.

No member named 'setTiffThumbnail'

Next problem:

C:\devel-mingw\graphics2\digikam\libs\dimg\dimg.cpp:2194: error: 'class Digikam:
:DMetadata' has no member named 'setTiffThumbnail'
make[2]: *** [digikam/digikam/CMakeFiles/digikamcore.dir/__/libs/dimg/dimg.obj]
Error 1

Any ideas?

strange...

Rebuilt kdegraphics and now I could compile digikam... =)

However, I can't run it, get an error message saying that "usleep" cannot be found in the dynamic link library libkdewin.dll...

libkdewin.dll...

libkdewin.dll is installed on your system ? Which KDE release do you use ?

Gilles Caulier

4.4.4

I was trying on 4.4.4 but now I switched to 4.4.1 and it worked!

I confirm

With KDE 4.4.4, FindKDEWin.cmake script use "kdewind" and lib name to find on your system, which is weird. The right name is "kdewin".

Please report to KDE-windows using KDE bugzilla. Thanks in advance...

Gilles Caulier

Compiling

Heya!

i kinda got stuck at this part

From kdegraphics directory, you just need to compile cmake and libs sub-dirs.

From graphics directory, you just need to compile cmake, doc, digikam and kipi-plugins sub-dirs.

Allthough i am quite used to linux, i am not a commandline wizzard!! hope you can help me out here!
I really don't know how to compile all that :(

Look there...

http://lxr.kde.org/source/extragear/graphics/digikam/README#127

Step 6 issue

I do not have a bootstrap.bat file my exiv2 directory. I didnt delete anything either. Any ideas?

It's in source code from digiKam...

http://websvn.kde.org/trunk/extragear/graphics/digikam/project/scripts/

Stage 6 error : kdewin.lib missing

Hi,

I have compiled exiv2, but at stage 6, I get the following error :
[ 26%] Building CXX object libs/libkdcraw/libkdcraw/CMakeFiles/kdcraw.dir/__/libraw/src/libraw_c_api.obj
make[2]: *** No rule to make target `C:/kde/kde-vc90-stable/lib/kdewin.lib', needed by `bin/libkdcraw.dll'. Stop.
make[1]: *** [libs/libkdcraw/libkdcraw/CMakeFiles/kdcraw.dir/all] Error 2
make: *** [all] Error 2

Please help !

Stage 6 error : kdewin.lib missing

Some precisions : I have installed KDE 4.4.1. At stage 4, I have found and modified as required KDELibsDependencies.cmake but I didn't found KDELibs4LibraryTargets-release.cmake.

Stage 6 error : kdewin.lib missing

Still on holidays ? ;-))

kdewin

there is a package named kdewin to install. Try to use search field from KDE windows installer, if this package do not appears on the list.

Stage 6 error : kdewin.lib missing

Thanks. But I only see kdewin-mingw4 (which I have already installed). Is it the same ?

yes it is. There is no devel.

yes it is. There is no devel. package ?

I give up, did not succeed ;-((

Hi Gilles,

After several hard hours, I did not succeed compiling Digikam, although your tutorial is of high quality. Several different errors. I work in computer science and know quite well unix, but not linux, and there are too many things I don't know (pre-requisites) which prevent success for me. I give up ;-(

I was interested in 1.2+ version of digikam cause 1.1 has a bug which corrupt my NEF (Nikon) raw pictures(known bug on exiv2 0.18 version).
Could you tell me when a new *compiled* version will be available for Windows ?
Thanks a lot.
--
Denis

compile Exiv2 yourself ?

Why not to compile Exiv2 yourself. Exiv2 use now CMake which simplification configuration to prepare compilation env...

Gilles Caulier

May I have better chance

May I have better chance compiling exiv2 than compiling the whole digikam ? And how to be sure that a newer version of exiv2 (which one ?) will be compatible with digikam 1.1 ?

Finally succeed. Ouf ;-) May

Finally succeed. Ouf ;-)

May I give two points to be clarified on your tutorial :

- Stage 1 : as you said to John on Tue, 2010-07-13 09:54, the following packages for nepomuk are mandatory but not mentionned on your list : "soprano", "ontologies". This was my problem since the beginnning !

- Stage 6 : to compile component "graphics", file "bootstrap.bat" must be copied and launched on each sub-folders "digikam" and "kipi-plugins", whereas only one file is necessary on the root folder of component "kdegraphics" for the sub-folders "libkdcraw, libkexiv2, and libkipi"

After that, digikam 1.4 seems to work fine. Thanks very much for this tutorial.

Nobody there ?

Everybody is on holidays it seems ;-)

Windows Distribution Error for Digikam / Showfoto Error

I am trying to download a windows distribution using the windows installer for digikam and required projects. I am trying 4.4.4, 4.4.2, 4.4.0 and earlier releases. I have tried many mirrors. I am constantly getting an error message: "The download of { } failed with error: server configuration error - invalid download URL." It tends to be at file 40. If I ignore the error, the compilation completes, but any application launch fails.

Another issue: I was able one time to install Digikam - I cannot recall the release or mirror I used. However I deleted the installation to try again, because I experienced an error using Showfoto. The save and save as function was very slow (jpg, 6mb file) taking close to a minute to reach 99%. At that point, it failed. Any idea, what is that issue?

Vista-Home-64.