lighttroupe / luz

Live motion graphics editor and performer.
GNU General Public License v2.0
37 stars 4 forks source link

fail to compile on gentoo #17

Closed domichel closed 7 months ago

domichel commented 7 months ago

I get several errors:

1:

$ make
for dir in input-manager spectrum-analyzer; do make -C $dir all; done
make[1]: Entering directory '/home/dom/softs/Luz/input-manager'
gcc -o input-manager *.cc -DSUPPORT_TABLET -DSUPPORT_MIDI -DSUPPORT_WIIMOTE -DSUPPORT_JOYSTICK -pthread -lcwiid -lportmidi -lporttime -lstdc++ -lXi -lX11 -I/usr/include/xorg/ `pkg-config gtkmm-2.4 unique-1.0 liblo sdl2 --cflags --libs`
In file included from input-manager-window.h:9,
                 from input-manager-window.cc:4:
input-wiimote.h:3:18: fatal error: cwiid.h: No such file or directory
    3 |         #include <cwiid.h>
      |                  ^~~~~~~~~
compilation terminated.
In file included from input-manager-window.h:9,
                 from input-manager.cc:5:
input-wiimote.h:3:18: fatal error: cwiid.h: No such file or directory
    3 |         #include <cwiid.h>
      |                  ^~~~~~~~~
compilation terminated.
input-tablet.cc: In member function ‘virtual bool InputTablet::update()’:
input-tablet.cc:174:1: warning: no return statement in function returning non-void [-Wreturn-type]
  174 | }
      | ^
In file included from input-wiimote.cc:2:
input-wiimote.h:3:18: fatal error: cwiid.h: No such file or directory
    3 |         #include <cwiid.h>
      |                  ^~~~~~~~~
compilation terminated.
input.cc: In function ‘void* input_update_in_thread_main(void*)’:
input.cc:46:1: warning: no return statement in function returning non-void [-Wreturn-type]
   46 | }
      | ^
make[1]: *** [Makefile:4: input-manager] Error 1
make[1]: Leaving directory '/home/dom/softs/Luz/input-manager'
make[1]: Entering directory '/home/dom/softs/Luz/spectrum-analyzer'
gcc -o spectrum-analyzer *.cc -lasound -lm -lstdc++ `pkg-config --cflags --libs fftw3 gl glu liblo gtkmm-2.4 gtkglextmm-1.2`
Package gtkglextmm-1.2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtkglextmm-1.2.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtkglextmm-1.2', required by 'virtual:world', not found
audio-sampler.cc: In member function ‘bool AudioSampler::Open(const char*)’:
audio-sampler.cc:79:21: warning: control reaches end of non-void function [-Wreturn-type]
   79 |         m_fftw_plan = fftw_plan_r2r_1d(m_frame_size, m_sample_buffer_double_in, m_sample_buffer_double_out, FFTW_REDFT00, FFTW_MEASURE);                // FFTW_HC2R  FFTW_DHT
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from my-drawing-area.cc:1:
my-drawing-area.h:1:10: fatal error: gtkmm.h: No such file or directory
    1 | #include <gtkmm.h>
      |          ^~~~~~~~~
compilation terminated.
spectrum-analyzer-window.cc:3:10: fatal error: gtkglmm.h: No such file or directory
    3 | #include <gtkglmm.h>
      |          ^~~~~~~~~~~
compilation terminated.
spectrum-analyzer.cc:6:10: fatal error: glibmm/timer.h: No such file or directory
    6 | #include <glibmm/timer.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
utils.cc:1:10: fatal error: gtkmm.h: No such file or directory
    1 | #include <gtkmm.h>
      |          ^~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:4: spectrum-analyzer] Error 1
make[1]: Leaving directory '/home/dom/softs/Luz/spectrum-analyzer'
make: *** [Makefile:10: all] Error 2

2:

I changed the following into input-manager/Makefile:

    gcc -o input-manager *.cc -DSUPPORT_TABLET -DSUPPORT_MIDI -DSUPPORT_JOYSTICK -pthread -lportmidi -lstdc++ -lXi -lX11 -I/usr/include/xorg/ `pkg-config gtkmm-2.4 unique-1.0 liblo sdl2 --cflags --libs`
#   gcc -o input-manager *.cc -DSUPPORT_TABLET -DSUPPORT_MIDI -DSUPPORT_WIIMOTE -DSUPPORT_JOYSTICK -pthread -lcwiid -lportmidi -lporttime -lstdc++ -lXi -lX11 -I/usr/include/xorg/ `pkg-config gtkmm-2.4 unique-1.0 liblo sdl2 --cflags --libs`

wiimote don't exist on gentoo and this was causing an error too, so I removed that option. -lporttime don't exist in my system. Not sure, I guess a part of portmidi on some systems.

$ pkg-config portmidi --libs --cflags
 -lportmidi

I get:

<snip>
make[1]: Leaving directory '/home/dom/softs/Luz/input-manager'
make[1]: Entering directory '/home/dom/softs/Luz/spectrum-analyzer'
gcc -o spectrum-analyzer *.cc -lasound -lm -lstdc++ `pkg-config --cflags --libs fftw3 gl glu liblo gtkmm-2.4 gtkglextmm-1.2`
Package gtkglextmm-1.2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtkglextmm-1.2.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtkglextmm-1.2', required by 'virtual:world', not found
audio-sampler.cc: In member function ‘bool AudioSampler::Open(const char*)’:
audio-sampler.cc:79:21: warning: control reaches end of non-void function [-Wreturn-type]
   79 |         m_fftw_plan = fftw_plan_r2r_1d(m_frame_size, m_sample_buffer_double_in, m_sample_buffer_double_out, FFTW_REDFT00, FFTW_MEASURE);                // FFTW_HC2R  FFTW_DHT
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from my-drawing-area.cc:1:
my-drawing-area.h:1:10: fatal error: gtkmm.h: No such file or directory
    1 | #include <gtkmm.h>
      |          ^~~~~~~~~
compilation terminated.
spectrum-analyzer-window.cc:3:10: fatal error: gtkglmm.h: No such file or directory
    3 | #include <gtkglmm.h>
      |          ^~~~~~~~~~~
compilation terminated.
spectrum-analyzer.cc:6:10: fatal error: glibmm/timer.h: No such file or directory
    6 | #include <glibmm/timer.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
utils.cc:1:10: fatal error: gtkmm.h: No such file or directory
    1 | #include <gtkmm.h>
      |          ^~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:4: spectrum-analyzer] Error 1
make[1]: Leaving directory '/home/dom/softs/Luz/spectrum-analyzer'
make: *** [Makefile:10: all] Error 2

x11-libs/gtkglext-1.2.0 is installed.

$ pkg-config gtkglext-1.0 --libs --cflags
-I/usr/include/gtkglext-1.0 -I/usr/lib64/gtkglext-1.0/include -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -pthread -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/lib64/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libpng16 -I/usr/include/webp -I/usr/include/fribidi -lgtkglext-x11-1.0 -lgdkglext-x11-1.0 -lGL -lGLU -lOpenGL -lXmu -lXt -lSM -lICE -lharfbuzz -Wl,--export-dynamic -lgmodule-2.0 -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lglib-2.0 -lgobject-2.0 -lpangoft2-1.0 -lpango-1.0 -lfontconfig -lfreetype

I changed spectrum-analyzer/Makefile:

    gcc -o spectrum-analyzer *.cc -lasound -lm -lstdc++ `pkg-config --cflags --libs fftw3 gl glu liblo gtkmm-2.4 gtkglext-1.0`
#   gcc -o spectrum-analyzer *.cc -lasound -lm -lstdc++ `pkg-config --cflags --libs fftw3 gl glu liblo gtkmm-2.4 gtkglextmm-1.2`

and now I get:

make[1]: Entering directory '/home/dom/softs/Luz/spectrum-analyzer'
gcc -o spectrum-analyzer *.cc -lasound -lm -lstdc++ `pkg-config --cflags --libs fftw3 gl glu liblo gtkmm-2.4 gtkglext-1.0`
audio-sampler.cc: In member function ‘bool AudioSampler::Open(const char*)’:
audio-sampler.cc:79:21: warning: control reaches end of non-void function [-Wreturn-type]
   79 |         m_fftw_plan = fftw_plan_r2r_1d(m_frame_size, m_sample_buffer_double_in, m_sample_buffer_double_out, FFTW_REDFT00, FFTW_MEASURE);                // FFTW_HC2R  FFTW_DHT
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from my-drawing-area.cc:1:
my-drawing-area.h:2:10: fatal error: gtkmm/gl/drawingarea.h: No such file or directory
    2 | #include <gtkmm/gl/drawingarea.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
spectrum-analyzer-window.cc:3:10: fatal error: gtkglmm.h: No such file or directory
    3 | #include <gtkglmm.h>
      |          ^~~~~~~~~~~
compilation terminated.
spectrum-analyzer.cc:29:10: fatal error: gtkmm/gl/init.h: No such file or directory
   29 | #include <gtkmm/gl/init.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.

In my system, drawingarea.h is in usr/include/gtkmm-2.4/gtkmm/drawingarea.h gtkglmm.h don't exist, and I don't know for init.h:

Partial output of 'locate init.h':

/usr/include/atkmm-1.6/atkmm/init.h
/usr/include/atkmm-1.6/atkmm/wrap_init.h
/usr/include/gdkmm-2.4/gdkmm/wrap_init.h
/usr/include/gtkglext-1.0/gdk/gdkglinit.h
/usr/include/gtkglext-1.0/gtk/gtkglinit.h
/usr/include/gtkmm-2.4/gtkmm/wrap_init.h

And I don't know what to do here.

lighttroupe commented 7 months ago

Thanks for your interest in Luz and this really good issue report.

I'm afraid I can't help with the build issues. Note that you don't need the Spectrum Analyzer, and you can do without the Input Manager (though you'll be limited to mouse and keyboard keys for input).

I've actually been working on Luz 3, built from scratch on the Godot game engine, so it naturally runs on Linux, OSX, Windows, and more. Very nice to not have to deal with porting at all. It's not released yet but will be soon.

Screenshot from 2024-04-07 23-42-10

domichel commented 7 months ago

Thanks for your fast answer.

I get the input manager to compile and it seam to work fine. I will need utils/video_file and it compiled fine. But Luz crash at startup:


 $ ./go
Using Ruby 3.2.3
Using SDL2 bindings version 0.3.6
/home/dom/softs/Luz/utils/sdl_application.rb:134: warning: undefining the allocator of T_DATA class SDL2::GL::Context
Running at 1920x1080 @ 0bpp, 60fps (max)
/home/dom/.local/share/gem/ruby/3.2.0/gems/syck-1.4.1/lib/syck.rb:142: warning: undefining the allocator of T_DATA class Syck::Node
/home/dom/softs/Luz/engine/engine/engine_images.rb:74:in `block in find_file_by_relative_path': undefined method `exists?' for File:Class (NoMethodError)

            File.exists?(p)
                ^^^^^^^^
Did you mean?  exist?
    from /home/dom/softs/Luz/engine/engine/engine_images.rb:73:in `each'
    from /home/dom/softs/Luz/engine/engine/engine_images.rb:73:in `find'
    from /home/dom/softs/Luz/engine/engine/engine_images.rb:73:in `find_file_by_relative_path'
    from /home/dom/softs/Luz/engine/engine/engine_images.rb:30:in `load_images'
    from /home/dom/softs/Luz/engine/engine/engine_images.rb:13:in `load_image'
    from /home/dom/softs/Luz/gui/gui_interface.rb:7:in `initialize'
    from /home/dom/softs/Luz/gui/gui_default.rb:27:in `initialize'
    from luz.rb:52:in `new'
    from luz.rb:52:in `block in <main>'
    from luz.rb:54:in `<main>'
lighttroupe commented 7 months ago

Congrats on getting it compiled. :)

It looks like you're using Ruby 3.2.3

It looks like Ruby 3.2 removed File.exists? in favor of File.exist? so you could try just removing that "s'. But there will likely be more changes needed. I recommend trying earlier Ruby versions. Any Ruby version before 3.2 should avoid that issue.

The last version I used with Luz 2 was Ruby 2.5.1, so that is known to work. The latest Ruby 2 version seems to be 2.7.8, so that might be worth a try.

domichel commented 7 months ago

The oldest gentoo ruby version is 3.1, and I have both 3.1 and 3.2 installed. After shifting to 3.1, Luz is running and the demo is working fine. Thank You for the good work.

Now, I am ready to follow the video tutorials. And how do I find utils/video_file in Luz?

lighttroupe commented 7 months ago

And how do I find utils/video_file in Luz?

That's a directory with more code to compile to be able to play videos.

domichel commented 7 months ago

I get the spectrum-analyzer to compile. The issue is that gtkglextm is outdated on gentoo, and as nothing depend on it into the main tree, it was removed. Is is possible to download an ebuild here: https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-cpp/gtkglextmm?id=deba87d7ea08f6e3457289c2df004f2afb65c510

EDIT: Into it, it is just to change the EAPI to EAPI=8 and it work fine.

Into the spectrum-analyzer Makefile, I changed:

gcc -o spectrum-analyzer *.cc -lasound -lm -lstdc++ `pkg-config --cflags --libs fftw3 gl glu liblo gtkmm-2.4 gtkglextmm-1.2`

and it compile fine.