Contact
Département d'informatique
Université du Québec à Montréal
CP 8888, Succ. Centre-ville
Montréal (Québec) H3C 3P8
Phone: 514-987-3000, #5516
Office: PK-4525
Email: blondin_masse[dot]alexandre
[at]uqam[dot]ca
About
I have completed my Ph.D. in mathematics and computer science under the supervision of Professors Srecko Brlek, from Université du Québec à Montréal, in Canada, and Laurent Vuillon, from Université de Savoie, in France.Since August 1st, 2014, I'm a regular assistant-professor at Université du Québec à Montréal, in Canada.
Links
- My profile on Google Scholar
- My GitLab repositories
- My Bitbucket repositories
- My Github repositories
Building Krita on OSX
On 12/28/2016 by Alexandre Blondin Massé
I recently discovered an open-source painting software called Krita. In my case, it turns out to be a very interesting companion software for Blender for creating textures. I intend to write about these two softwares in the future, but this post is focused on my experience when building Krita on my MacBook Pro.
Krita's support on OSX
Krita is officially supported on the three major operating systems (Windows, Linux and MacOS). I haven't tried neither the Linux version nor the Windows one, so that I can't comment on how good it works on them. On OSX, however, I'm pretty satisfied with what I get compared with other open source solutions I tried.
I recently bought a graphic tablet (Wacom Intuos). This is the first time I experiment with such a tool. I first tried using it in Gimp (which is a very nice software by the way), but it turned to be quite complex to setup and, even after that, the result was very disappointing. When I discovered Krita and tried it, I became familiar with the basic operations very quickly, and I could produce nice art (I'm just a beginner artist, so what I really mean is that I could get results similar to those I get on paper with a pencil, which is the best I can hope for).
One caveat, though, is that Krita crashes from time to time. Since I prefer by far relying on open source softwares in general, even if they are not as stable as one would like, I decided I would try to fix these bugs instead of using a propritary software such as Photoshop. Even if Krita, on its homepage, mentions that it should not be considered as a replacement of Photoshop, in my case, it seems to be a good one!
From there, I started trying to build Krita from source. I discovered that it was not easy: The building process on OSX is not very mature (it's more complex than just typing ./configure, make, sudo make install) and I had to fix many little things to make everything work. Fortunately, I went on the #krita channel on freenode.net and there were friendly people there that made the process less painful.
My setup
Just before I show what I did, I would like to describe my setup since it is probably different from yours:
-
I use a MacBook Pro with Yosemite 10.10.5;
-
I use Macports, so that I don't have Homebrew (it's not a good idea to use them together);
-
I had already installed the dependencies mentioned for the build:
The first two dependencies come with XCode, and the last one was installed with MacPorts.
-
I would like to add that I have many other softwares installed so that you might encounter another dependency that I am not aware of.
Cloning the repo
This step is easy. I located the clone in the ~/Applications/krita folder (which was created manually). Then, I typed
git clone https://anongit.kde.org/krita
(Notice that there is a krita folder inside the "root" krita folder, which can be confusing but at least, each folder remains clean during the build.) You might as well already create four additional folders that will be used later:
mkdir b d i build
Therefore, the content of ~/Applications/krita should be
$ ls b build d i krita
Each folder is used for a different purpose:
- b for building the dependencies;
- d for downloading files used in building the dependencies;
- i for the installation of the dependencies;
- build for Krita's build.
From now, most of the steps I followed can be found in the file krita/3rdparty/README.md.
Building Krita's dependencies
Before starting this part, it is convenient to define two environment variables that will be used through the whole installation. Assuming that you are still in ~/Applications/krita, I just typed
export BUILD_ROOT=`pwd`
Then I entered the b directory:
cd b
And I ran CMake:
export PATH=$BUILD_ROOT/i/bin cmake ../krita/3rdparty/ -DCMAKE_INSTALL_PREFIX=$BUILD_ROOT/i \ -DEXTERNALS_DOWNLOAD_DIR=$BUILD_ROOT/d -DINSTALL_ROOT=$BUILD_ROOT/i
Next, you might try building all dependencies at once. Note that the first one (ext_qt) might be very long to download and build):
cmake --build . --config RelWithDebInfo --target ext_qt cmake --build . --config RelWithDebInfo --target ext_zlib cmake --build . --config RelWithDebInfo --target ext_boost cmake --build . --config RelWithDebInfo --target ext_eigen3 cmake --build . --config RelWithDebInfo --target ext_exiv2 cmake --build . --config RelWithDebInfo --target ext_fftw3 cmake --build . --config RelWithDebInfo --target ext_ilmbase cmake --build . --config RelWithDebInfo --target ext_jpeg cmake --build . --config RelWithDebInfo --target ext_lcms2 cmake --build . --config RelWithDebInfo --target ext_ocio cmake --build . --config RelWithDebInfo --target ext_openexr cmake --build . --config RelWithDebInfo --target ext_png cmake --build . --config RelWithDebInfo --target ext_tiff cmake --build . --config RelWithDebInfo --target ext_gsl cmake --build . --config RelWithDebInfo --target ext_vc cmake --build . --config RelWithDebInfo --target ext_libraw cmake --build . --config RelWithDebInfo --target ext_kwindowsystem
Also, in my case, contrary to what is mentioned in the README.md file, building openexr did not fail. Finally, the last step took me some time to figure out since some URLs were not updated (this should be fix now).
Building Krita
Now, enter the build directory. Then type:
cmake ../krita -DCMAKE_INSTALL_PREFIX=$BUILD_ROOT/i -DDEFINE_NO_DEPRECATED=1 \ -DBUILD_TESTING=OFF -DKDE4_BUILD_TESTS=OFF -DPACKAGERS_BUILD=ON \ -DBUNDLE_INSTALL_DIR=$BUILD_ROOT/i/bin -DCMAKE_BUILD_TYPE=RelWithDebInfo
And finally (do not put sudo in front of make install):
make make install
Running Krita
If everything went all right, you should find the executable in
$BUILD_ROOT/i/bin/krita.app/Contents/MacOS/krita