This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Can't build Krita on macOS

Tags: None
(comma "," separated)
hahong
Registered Member
Posts
3
Karma
0

Can't build Krita on macOS

Tue Mar 12, 2019 3:32 am
Hello!
I am unable to build Krita on macOS. When following the instructions on the 3rdparty README.md, it stops when I reach building qt. This line specifically:
Code: Select all
cmake --build . --config RelWithDebInfo --target ext_qt

It creates directories, downloads, configures, and then builds, but never stops building. It just builds forever. It also shows this line:
Performing build step for 'ext_qt'


Does anyone know what the cause of this might be? I would love to help contribute to Krita macOS development, since I'm currently running into some bugs with my Wacom Intuos S BT that make it unusable.

Possibly useful info:
- macOS 10.14.3
- CMake 3.8.0
- Xcode 10.1
- Python 3.6.2 (no idea if that's useful, it looks like it's just for Windows)

I will gladly provide logs or other information that is needed!

I w
ghevan
Registered Member
Posts
178
Karma
1
OS

Re: Can't build Krita on macOS

Tue Mar 12, 2019 5:20 am
Hi!

Don't panic! the reason ext_qt stays for so long in "build step" for ext_qt is because Qt is a very large codebase and compiling it can take several hours. On my mac it takes at least 2 hrs (early 2015 MBP), but it can take much more depending on the processor and ram available.

I suggest you go grab a coffee or watch a movie while it builds qt, eventually it will finish :3

cheers!


hahong
Registered Member
Posts
3
Karma
0

Re: Can't build Krita on macOS

Sat Mar 16, 2019 11:53 pm
Ah yes, it looks like I was being too impatient for qt. Waiting worked!

Now, unfortunately, I'm still having problems building. After following the directions in the 3rdparty README a bunch of times and building quazip (it seems like it was required, despite not showing up in the README) I'm having an issue related to qgiflibhandler.

This happens when running `make`, at around 86 to 87 percent completion. This also happens when using the new osxbuild.sh file in packaging/macos/.

Here's a log of the error. I've changed all the pathnames in the log from my filesystem to BUILDROOT. Any help is greatly appreciated!

Scanning dependencies of target kritagifimport
[ 86%] Building CXX object plugins/impex/gif/CMakeFiles/kritagifimport.dir/kis_gif_import.cpp.o
[ 86%] Building CXX object plugins/impex/gif/CMakeFiles/kritagifimport.dir/qgiflibhandler.cpp.o
BUILDROOT/krita/plugins/impex/gif/qgiflibhandler.cpp:64:28: error: no matching
function for call to 'DGifOpen'
GifFileType* gifFile = DGifOpen(device(), doInput, &err);
^~~~~~~~
/Library/Frameworks/UnixImageIO.framework/Headers/gif_lib.h:188:14: note: candidate function not
viable: requires 2 arguments, but 3 were provided
GifFileType *DGifOpen(void *userPtr, InputFunc readFunc); /* new one
^
BUILDROOT/krita/plugins/impex/gif/qgiflibhandler.cpp:86:69: error: no member
named 'Error' in 'GifFileType'
qWarning("QGIFLibHandler::read: error %d", gifFile->Error);
~~~~~~~ ^
BUILDROOT/krita/plugins/impex/gif/qgiflibhandler.cpp:115:81: error: no member
named 'Error' in 'GifFileType'
qWarning("QGIFLibHandler::read: error %d", gifFile->Error);
~~~~~~~ ^
BUILDROOT/krita/plugins/impex/gif/qgiflibhandler.cpp:130:77: error: no member
named 'Error' in 'GifFileType'
qWarning("QGIFLibHandler::read: error %d", gifFile->Error);
~~~~~~~ ^
BUILDROOT/krita/plugins/impex/gif/qgiflibhandler.cpp:147:69: error: no member
named 'Error' in 'GifFileType'
qWarning("QGIFLibHandler::read: error %d", gifFile->Error);
~~~~~~~ ^
BUILDROOT/krita/plugins/impex/gif/qgiflibhandler.cpp:182:73: error: no member
named 'Error' in 'GifFileType'
qWarning("QGIFLibHandler::read: error %d", gifFile->Error);
~~~~~~~ ^
BUILDROOT/krita/plugins/impex/gif/qgiflibhandler.cpp:246:27: error: use of
undeclared identifier 'GifBitSize'; did you mean 'BitSize'?
int colorCount = 1 << GifBitSize(toWrite.colorCount());
^~~~~~~~~~
BitSize
/Library/Frameworks/UnixImageIO.framework/Headers/gif_lib.h:273:12: note: 'BitSize' declared here
extern int BitSize(int n);
^
BUILDROOT/krita/plugins/impex/gif/qgiflibhandler.cpp:272:24: error: no
matching function for call to 'EGifOpen'
GifFileType *gif = EGifOpen(device(), doOutput, &err);
^~~~~~~~
/Library/Frameworks/UnixImageIO.framework/Headers/gif_lib.h:139:14: note: candidate function not
viable: requires 2 arguments, but 3 were provided
GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc);
^
BUILDROOT/krita/plugins/impex/gif/qgiflibhandler.cpp:276:5: error: no matching
function for call to 'EGifSetGifVersion'
EGifSetGifVersion(gif, true);
^~~~~~~~~~~~~~~~~
/Library/Frameworks/UnixImageIO.framework/Headers/gif_lib.h:142:6: note: candidate function not
viable: requires single argument 'Version', but 2 arguments were provided
void EGifSetGifVersion(const char *Version);
^
BUILDROOT/krita/plugins/impex/gif/qgiflibhandler.cpp:280:62: error: no member
named 'Error' in 'GifFileType'
qWarning("EGifPutScreenDesc returned error %d", gif->Error);
~~~ ^
BUILDROOT/krita/plugins/impex/gif/qgiflibhandler.cpp:302:61: error: no member
named 'Error' in 'GifFileType'
qWarning("EGifPutImageDesc returned error %d", gif->Error);
~~~ ^
BUILDROOT/krita/plugins/impex/gif/qgiflibhandler.cpp:312:26: error: no member
named 'Error' in 'GifFileType'
int i = gif->Error;
~~~ ^
BUILDROOT/krita/plugins/impex/gif/qgiflibhandler.cpp:317:5: error: no matching
function for call to 'EGifCloseFile'
EGifCloseFile(gif, &err);
^~~~~~~~~~~~~
/Library/Frameworks/UnixImageIO.framework/Headers/gif_lib.h:166:5: note: candidate function not
viable: requires single argument 'GifFile', but 2 arguments were provided
int EGifCloseFile(GifFileType * GifFile);
^
13 errors generated.
make[2]: *** [plugins/impex/gif/CMakeFiles/kritagifimport.dir/qgiflibhandler.cpp.o] Error 1
make[1]: *** [plugins/impex/gif/CMakeFiles/kritagifimport.dir/all] Error 2
make: *** [all] Error 2
ghevan
Registered Member
Posts
178
Karma
1
OS

Re: Can't build Krita on macOS

Sun Mar 17, 2019 3:45 am
Hi!

Good to know yo made it trough Qt :D. now the error you are getting

Im no expert but reading the error you provided it clear your environment searchs for gif_lib.h first in /Library/Frameworks/UnixImageIO.framework/Headers/ instead of BUILDROOT/lib which causes a wrong header file to be included, same name but probably different versions, packages forks, who knows what UnixImageIO framework was based on, and when you installed it (I don't have it).

OSX searchs for includes and libs using frameworks n /Libraries/Frameworks, ~/Library/Frameworks, and other standar places. For what I see "UnixImageIO.framework" happens to have the gif_lib header of another version of giflib, but sinice clang found a "gif_lib.h" it stops searching for other places.

You can check your include environment with th efollowing command
Code: Select all
clang -x c -v -E /dev/null


below the line
Code: Select all
#include <...> search starts here:

the include paths appear

setting environment variables LDFLAGS, CPPFLAGS, CFLAGS for compiling krita might be a solution for you as it will tell clang/gcc to look for the header in the directories you set those variables to be.

:]


hahong
Registered Member
Posts
3
Karma
0

Re: Can't build Krita on macOS

Mon Mar 25, 2019 9:05 pm
Thanks again for your help!

I still can't get the gif plugin to build, even after setting:
Code: Select all
export CPPFLAGS=-I${KIS_INSTALL_DIR}/include
export LDFLAGS=-L${KIS_INSTALL_DIR}/lib
export CFLAGS=-I${KIS_INSTALL_DIR}/include

in packaging/macos/osxbuild.sh, which I've used to build dependencies and build/install Krita. I get the same errors outlined above.

The only way I can get Krita to build/install is to go into the krita/CMakeLists.txt and comment out:
Code: Select all
find_package(GIF)
set_package_properties(GIF PROPERTIES
    DESCRIPTION "Library for loading and saving gif files."
    URL "http://giflib.sourceforge.net/"
    TYPE OPTIONAL
    PURPOSE "Required by the Krita GIF filter")

This makes it build and install wonderfully with the build script, but obviously removes a lot of gif functionality.

Is there something I'm missing? Thank you!

EDIT: Also, it does appear that the include directory should be in the correct order. The output is:
Code: Select all
#include <...> search starts here:
 /Users/haydenhong/gits/krita/i/include
 .
 /usr/local/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /usr/include
 /System/Library/Frameworks (framework directory)
 /Library/Frameworks (framework directory)
End of search list.

And /Users/haydenhong/gits/krita/i/include does have a file called gif_lib.h
ghevan
Registered Member
Posts
178
Karma
1
OS

Re: Can't build Krita on macOS

Sat Apr 06, 2019 5:12 pm
Hey, did you manage to fix your build problems? I updated the build script again after finding some bugs with it.

Your include paths looks weird to me. But im no macOS expert yet. I just find it weird that on the include paths macOS SDK is missing
Code: Select all
/Applications/Xcode.app/…/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk


to force rebuild giflib: delete depbuid/ext_giflib and try to build it again:
Code: Select all
osxbuild builddeps ext_giflib


btw: errors are logged into "builddeps_.log"


poduncan
Registered Member
Posts
1
Karma
0

Re: Can't build Krita on macOS

Sat Jul 04, 2020 10:49 pm
I was getting a similar error:
Code: Select all
[ 87%] Building CXX object plugins/impex/gif/CMakeFiles/kritagifimport.dir/qgiflibhandler.cpp.o
/Users/Philip/dev/krita/plugins/impex/gif/qgiflibhandler.cpp:64:28: error: no
      matching function for call to 'DGifOpen'
    GifFileType* gifFile = DGifOpen(device(), doInput, &err);
                           ^~~~~~~~
/Library/Frameworks/Mono.framework/Headers/gif_lib.h:188:14: note: candidate
      function not viable: requires 2 arguments, but 3 were provided
GifFileType *DGifOpen(void *userPtr, InputFunc readFunc);    /* new one
             ^
/Users/Philip/dev/krita/plugins/impex/gif/qgiflibhandler.cpp:86:69: error: no
      member named 'Error' in 'GifFileType'
                qWarning("QGIFLibHandler::read: error %d", gifFile->Error);
                                                           ~~~~~~~  ^
/Users/Philip/dev/krita/plugins/impex/gif/qgiflibhandler.cpp:114:81: error: no
      member named 'Error' in 'GifFileType'
  ...qWarning("QGIFLibHandler::read: error %d", gifFile->Error);
                                                ~~~~~~~  ^
/Users/Philip/dev/krita/plugins/impex/gif/qgiflibhandler.cpp:129:77: error: no
      member named 'Error' in 'GifFileType'
  ...qWarning("QGIFLibHandler::read: error %d", gifFile->Error);
                                                ~~~~~~~  ^
/Users/Philip/dev/krita/plugins/impex/gif/qgiflibhandler.cpp:146:69: error: no
      member named 'Error' in 'GifFileType'
                qWarning("QGIFLibHandler::read: error %d", gifFile->Error);
                                                           ~~~~~~~  ^
/Users/Philip/dev/krita/plugins/impex/gif/qgiflibhandler.cpp:181:73: error: no
      member named 'Error' in 'GifFileType'
                    qWarning("QGIFLibHandler::read: error %d", gifFile->Error);
                                                               ~~~~~~~  ^
/Users/Philip/dev/krita/plugins/impex/gif/qgiflibhandler.cpp:245:27: error: use
      of undeclared identifier 'GifBitSize'; did you mean 'BitSize'?
    int colorCount = 1 << GifBitSize(toWrite.colorCount());
                          ^~~~~~~~~~
                          BitSize
/Library/Frameworks/Mono.framework/Headers/gif_lib.h:273:12: note: 'BitSize'
      declared here
extern int BitSize(int n);
           ^
/Users/Philip/dev/krita/plugins/impex/gif/qgiflibhandler.cpp:271:24: error: no
      matching function for call to 'EGifOpen'
    GifFileType *gif = EGifOpen(device(), doOutput, &err);
                       ^~~~~~~~
/Library/Frameworks/Mono.framework/Headers/gif_lib.h:139:14: note: candidate
      function not viable: requires 2 arguments, but 3 were provided
GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc);
             ^
/Users/Philip/dev/krita/plugins/impex/gif/qgiflibhandler.cpp:275:5: error: no
      matching function for call to 'EGifSetGifVersion'
    EGifSetGifVersion(gif, true);
    ^~~~~~~~~~~~~~~~~
/Library/Frameworks/Mono.framework/Headers/gif_lib.h:142:6: note: candidate
      function not viable: requires single argument 'Version', but 2 arguments
      were provided
void EGifSetGifVersion(const char *Version);
     ^
/Users/Philip/dev/krita/plugins/impex/gif/qgiflibhandler.cpp:279:62: error: no
      member named 'Error' in 'GifFileType'
        qWarning("EGifPutScreenDesc returned error %d", gif->Error);
                                                        ~~~  ^
/Users/Philip/dev/krita/plugins/impex/gif/qgiflibhandler.cpp:301:61: error: no
      member named 'Error' in 'GifFileType'
        qWarning("EGifPutImageDesc returned error %d", gif->Error);
                                                       ~~~  ^
/Users/Philip/dev/krita/plugins/impex/gif/qgiflibhandler.cpp:316:26: error: no
      member named 'Error' in 'GifFileType'
            int i = gif->Error;
                    ~~~  ^
/Users/Philip/dev/krita/plugins/impex/gif/qgiflibhandler.cpp:321:5: error: no
      matching function for call to 'EGifCloseFile'
    EGifCloseFile(gif, &err);
    ^~~~~~~~~~~~~
/Library/Frameworks/Mono.framework/Headers/gif_lib.h:166:5: note: candidate
      function not viable: requires single argument 'GifFile', but 2 arguments
      were provided
int EGifCloseFile(GifFileType * GifFile);
    ^
13 errors generated.
make[2]: *** [plugins/impex/gif/CMakeFiles/kritagifimport.dir/qgiflibhandler.cpp.o] Error 1
make[1]: *** [plugins/impex/gif/CMakeFiles/kritagifimport.dir/all] Error 2
make: *** [all] Error 2

In my case, the /Library/Frameworks/Mono.framework/Headers/ include path was coming from the following lines in CMakeLists.txt, which I commented out:
Code: Select all
if (APPLE)
    # this is not added correctly on OSX -- see https://forum.kde.org/viewtopic.php?f=139&t=101867&p=221242#p221242
    include_directories(SYSTEM ${PNG_INCLUDE_DIR})
endif()

This fixes the build without sacrificing gif functionality. Not sure about any consequences of removing the png include lines though.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Evergrowing, Google [Bot], rblackwell