Stazed / non-mixer-xt

Reboot of Non Mixer with eXTended LV2 support, CLAP, VST(2) and VST3 support.
GNU General Public License v2.0
27 stars 6 forks source link

cmake doesn't check properly ntk in Debian Bookworm #25

Closed orlammd closed 9 months ago

orlammd commented 9 months ago

After git cloning ntk, and sucessfully installing it, cmake stops complaining that ntk is not installed. Commenting the two lines concerning ntk in the cmake conf files fix the problem, but then, it's not possible to build non-mixer-xt. ntk lays in /usr/include/ntk after an install using ./waf configure --prefix=/usr. Thank you.

Stazed commented 9 months ago

Not sure why cmake cannot find ntk, but you can edit the CMakeCache.txt file in the non-mixer-xt build directory to set the location of the ntk libraries. Below is what is in my ubuntu CMakeCache.txt for ntk:

//Path to a library. pkgcfg_lib_NTK_IMAGES_cairo:FILEPATH=/usr/lib/x86_64-linux-gnu/libcairo.so

//Path to a library. pkgcfg_lib_NTK_IMAGES_ntk:FILEPATH=/usr/local/lib/libntk.so

//Path to a library. pkgcfg_lib_NTK_IMAGES_ntk_images:FILEPATH=/usr/local/lib/libntk_images.so

//Path to a library. pkgcfg_lib_NTK_cairo:FILEPATH=/usr/lib/x86_64-linux-gnu/libcairo.so

//Path to a library. pkgcfg_lib_NTK_ntk:FILEPATH=/usr/local/lib/libntk.so

Also, I would suggest that you install ntk in /usr/local/ instead of /usr/ which is the default location for the package if not installed from the debian repository. Do ./waf uninstall first, then ./waf configure without the --prefix=/usr.

orlammd commented 9 months ago

Thanks for your answer. Adding those lines (adapting them to my own context) doesn't seem to fix it. The make fails at very beginning :

non-mixer-xt/FL/Fl_SliderX.C:100:19: error: ‘fl_color_add_alpha’ was not declared in this scope 100 | fl_color( fl_color_add_alpha( FL_WHITE, 127 )); | ^~~~~~ make[2]: [mixer/CMakeFiles/non-mixer-xt.dir/build.make:342 : mixer/CMakeFiles/non-mixer-xt.dir/__/FL/Fl_SliderX.C.o] Erreur 1 make[1]: [CMakeFiles/Makefile2:181 : mixer/CMakeFiles/non-mixer-xt.dir/all] Erreur 2 make: *** [Makefile:136 : all] Erreur 2

By the way, pkg-config --simulate ntk or pkg-config --simulate libntk doesn't find anything. By myself, ntk ends up in /usr/local/lib64... Don't know why (I did build non-mixer-xt something like 8 or 10 monthes ago).

Maybe the problem is from libntk's side.

orlammd commented 9 months ago

To go a bit further: orl@PortableORL:/usr/local/lib$ pkg-config --libs ntk -L/usr/local/lib -lntk -lcairo orl@PortableORL:/usr/local/lib$ pkg-config --modversion ntk 1.3.1001

Please note it's the same on 3 different machines, with a Debian bookworm uptodate, so it's probably not a local problem.

orlammd commented 9 months ago

OK, I finally got it. I did link the ntk so files from /usr/local/lib64/ to /usr/local/lib/ and also the pkg-config directory. It allows me to pass the cmake step, but it always fails on build with that fl_add_color_alpha which is not declared in this scope.

Stazed commented 9 months ago

I just noticed that Debian bookworm was just released February 10. I have run into this problem with other distributions and running the very latest releases. Seems some environment variables ( PKG_CONFIG_PATH) can be missed with the initial releases. That is why I wait a few months before trying the latest...

If it passes cmake with link but does not build, then you might try ntk with ./waf configure --prefix=/usr/local/. Linking probably works for cmake because it finds the .so, but fails on build because the .so is still pointing to /usr/local/lib64/. You just need to find the correct location to install ntk and append the PKG_CONFIG_PATH to the location. Also check what the CMakeCache.txt file is showing to be sure of the location.

orlammd commented 9 months ago

OK, I'm going to try this. There's something I don't get, still: the failure occurs on Fl_SliderX.C, but FL/fl_draw.H is already called and used in Fl_ValueSlider.C which doesn't fail. Even if Fl_ValueSlider.C doesn't use that fl_color_add_alpha method, it suggest that the library is correctly linked at that point, isn't it?

Could it be problematic that I have fltk installed also?

orlammd commented 9 months ago

OK, this time, I got it, and it was my fault: in my many manipulations, I forgot to uncomment the two lines concerning ntk in the CMakeLists.txt. So to get it working, you just have to set PKG_CONFIG_PATH=/usr/local/lib64/pkg-config before cmake. Thank you for your time.