alphacep / vosk-asterisk

Speech Recognition in Asterisk with Vosk Server
GNU General Public License v2.0
102 stars 40 forks source link

FreeBSD Support #30

Open scorpio1441 opened 1 year ago

scorpio1441 commented 1 year ago

Is it possible to use this module on FreeBSD?

Even though I copied the module and libc.so.6 from Linux machine, it still throws an error when loading: [Jan 28 05:39:22] ERROR[100106] loader.c: Error loading module 'res_speech_vosk.so': /usr/local/lib/compat/libc.so.6: version GLIBC_2.14 required by /usr/local/lib/asterisk/modules/res_speech_vosk.so not defined

nshmyrev commented 1 year ago

You have to build it from source and it will work.

scorpio1441 commented 1 year ago

It won't work, no matter what. Many hours spent. No FreeBSD support period. Compiles on Linux just fine.

nshmyrev commented 1 year ago

You are welcome to provide more information - what have you tried, what error did you see, logs, outputs.

scorpio1441 commented 1 year ago

Just following the documentation:

git clone https://github.com/asterisk/asterisk
./bootstrap
./configure --with-asterisk=/usr/src/asterisk --prefix=/usr/local/bin

/usr/src/asterisk/include/asterisk.h:21:10: fatal error: 'asterisk/autoconfig.h' file not found

include "asterisk/autoconfig.h"

Assuming need to ./configure & make asterisk first (not mentioned here at all)? No problem.

 cd /usr/src/asterisk/
./configure
make

error: linker command failed with exit code 1 (use -v to see invocation)

Expected, asterisk won't build under FreeBSD while using https://github.com/asterisk/asterisk as source.

Using ports instead.

./configure
make

Builds just fine.

Going back to building vosk-asterisk:

./configure --with-asterisk=/usr/src/asterisk --prefix=/usr/local/bin

Jan 28 05:39:22] ERROR[100106] loader.c: Error loading module 'res_speech_vosk.so': /usr/local/lib/compat/libc.so.6: version GLIBC_2.14 required by /usr/local/lib/asterisk/modules/res_speech_vosk.so not defined

So says my original message. This module truly depends on Linux libraries which can't be brought to FreeBSD for obvious reasons.

nshmyrev commented 1 year ago

What is the output of ldd res_speech_vosk.so and ldd some_other_asterisk_module.so? just to compare the two.

scorpio1441 commented 1 year ago

If I had res_speech_vosk.so, the problem would be resolved to begin with... =))))

root@freebsd:/usr/src/vosk-asterisk-master # ldd /usr/local/lib/asterisk/modules/res_parking.so /usr/local/lib/asterisk/modules/res_parking.so: libthr.so.3 => /lib/libthr.so.3 (0x8014a8000) libc.so.7 => /lib/libc.so.7 (0x801083000

nshmyrev commented 1 year ago

res_speech_vosk is in /usr/local/lib/asterisk/modules/res_speech_vosk.so, message says

scorpio1441 commented 1 year ago

Ended up compiling under Fedora just fine. Thanks.