![]() Registered Member ![]()
|
I took some time to try compiling Krita3.0 on Windows this week. Here is the record my experience so that others would have smoother experiences.
I did it without emerge. (for reference, there is an existing topic on compiling Krita on Windows with Emerge viewtopic.php?f=281&t=125861) Anyway, tl,dr version first: - See https://github.com/KDE/krita/tree/master/3rdparty - this guide is basically working fine, follow it to compile Krita on Windows. - Patch error -> Convert .diff, .patch files' line breaks from LF to CRLF - ext_boost seems to be a bit tricky - International users(like me, my windows is Japanese locale) beware: Windows VC++ does not interpret a UTF-8 file as UTF-8 unless there is BOM - this can cause compile error(encoding error can corrupt double quotes at times). Resave the offending files with BOM to avoid this issue. (Or use English locale all the time? Or should I batch add BOM to all files?) 0. Get tools Got git, cmake 3.3.2, MSVC 2015 Community Edition, Python 2.7 as in the guide. Made sure PATH to include git, cmake, Python2.7 1. Make directories I created c:\dev and c:\dev\b, c:\dev\d, c:\dev\d I defined a new env var BUILDROOT as c:\dev 2. Qt I already had a Qt5.5.1 on my PC. I called its installer to install Qt source code and compiled Qt from command line. (I ran "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" first in command line) The configure command - I think I had to remove one of the module argument(which is not found on my PC somehow. I think it was webkit related)
After configure ran successfully, I think I did make and make install. 3. Externals build setup I moved to c:\dev\b, then set PATH as:
Then I ran
4. Building external packages It was basically doing this line for each packages. Complete list is in the guide.(https://github.com/KDE/krita/tree/master/3rdparty)
The first issue I hit was, patch error. patch does not seem to like LF linebreaks in .diff .patch files. I had to convert linebreaks for these files to CRLF in text editor(I use Notepad++) manually. I believe there are probably more automated way to doing so... The next issue was, ext_boost. It did not seem to compile well unless I emptied C:\dev\krita\3rdparty\ext_boost\CMakeLists.txt update command(UPDATE_COMMAND "") that copies the compiled libraries. Still not sure if that was a right thing to do. ext_ocio repeated ext_boost compile error as well. The thied issue was, I believe it's specific to non-English locale users. I use Japanese locale, and there, VC interprets files without BOM as ShiftJIS(a Japanese encoding), not UTF-8. This can cause loss of UTF-8 characters, and in worse, it can corrupt double quotes & cause compile errors. ext_framework especially caused this issue. I tried overwriting the offending file as UTF-8 BOM can fix it, but in ext_framework cmake overwrite the fixed file with original file, unpacking the package file. I workarounded this by temporally changing to locale to English when I cmake ext_framework. (Then I went back to original Japanese locale) 5. Build Krita With all ext libraries were ready, I created c:\dev\build, moved to the folder, and tried to build Krita. The command was the same as in the guide:
First, I had an error that I was missing boost. This was caused by not naming the boost .dll and .lib in C:\dev\i\lib correctly.(Probably caused by CMakeList.txt modification earlier) I think the expected names are: boost_system-vc140-mt-1_55.dll and boost_system-vc140-mt-1_55.lib With this, configuration worked fine. Then I did:
I hit several compile issues by BOM, each time I resaved the offending files with BOM. I had to repeat the above command several times to get Krita fully compiled. First time, it took about an hour to see the error result. In second and third times, the time got much faster. (I had the BOM issue with ListItemsHelper.cpp, kiswdgindexcolors.cpp, ListLevelChooser.cpp) 6. Run Krita From command line I moved to c:\dev\i\bin\ and run krita.exe from there. Krita ran. yay. I think English locale people would not hit BOM issues - so I assume the journey would be simpler in that case. Anyway I hope this log would be helpful. |
![]() Registered Member ![]()
|
Some extra notes.
- Qt...probably it's better to have Qt5.6 - Patch error workaround: use "git config --global core.autocrlf true" to have git autoconvert the linebreaks - ext_boost makefile issue should be fixed by now And I repeat it's always good to check README.md: https://github.com/KDE/krita/tree/master/3rdparty |
![]() Registered Member ![]()
|
So, I have no idea if I'll ever get to tinkering around with the code but I wanted to say thanks for this! Just curious - why is Python needed?
Also I haven't seen the --config before, is that another way to specify the build type? Does Krita not use CMAKE_BUILD_TYPE? |
![]() KDE Developer ![]()
|
Thanks for this log. One thing that might help speed up the last step is to compile Krita with parallel make. Instead of -G"Visual Studio" you can use -G"Ninja" to use ninja or -G"NMake Makefiles JOM" to use jom.
|
Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]