celtera / libremidi

A modern C++ MIDI 1 / MIDI 2 real-time & file I/O library. Supports Windows, macOS, Linux and WebMIDI.
Other
463 stars 52 forks source link

[regression in 4.0] Build fails: fatal error: 'sys/timerfd.h' file not found #83

Closed yurivict closed 1 year ago

yurivict commented 1 year ago
In file included from /usr/ports/audio/libremidi/work/libremidi-4.0/include/libremidi/client.cpp:4:
In file included from /usr/ports/audio/libremidi/work/libremidi-4.0/include/libremidi/backends.hpp:15:
In file included from /usr/ports/audio/libremidi/work/libremidi-4.0/include/libremidi/backends/alsa_seq.hpp:15:
In file included from /usr/ports/audio/libremidi/work/libremidi-4.0/include/libremidi/backends/alsa_seq/midi_in.hpp:4:
/usr/ports/audio/libremidi/work/libremidi-4.0/include/libremidi/backends/linux/helpers.hpp:3:10: fatal error: 'sys/timerfd.h' file not found
#include <sys/timerfd.h>
         ^~~~~~~~~~~~~~~
1 error generated.

FreeBSD 13.2

jcelerier commented 1 year ago

hmmm this is very linux-specific code (it's only used for ALSA backend), I don't know why it would even go through this in freebsd..

jcelerier commented 1 year ago

is there a timerfd alternative there?

yurivict commented 1 year ago

Setting LIBREMIDI_NO_ALSA=ON gets rid of this compilation failure. It must be working through Jack.


The timerfd functions aren't available on FreeBSD because they are Linux-only functions.

yurivict commented 1 year ago

FYI: ALSA is supported on FreeBSD.

But libremidi now uses linusixms like timerfd in the ALSA code so I had to disable ALSA in the FreeBSD port.

jcelerier commented 1 year ago

FYI: ALSA is supported on FreeBSD.

oh, okay I did not know (or expect this) at all. And there isn't any timerfd shim for BSD?

jcelerier commented 1 year ago

I disabled it for now if timerfd is not available. Instead I'd like to consider using the native BSD MIDI APIs, I read about /dev/umidi and OSS but could not find much docs...

jcelerier commented 1 year ago

should be good on 4.1.0, please reopen if you still encounter issues!