openAVproductions / openAV-Luppp

Luppp is a live performance tool, created by OpenAV productions.
http://openavproductions.com/luppp
GNU General Public License v3.0
259 stars 45 forks source link

Build error with cairo not found #183

Closed Animtim closed 7 years ago

Animtim commented 7 years ago

Hi, I'm trying to build Luppp on mageia cauldron, but I have build errors caused by cairo stuff not found apparently. When launching ./compile.sh, during the configure part, it seems to find cairo and I can confirm the devel package is also installed: -- Found PkgConfig: /bin/pkg-config (found version "0.29.1") -- Checking for module 'cairo' -- Found cairo, version 1.14.8 -- Checking for module 'ntk' -- Found ntk, version 1.3.0 -- Checking for module 'liblo' -- Found liblo, version 0.28 -- Checking for module 'jack' -- Found jack, version 1.9.10 -- Checking for module 'sndfile' -- Found sndfile, version 1.0.27 -- Checking for module 'samplerate' -- Found samplerate, version 0.1.9 -- Checking for module 'x11' -- Found x11, version 1.6.5 -- Configuring done -- Generating done

But then, during the build, it fails with hundreds of lines containing "error : 'cairo_something' was not declared in this scope"... Do you have an idea how to fix it?

(Note: ntk is not yet in mageia repository; I have ntk 1.3.0 packaged locally, and will probably push it in the repo at some point when pushing another package that requires it, maybe for luppp :) I don't think it matters for this bug, but in case you or someone want to test building on this distro, I can share the ntk spec.)

harryhaaren commented 7 years ago

Hi Animtim,

Would you search for packages with cairo in the name? For example, on Debian based systems I'd do this:

$ apt-cache search libcairo | grep "dev"
libcairo2-dev - Development files for the Cairo 2D graphics library
libcairomm-1.0-dev - C++ wrappers for Cairo (development files)

Then please check to make sure that the libcairo-dev libraries are all installed - also check the cairomm (C++ versions. They shouldn't be required, but perhaps there's a packaging mishap here somewhere, so better to try :)

Apart from that, it looks like you've done the right things... if there is still an error, please paste a small example (use the triple backtick ` character to paste code :) -Harry

Animtim commented 7 years ago

I did search for cairo dev packages, here's the result:

$ urpmq -Y cairo | grep "dev"
cairo-dock-devel
lib64cairo-devel   
lib64cairo-static-devel  
lib64cairomm1.0-devel
lib64harbour-cairo-devel
lib64svg-cairo-devel
libcairo-devel
libcairo-static-devel
libcairomm1.0-devel
libharbour-cairo-devel
libsvg-cairo-devel
ocaml-cairo-devel
python-cairo-devel
python3-cairo-devel
ruby-cairo-devel

I have all the lib64cairo*- installed, devel included (they were already installed, I only added the static one, which made no difference).

Here is an example with the beginning of the error log:

Scanning dependencies of target luppp
[  4%] Building CXX object src/CMakeFiles/luppp.dir/audiobuffer.cxx.o
[  4%] Building CXX object src/CMakeFiles/luppp.dir/controllerupdater.cxx.o
[  7%] Building CXX object src/CMakeFiles/luppp.dir/debug.cxx.o
[  9%] Building CXX object src/CMakeFiles/luppp.dir/diskreader.cxx.o
[ 12%] Building CXX object src/CMakeFiles/luppp.dir/diskwriter.cxx.o
In file included from /home/myHome/soft/openAV-Luppp/src/goptions.hxx:37:0,
                 from /home/myHome/soft/openAV-Luppp/src/gui.hxx:28,
                 from /home/myHome/soft/openAV-Luppp/src/diskreader.cxx:29:
/home/myHome/soft/openAV-Luppp/src/avtk/avtk_button.h: Dans la fonction membre ‘virtual void Avtk::Button::draw()’:
/home/myHome/soft/openAV-Luppp/src/avtk/avtk_button.h:102:4: erreur : ‘cairo_t’ was not declared in this scope
    cairo_t *cr = Fl::cairo_cc();
    ^
/home/myHome/soft/openAV-Luppp/src/avtk/avtk_button.h:102:13: erreur : ‘cr’ was not declared in this scope
    cairo_t *cr = Fl::cairo_cc();
             ^
/home/myHome/soft/openAV-Luppp/src/avtk/avtk_button.h:102:18: erreur : ‘cairo_cc’ is not a member of ‘Fl’
    cairo_t *cr = Fl::cairo_cc();
                  ^
/home/myHome/soft/openAV-Luppp/src/avtk/avtk_button.h:104:19: erreur : ‘cairo_save’ was not declared in this scope
    cairo_save( cr );
                   ^
harryhaaren commented 7 years ago

Aahhh this makes a bit more sense. It looks like (somehow) NTK isn't being picked up, and FLTK (which NTK is based on) is... is that possible?

When you packaged NTK yourself, did you install the .pc file in /usr/local/ or /usr/? Also please provide the output of themakecommand with theverboseflag, which should provide the whole compile command with all its details: make VERBOSE=1`

Hopefully that helps to identify the root issue. Its late here (irish time) so I'll have to leave this tomorrow if its not obvious after this one! Cheers, -Harry

Animtim commented 7 years ago

Ah, indeed that's possible :) ntk.pc file is installed in /usr/lib64/pkgconfig

here is the log (beginning and end at least) with verbose:

-- Architecture:  x86_64
-- Configuring done
-- Generating done
-- Build files have been written to: /home/myHome/soft/zik/openAV-Luppp/build
/usr/bin/cmake -H/home/myHome/soft/zik/openAV-Luppp -B/home/myHome/soft/zik/openAV-Luppp/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/myHome/soft/zik/openAV-Luppp/build/CMakeFiles /home/myHome/soft/zik/openAV-Luppp/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1] : on entre dans le répertoire « /home/myHome/soft/zik/openAV-Luppp/build »
make -f src/CMakeFiles/luppp.dir/build.make src/CMakeFiles/luppp.dir/depend
make[2] : on entre dans le répertoire « /home/myHome/soft/zik/openAV-Luppp/build »
cd /home/myHome/soft/zik/openAV-Luppp/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/myHome/soft/zik/openAV-Luppp /home/myHome/soft/zik/openAV-Luppp/src /home/myHome/soft/zik/openAV-Luppp/build /home/myHome/soft/zik/openAV-Luppp/build/src /home/myHome/soft/zik/openAV-Luppp/build/src/CMakeFiles/luppp.dir/DependInfo.cmake --color=
Dependee "/home/myHome/soft/zik/openAV-Luppp/src/version.hxx" is newer than depends file "/home/myHome/soft/zik/openAV-Luppp/build/src/CMakeFiles/luppp.dir/depend.internal".
Clearing dependencies in "/home/myHome/soft/zik/openAV-Luppp/build/src/CMakeFiles/luppp.dir/depend.make".
Scanning dependencies of target luppp
make[2] : on quitte le répertoire « /home/myHome/soft/zik/openAV-Luppp/build »
make -f src/CMakeFiles/luppp.dir/build.make src/CMakeFiles/luppp.dir/build
make[2] : on entre dans le répertoire « /home/myHome/soft/zik/openAV-Luppp/build »
[  2%] Building CXX object src/CMakeFiles/luppp.dir/diskwriter.cxx.o
cd /home/myHome/soft/zik/openAV-Luppp/build/src && /bin/c++    -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libxml2 -I/usr/include/libdrm -I/usr/local/include/ntk  -g -Wall -Wno-unused-variable  -O3 -msse2   -o CMakeFiles/luppp.dir/diskwriter.cxx.o -c /home/myHome/soft/zik/openAV-Luppp/src/diskwriter.cxx
[  4%] Building CXX object src/CMakeFiles/luppp.dir/diskreader.cxx.o
cd /home/myHome/soft/zik/openAV-Luppp/build/src && /bin/c++    -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libxml2 -I/usr/include/libdrm -I/usr/local/include/ntk  -g -Wall -Wno-unused-variable  -O3 -msse2   -o CMakeFiles/luppp.dir/diskreader.cxx.o -c /home/myHome/soft/zik/openAV-Luppp/src/diskreader.cxx
In file included from /home/myHome/soft/zik/openAV-Luppp/src/goptions.hxx:37:0,
                 from /home/myHome/soft/zik/openAV-Luppp/src/gui.hxx:28,
                 from /home/myHome/soft/zik/openAV-Luppp/src/diskreader.cxx:29:
/home/myHome/soft/zik/openAV-Luppp/src/avtk/avtk_button.h: Dans la fonction membre ‘virtual void Avtk::Button::draw()’:
/home/myHome/soft/zik/openAV-Luppp/src/avtk/avtk_button.h:102:4: erreur : ‘cairo_t’ was not declared in this scope
    cairo_t *cr = Fl::cairo_cc();
    ^
/home/myHome/soft/zik/openAV-Luppp/src/avtk/avtk_button.h:102:13: erreur : ‘cr’ was not declared in this scope
    cairo_t *cr = Fl::cairo_cc();
             ^
/home/myHome/soft/zik/openAV-Luppp/src/avtk/avtk_button.h:102:18: erreur : ‘cairo_cc’ is not a member of ‘Fl’
    cairo_t *cr = Fl::cairo_cc();
                  ^
/home/myHome/soft/zik/openAV-Luppp/src/avtk/avtk_button.h:104:19: erreur : ‘cairo_save’ was not declared in this scope
    cairo_save( cr );
                   ^
/home/myHome/soft/zik/openAV-Luppp/src/avtk/avtk_button.h:106:44: erreur : ‘cairo_rectangle’ was not declared in this scope

...

/home/myHome/soft/zik/openAV-Luppp/src/avtk/avtk_sidechain_gain.h:198:30: erreur : ‘CAIRO_LINE_CAP_BUTT’ was not declared in this scope
     cairo_set_line_cap ( cr, CAIRO_LINE_CAP_BUTT);
                              ^
/home/myHome/soft/zik/openAV-Luppp/src/avtk/avtk_sidechain_gain.h:198:49: erreur : ‘cairo_set_line_cap’ was not declared in this scope
     cairo_set_line_cap ( cr, CAIRO_LINE_CAP_BUTT);
                                                 ^
/home/myHome/soft/zik/openAV-Luppp/src/avtk/avtk_sidechain_gain.h:202:22: erreur : ‘cairo_restore’ was not declared in this scope
    cairo_restore( cr );
                      ^
src/CMakeFiles/luppp.dir/build.make:134 : la recette pour la cible « src/CMakeFiles/luppp.dir/diskreader.cxx.o » a échouée
make[2]: *** [src/CMakeFiles/luppp.dir/diskreader.cxx.o] Erreur 1
make[2]: *** Attente des tâches non terminées....
src/CMakeFiles/luppp.dir/build.make:158 : la recette pour la cible « src/CMakeFiles/luppp.dir/diskwriter.cxx.o » a échouée
make[2]: *** [src/CMakeFiles/luppp.dir/diskwriter.cxx.o] Erreur 1
make[2] : on quitte le répertoire « /home/myHome/soft/zik/openAV-Luppp/build »
CMakeFiles/Makefile2:85 : la recette pour la cible « src/CMakeFiles/luppp.dir/all » a échouée
make[1]: *** [src/CMakeFiles/luppp.dir/all] Erreur 2
make[1] : on quitte le répertoire « /home/myHome/soft/zik/openAV-Luppp/build »
Makefile:127 : la recette pour la cible « all » a échouée
make: *** [all] Erreur 2
Animtim commented 7 years ago

Ok, not sure why it couldn't see my NTK installed, but I got it built and packaged. I adapted the spec from fedora to build luppp package on mageia cauldron, and here it built without error. I'll push the spec to the distro repostiory, so luppp will be available in mageia6 :)

By the way, while packaging, I noticed you don't have any icon for luppp yet? I can try to make a quick proposal if you want, since graphics creation is my main field ;) (and it would be better to package it than the cut black-circle icon found in fedora package...)

Animtim commented 7 years ago

Here is an svg icon proposal, tell me what you think about it: http://timotheegiet.com/temp/luppp.svg

Animtim commented 7 years ago

Oh, after looking better, I see you do have an icon now, though it's a small blurry png... Tell me if you like my proposal, else I can provide an svg based on your original png icon if you want.

Animtim commented 7 years ago

Luppp package officially in mageia cauldron repository :) Also I cleaned my ntk spec, so now I'm sure it's properly packaged and installed, but I still have the same error when trying to just build luppp simply without using the spec. Note, I have the same issue with fabla, so I also packaged and pushed it to mageia repo.

Also, note that we're using some sed lines to make packaging work (I found those when importing the specs from fedora), that can maybe give you some clue about the issue. http://svnweb.mageia.org/packages/cauldron/luppp/current/SPECS/luppp.spec?revision=1099130&view=markup http://svnweb.mageia.org/packages/cauldron/lv2-fabla/current/SPECS/lv2-fabla.spec?revision=1099201&view=markup

harryhaaren commented 7 years ago

Hi @Animtim,

That is a great icon, I'd be very happy to use it for Luppp! I'll file an issue to improve the icon, link back to your post here, and commit it into the repo :)

Mageia cauldon - great, and well done on figuring out the issues yourself! Those sed lines seem to change the CFLAGS variables - which are currently "hard-coded". To make the software more portable, these should only be added if the target CPU supports them.

Congrats on good work, and thanks again for that icon, its awesome! -Harry

Animtim commented 7 years ago

Cool, I'm happy you like the icon, thanks for using it! :) About my build issue, I'm getting closer to the clue. It's probably not related to the sed line I was talking about, but to ntk include dir. I noticed that adding hard-coded path of ntk includes in CMakeLists.txt does workaround the issue

include_directories( /usr/include/ntk ) 

Indeed, a message ("${NTK_INCLUDE_DIRS}") tells me it's looking by default in /usr/local/include/ntk . But I checked in ntk.pc, the path looks good there:

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: ntk
Description: Non ToolKit
Version: 1.3.0

Requires: cairo >= 1.9.0
Requires.private: x11 xft
Libs: -L${libdir} -lntk
Cflags: -I${includedir}/ntk -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
Animtim commented 7 years ago

Ok, we can close the bug, that was really a local issue, I had some old ntk*.pc files in /usr/local/lib/pkgconfig... Sorry for the false-bug. At least it motivated me to add the packages and make the icon ;) Thanks again for your fast answers!