several small build issues
I'm in the process of building and eventually packaging speechnote on openSUSE. I have followed the indication here: https://github.com/mkiol/dsnote#linux-direct-build and I managed to build the program. While doing that, I found several problems that I'm reporting here in the hope that they get fixed.
-
if I use -DBUILD_FFMPEG=OFF the build process stops with the error: ld: libdsnote_lib.a(media_compressor.cpp.o): undefined reference to symbol 'avcodec_decode_subtitle2@@LIBAVCODEC_60.31_SUSE' This is due to a typo in CMakeLists.txt. The patch ffmpeg.patch fixes the problem.
-
with -DBUILD_VOSK=ON the build process stops with the error: In file included from build/external/include/kaldi/base/kaldi-error.h:34:0, build/external/include/kaldi/base/kaldi-types.h:44:10: fatal error: fst/types.h: No such file or directory #include <fst/types.h> When the error happens the file fst/types.h does exist in build/external/include/fst/types.h but the build process could not find it. The patch vosk.patch fixes this problem.
-
with -DBUILD_WHISPERCPP_CLBLAST=ON and -DBUILD_WHISPERCPP_OPENVINO=OFF the build process stops while building clblast with the error: -- Could NOT find OpenCL library, install it or set OPENCL_ROOT In whispercpp.cmake the build process builds the project opencl clblast and whispercppclblast. However the project opencl is only building the opencl headers, not the libraries. Later when the project clblast is build, it is looking for opencl headers and libraries, it doesn't find the libraries and it stops with the previous error. There are two possible solution to this problem. One is to build the opecl libraries before building clblast. The other is to requires the presence of the opencl libraries installed before building clblast. If -DBUILD_WHISPERCPP_OPENVINO=ON is used, then the openvino package should be installed which in turn requires the full opencl package to be installed. I suggest, when -DBUILD_WHISPERCPP_CLBLAST=ON is used to just requires the presence of the opencl package to be installed. In such case it is not necessary to download and build the opencl headers project.
-
with -DBUILD_ESPEAK=ON the project mbrola and espeak are downloaded and build as it is supposed to be. However if I use -DBUILD_ESPEAK=OFF and I install mbrola and espeak-ng before the build process starts, mbrola and espeak are downloaded and build like when -DBUILD_ESPEAK=ON is used. I'm not a cmake expert and I could not figure out what to change in order to fix this issue.
-
with -DBUILD_RUBBERBAND=ON there should be a requirement to have installed the package meson or the build fails.
-
with -DBUILD_RHVOICE=ON there should be a requirement to have installed the package libboost_headers or the build fails.
Thank you very much for reporting these problems. This is invaluable feedback.
So I'm getting down to fixing.... :)
The fix: 278507b2982c11f6c073ab6eeb2b8119c182b09b
if I use -DBUILD_FFMPEG=OFF the build process stops with the error: ld: libdsnote_lib.a(media_compressor.cpp.o): undefined reference to symbol 'avcodec_decode_subtitle2@@LIBAVCODEC_60.31_SUSE' This is due to a typo in CMakeLists.txt. The patch ffmpeg.patch fixes the problem.
A bit embarrassing. I didn't catch this because in all Speech Note packages (Arch, Flatpak, SFOS) ffmpeg is always compiled from source.
with -DBUILD_VOSK=ON the build process stops with the error
Fixed. Thanks for the patch :)
I suggest, when -DBUILD_WHISPERCPP_CLBLAST=ON is used to just requires the presence of the opencl package to be installed. In such case it is not necessary to download and build the opencl headers project.
Great suggestion. Fixed.
with -DBUILD_ESPEAK=ON the project mbrola and espeak are downloaded and build as it is supposed to be. However if I use -DBUILD_ESPEAK=OFF and I install mbrola and espeak-ng before the build process starts, mbrola and espeak are downloaded and build like when -DBUILD_ESPEAK=ON is used. I'm not a cmake expert and I could not figure out what to change in order to fix this issue.
Most likely this happens because you also build Piper. Piper uses "patched" version on eSpeak therefore BUILD_ESPEAK=OFF is ignored when BUILD_PIPER=ON. In CMakeList.txt there is "OR" condition:
if(BUILD_PIPER OR BUILD_ESPEAK)
include(${cmake_path}/espeak.cmake)
else()
pkg_search_module(espeak REQUIRED espeak-ng)
list(APPEND deps_libs ${espeak_LIBRARIES})
list(APPEND includes ${espeak_INCLUDE_DIRS})
endif()
with -DBUILD_RUBBERBAND=ON there should be a requirement to have installed the package meson or the build fails.
Fixed
with -DBUILD_RHVOICE=ON there should be a requirement to have installed the package libboost_headers or the build fails.
Fixed
Speech Note is a "Frankenstein" application. It has a lot of dependencies, but any third-party libraries or executables that are compiled from source are installed in <prefix>/share/dsnote, so they won't clash with system libraries. I think this makes packaging less painful.
I would love to see Speech Note package for OpenSUSE. If you need anything to be changed or added to build scripts just let me know or make a PR.
libdir.patch.gz openfst.patch.gz While I'm progressing with the building/packaging task, I found more minor issues:
-
on openSUSE, fedora and may be some more linux systems, the default for libdir when building programs on 64-bit architectures is /usr/lib64, not /usr/lib. When I build speechnote on openSUSE, several libraries get installed in build/extensions/lib64 but the build process expects to find them in build/extensions/lib. Since they are not there, the build process fails. The programs with this problem are: rnnoise, openfst, espeak, xz, libarchive, libnumbertext, lame, ogg and vorbis. The patch libdir.patch make sure that such programs get installed always in build/extensions/lib as expected.
-
building openfst fails with a recent version of gcc. The patch openfst.patch avoid such failure. Patch borrowed from fedora src.rpm.
-
with -DBUILD_RNNOISE=ON or -DBUILD_ESPEAK=ON or -DBUILD_LIBNUMBERTEXT=ON or -DBUILD_VOSK=ON (opensft) there should be a requirement for libtool, automake and autoconf or the build fails.
-
after building speechnote I noticed in Settings -> Other that many optional features where disabled, despite enabling as much as possible build options (-DBUILD_XXX=ON). Looking around I saw that there are several python modules that needs to be installed in order to enable most of the optional features. Unfortunately in the README there is no mention of it or other things that need to be done (like environment variable setting). I had to go through python3-modules-x86-64.yaml and net.mkiol.SpeechNote.yaml to get the missing information. Hoping I didn't miss anything important. By the way, do you know if it exists a tool that can process python3-modules-x86-64.yaml and either build the python modules or generate a shell script that can do it?
-
in install_desktop.cmake all the libraries get installed with the command install(FILES ....) which strips the executable permission from the libraries. While the resulting installation works, when packaging it there is a complain that the libraries are without executable permission set and the rpm can miss some task like stripping them. It would be better if the libraries get installed with: install(PROGRAMS ....)
-
I try to build speechnote using parallel build, but while sometime it works, some other it does not. Usually stopping with the error message: Parse error at dsnote-4.6.1/translations/dsnote-ru.ts:1357:9: Premature end of document. make[2]: *** [CMakeFiles/translations.dir/build.make:1495: .lupdate/translations/dsnote-ru.ts.stamp] Error 1 make[2]: Leaving directory 'dsnote-4.6.1/build' make[1]: *** [CMakeFiles/Makefile2:268: CMakeFiles/translations.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... If possible it would be very helpful to fix the problem and make parallel build working all the time.
Thanks for the new patches!
Update: 8c806dabe33a6339603684f4275edacec05ab11f
- on openSUSE, fedora and may be some more linux systems, the default for libdir when building programs on 64-bit architectures is /usr/lib64, not /usr/lib.
Fixed
- building openfst fails with a recent version of gcc.
Fixed
- with -DBUILD_RNNOISE=ON or -DBUILD_ESPEAK=ON or -DBUILD_LIBNUMBERTEXT=ON or -DBUILD_VOSK=ON (opensft) there should be a requirement for libtool, automake and autoconf or the build fails.
Fixed
- after building speechnote I noticed in Settings -> Other that many optional features where disabled,
Indeed, all Python dependencies are not included in the build script. The user must install them manually on her/his system if they need them. These dependencies are huge in size, so I don't see the point of bundling them. The exception is Flatpak, which contains all Python libraries, so the Flatpak package is extremely large and everyone complains about it ;)
The list on Python packages that user can install via pip to get additional functionalities in Speech Note:
torchtorchaudioacceleratetransformersTTSfaster-whisperunikudmycroft_mimic3_ttswhisperspeech
In addition, in the non-Flatpak version there is an option to set a custom path to Python libraries. This is useful if the user wants to install the libraries in venv.
- in install_desktop.cmake all the libraries get installed with the command install(FILES ....)
Thanks for catching that. I completely overlooked it. Fixed.
- I try to build speechnote using parallel build, but while sometime it works, some other it does not. Usually stopping with the error message: Parse error at dsnote-4.6.1/translations/dsnote-ru.ts:1357:9: Premature end of document.
Yes, I noticed that too. I don't know how to fix it now, but keep trying...
I have a couple of more questions. The flatpak build set the environment variable:
- PYTORCH_TENSOREXPR=0
- QT_QUICK_CONTROLS_HOVER_ENABLED=1
I'm wondering if for my build I have to set them too. I'm building speechnote using a system ffmeg library. However I noticed that you add a patch to ffmpeg. Should I as well let speechnote build the patched ffmpeg and drop the system one?
Hi
The flatpak build set the environment variable: PYTORCH_TENSOREXPR=0 QT_QUICK_CONTROLS_HOVER_ENABLED=1 I'm wondering if for my build I have to set them too.
No, there is no need to set them. They only make sense for the Flatpak environment. Most likely, the second one is not even needed in Flatpak.
I'm building speechnote using a system ffmeg library. However I noticed that you add a patch to ffmpeg. Should I as well let speechnote build the patched ffmpeg and drop the system one?
Thank you for noticing this. Yes, there is a patch. I recommend building FFmpeg from source. Speech Note will work with official (unpatched) FFmpeg, but in very specific use cases (e.g. TTS on subtitles with automatic duration adjustment) the sound quality will be noticeably worse. The patch solves this problem.
- I try to build speechnote using parallel build, but while sometime it works, some other it does not. Usually stopping with the error message: Parse error at dsnote-4.6.1/translations/dsnote-ru.ts:1357:9: Premature end of document.
Yes, I noticed that too. I don't know how to fix it now, but keep trying...
I'm guessing that the problem is located in cmake/translations.cmake. It seems like the file generated with qt5_create_translation is used while its generation has not been completed. This post "https://discourse.cmake.org/t/cmake-build-in-parallel-fail/2299" suggest that when parallel build fails is because of missing dependencies. Unfortunately I cannot help with the missing dependencies.
I'm guessing that the problem is located in cmake/translations.cmake.
I think I was able to fix it. I had to rewrite the translation generator a bit. It seems to be working fine now :)
Fix: 7e66592a8c84d955fec2d65510fb2767ab8005dc
In addition, I noticed that linking with FFmpeg 7.x was not possible. This has also been resolved.
Fix: 67b61cfcb6821ddd6efcec81787c5ab6319fc422
The fix for parallel-build works. The build does not fail anymore in the place where it did before. However, rarely, it now fails with this message: [ 283s] Install the project... [ 283s] /usr/bin/cmake -P cmake_install.cmake [ 283s] -- Install configuration: "Release" [ 283s] -- Installing: /home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/lib/libwhisper-openblas.so.1.6.2 [ 283s] -- Installing: /home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/lib/libwhisper-openblas.so.1 [ 283s] -- Set non-toolchain portion of runtime path of "/home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/lib/libwhisper-openblas.so.1.6.2" to "/usr/share/dsnote/lib" [ 283s] -- Installing: /home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/lib/libwhisper-openblas.so [ 283s] -- Installing: /home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/include/ggml.h [ 283s] CMake Error at cmake_install.cmake:83 (file): [ 283s] file INSTALL cannot set permissions on [ 283s] "/home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/include/ggml.h": [ 283s] No such file or directory. [ 283s] [ 283s] make[3]: *** [Makefile:100: install] Error 1 [ 283s] make[3]: Leaving directory '/home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/whispercppopenblas'
or with this one: [ 260s] Install the project... [ 260s] /usr/bin/cmake -P cmake_install.cmake [ 260s] -- Install configuration: "Release" [ 260s] -- Installing: /home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/lib/libwhisper-fallback1.so.1.6.2 [ 260s] -- Installing: /home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/lib/libwhisper-fallback1.so.1 [ 260s] -- Set non-toolchain portion of runtime path of "/home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/lib/libwhisper-fallback1.so.1.6.2" to "/usr/share/dsnote/lib" [ 260s] -- Installing: /home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/lib/libwhisper-fallback1.so [ 260s] -- Installing: /home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/include/ggml.h [ 260s] -- Installing: /home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/include/whisper.h [ 260s] CMake Error at cmake_install.cmake:83 (file): [ 260s] file INSTALL cannot set modification time on [ 260s] "/home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/include/whisper.h": [ 260s] No such file or directory. [ 260s] [ 260s] make[3]: *** [Makefile:100: install] Error 1 [ 260s] make[3]: Leaving directory '/home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/whispercppfallback1'
This error does not happen often. When it does, I just restart the build process and the second time it completes without error. Fixing it is not high priority, but it's a good thing to be aware about it.
I have found a problem with openvino. Here is what happens. When I build speechnote with openvino support (-DBUILD_WHISPERCPP_OPENVINO=ON) libwhisper-openvino.so is build which depends on libopenvino.so. Because of such dependency, when I install the rpm package of speechnote, the package providing libopenvino is installed as well. So far so good. When I start speechnote using the command: speechnote --verbose I see the following in the output log:
[D] 09:36:00.923 0x7f8d9557de00 add_openvino_devices:813 - scanning for openvino devices [W] 09:36:00.923 0x7f8d9557de00 openvino_api:306 - failed to open openvino lib: libopenvino_c.so: cannot open shared object file: No such file or directory
Since speechnote uses dlopen to access libopenvino_c.so, the rpm build process does not know about such dependency and libopenvino_c.so does not get installed together with speechnote (libopenvino.so and libopenvino_c.so are provided by two separate packages on openSUSE). After I installed libopenvino_c.so and run again speechnote --verbose I got:
[D] 09:49:36.924 0x7f08d665be00 add_openvino_devices:813 - scanning for openvino devices [D] 09:49:36.924 0x7f08d665be00 add_openvino_devices:826 - openvino version: build=2024.3.0-000--, description=OpenVINO Runtime [D] 09:49:36.926 0x7f08d665be00 add_openvino_devices:852 - openvino number of devices: 0
This time the software failed to detect any openvino device. openvino by default installs its plugin in: /usr/lib64/OpenVINO, once I moved the plugins libraries to /usr/lib64 together with libopenvino_c.so running speechnote --verbose gives:
[D] 09:54:56.924 0x7fbe6465be00 add_openvino_devices:813 - scanning for openvino devices [D] 09:54:56.924 0x7fbe6465be00 add_openvino_devices:826 - openvino version: build=2024.3.0-000--, description=OpenVINO Runtime [D] 09:54:56.931 0x7fbe6465be00 add_openvino_devices:852 - openvino number of devices: 1 [D] 09:54:56.931 0x7fbe6465be00 add_openvino_devices:861 - openvino device: 0, name=CPU, full-name=13th Gen Intel(R) Core(TM)
Would it be possible for speechnote to detect openvino devices when the plugins are located in /usr/lib64/OpenVINO (the default location)?
Hi
The fix for parallel-build works. The build does not fail anymore in the place where it did before.
Thanks for the verification!
However, rarely, it now fails with this message: [ 283s] "/home/abuild/rpmbuild/BUILD/dsnote-4.6.1/build/external/include/ggml.h": [ 283s] No such file or directory.
Most likely the problem is that all these parallel whisper.cpp builds are trying to install the same header files at the same time. This 01d78ad869f3e66cdf4165fe5959852c65b849ac forces sequential build so hopefully the problem should not occur.
I have found a problem with openvino. Would it be possible for speechnote to detect openvino devices when the plugins are located in /usr/lib64/OpenVINO (the default location)?
I tried to find something in the OpenVINO documentation, but was unsuccessful :-( Perhaps enabling OpenVINO is not the best idea. To be honest, it doesn't provide much speed increase. At the moment it is enabled only for the CPU and I am considering removing it in the future. Quite recently I added support for Vulkan 50421648f3e063ff08a7db1638a82e8624c8a8eb acceleration. It works great with Intel, AMD and NVIDIA graphics cards and doesn't require those huge dependencies like CUDA or ROCm. Having Vulkan, I think OpenVINO is obsolete.
I have two remarks about speechnote 4.7.0.
- during the build process I got the following error:
/var/lib/build/ccache/bin/c++ -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -O3 -DNDEBUG -Wl,--as-needed -Wl,-z,now -L/home/abuild/rpmbuild/BUILD/dsnote-4.7.0/build/../xkb/libxkbcommon-1.6.0/build//usr/lib64 -pie -flto -fno-fat-lto-objects -Wl,--disable-new-dtags -Wl,-pie -Wl,-rpath,/usr/share/dsnote/lib CMakeFiles/dsnote.dir/dsnote_autogen/mocs_compilation.cpp.o CMakeFiles/dsnote.dir/src/main.cpp.o CMakeFiles/dsnote.dir/dsnote_autogen/NTHHH2CSJL/qrc_resources.cpp.o CMakeFiles/dsnote.dir/dsnote_autogen/JU62CA5L7X/qrc_translations.cpp.o -o dsnote -L/home/abuild/rpmbuild/BUILD/dsnote-4.7.0/build/external/lib libdsnote_lib.a -lpthread -ldl -lz -lpulse /usr/lib64/libQt5Multimedia.so.5.15.12 /usr/lib64/libQt5DBus.so.5.15.12 /usr/lib64/libQt5Xml.so.5.15.12 /usr/lib64/libQt5QuickControls2.so.5.15.12 /usr/lib64/libQt5Widgets.so.5.15.12 -lX11 /usr/lib64/libXtst.so /usr/lib64/libXinerama.so -lxkbcommon -lxkbcommon-x11 -lxkbcommon -lxcb -lxcb-xkb /usr/lib64/libQt5X11Extras.so.5.15.12 external/lib/libqhotkey.a external/lib/libxdo.a external/lib/librnnoise-nu.a -larchive -lfmt external/lib/libvad.a -llzma -lRHVoice_core -lRHVoice external/lib/libespeak-ng.a external/lib/libpiper_api.a external/lib/libspdlog.a external/lib/libpiper_phonemize.a -lonnxruntime external/lib/libssplit.a external/lib/libpcre2-8.a external/lib/libpcre2-posix.a /usr/lib64/libpython3.11.so -laprilasr -lrubberband -lfftw3 external/lib/libavfilter.a external/lib/libavdevice.a external/lib/libavformat.a external/lib/libavcodec.a external/lib/libswresample.a external/lib/libswscale.a external/lib/libavutil.a external/lib/libmp3lame.a external/lib/libvorbis.a external/lib/libvorbisenc.a external/lib/libvorbisfile.a external/lib/libogg.a external/lib/libopus.a -ltag -lz -lnumbertext-1.0 external/lib/libhtml2md.a /usr/lib64/libQt5Quick.so.5.15.12 /usr/lib64/libQt5QmlModels.so.5.15.12 /usr/lib64/libQt5Qml.so.5.15.12 /usr/lib64/libQt5Network.so.5.15.12 /usr/lib64/libXi.so /usr/lib64/libXext.so /usr/lib64/libX11.so /usr/lib64/libQt5Gui.so.5.15.12 /usr/lib64/libQt5Core.so.5.15.12 -lpulse -lX11 -lxkbcommon -lxkbcommon-x11 -lxcb -lxcb-xkb external/lib/libqhotkey.a external/lib/libxdo.a external/lib/librnnoise-nu.a -larchive -lfmt external/lib/libvad.a -llzma -lRHVoice_core -lRHVoice external/lib/libespeak-ng.a external/lib/libpiper_api.a external/lib/libspdlog.a external/lib/libpiper_phonemize.a -lonnxruntime external/lib/libssplit.a external/lib/libpcre2-8.a external/lib/libpcre2-posix.a /usr/lib64/libpython3.11.so -laprilasr -lrubberband -lfftw3 external/lib/libavfilter.a external/lib/libavdevice.a external/lib/libavformat.a external/lib/libavcodec.a external/lib/libswresample.a external/lib/libswscale.a external/lib/libavutil.a external/lib/libmp3lame.a external/lib/libvorbis.a external/lib/libvorbisenc.a external/lib/libvorbisfile.a external/lib/libogg.a external/lib/libopus.a -ltag -lnumbertext-1.0 external/lib/libhtml2md.a
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: external/lib/libxdo.a(xdo.o): in function xdo_move_mouse': /home/abuild/rpmbuild/BUILD/dsnote-4.7.0/build/external/xdo/xdo.c:799:(.text+0xe5a): undefined reference to XTestFakeMotionEvent'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: external/lib/libxdo.a(xdo.o): in function xdo_move_mouse_relative': /home/abuild/rpmbuild/BUILD/dsnote-4.7.0/build/external/xdo/xdo.c:818:(.text+0xf4f): undefined reference to XTestFakeRelativeMotionEvent'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: external/lib/libxdo.a(xdo.o): in function _xdo_send_key': /home/abuild/rpmbuild/BUILD/dsnote-4.7.0/build/external/xdo/xdo.c:1546:(.text+0x12c4): undefined reference to XTestFakeKeyEvent'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: external/lib/libxdo.a(xdo.o): in function _xdo_send_modifier': /home/abuild/rpmbuild/BUILD/dsnote-4.7.0/build/external/xdo/xdo.c:1602:(.text+0x137f): undefined reference to XTestFakeKeyEvent'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: external/lib/libxdo.a(xdo.o): in function _xdo_mousebutton': /home/abuild/rpmbuild/BUILD/dsnote-4.7.0/build/external/xdo/xdo.c:827:(.text+0x31dc): undefined reference to XTestFakeButtonEvent'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: external/lib/libxdo.a(xdo.o): in function _xdo_has_xtest': /home/abuild/rpmbuild/BUILD/dsnote-4.7.0/build/external/xdo/xdo.c:1295:(.text+0x42fa): undefined reference to XTestQueryExtension'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: external/lib/libxdo.a(xdo.o): in function xdo_get_viewport_dimensions': /home/abuild/rpmbuild/BUILD/dsnote-4.7.0/build/external/xdo/xdo.c:2005:(.text+0x4740): undefined reference to XineramaQueryExtension'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/abuild/rpmbuild/BUILD/dsnote-4.7.0/build/external/xdo/xdo.c:2006:(.text+0x474d): undefined reference to XineramaIsActive' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /home/abuild/rpmbuild/BUILD/dsnote-4.7.0/build/external/xdo/xdo.c:2010:(.text+0x47a2): undefined reference to XineramaQueryScreens'
collect2: error: ld returned 1 exit status
Note in the first error line the presence of: -lX11 /usr/lib64/libXtst.so /usr/lib64/libXinerama.so
In CMakeLists.txt if I replace the line: list(APPEND deps_libs X11 X11::Xtst X11::Xinerama) with list(APPEND deps_libs X11 Xtst Xinerama) then the linking command line becomes:
/var/lib/build/ccache/bin/c++ -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -O3 -DNDEBUG -Wl,--as-needed -Wl,-z,now -L/home/abuild/rpmbuild/BUILD/dsnote-4.7.0/build/../xkb/libxkbcommon-1.6.0/build//usr/lib64 -pie -flto -fno-fat-lto-objects -Wl,--disable-new-dtags -Wl,-pie -Wl,-rpath,/usr/share/dsnote/lib CMakeFiles/dsnote.dir/dsnote_autogen/mocs_compilation.cpp.o CMakeFiles/dsnote.dir/src/main.cpp.o CMakeFiles/dsnote.dir/dsnote_autogen/NTHHH2CSJL/qrc_resources.cpp.o CMakeFiles/dsnote.dir/dsnote_autogen/JU62CA5L7X/qrc_translations.cpp.o -o dsnote -L/home/abuild/rpmbuild/BUILD/dsnote-4.7.0/build/external/lib libdsnote_lib.a -lpthread -ldl -lz -lpulse /usr/lib64/libQt5Multimedia.so.5.15.12 /usr/lib64/libQt5DBus.so.5.15.12 /usr/lib64/libQt5Xml.so.5.15.12 /usr/lib64/libQt5QuickControls2.so.5.15.12 /usr/lib64/libQt5Widgets.so.5.15.12 -lX11 -lXtst -lXinerama -lxkbcommon -lxkbcommon-x11 -lxkbcommon -lxcb -lxcb-xkb /usr/lib64/libQt5X11Extras.so.5.15.12 external/lib/libqhotkey.a external/lib/libxdo.a external/lib/librnnoise-nu.a -larchive -lfmt external/lib/libvad.a -llzma -lRHVoice_core -lRHVoice external/lib/libespeak-ng.a external/lib/libpiper_api.a external/lib/libspdlog.a external/lib/libpiper_phonemize.a -lonnxruntime external/lib/libssplit.a external/lib/libpcre2-8.a external/lib/libpcre2-posix.a /usr/lib64/libpython3.11.so -laprilasr -lrubberband -lfftw3 external/lib/libavfilter.a external/lib/libavdevice.a external/lib/libavformat.a external/lib/libavcodec.a external/lib/libswresample.a external/lib/libswscale.a external/lib/libavutil.a external/lib/libmp3lame.a external/lib/libvorbis.a external/lib/libvorbisenc.a external/lib/libvorbisfile.a external/lib/libogg.a external/lib/libopus.a -ltag -lz -lnumbertext-1.0 external/lib/libhtml2md.a /usr/lib64/libQt5Quick.so.5.15.12 /usr/lib64/libQt5QmlModels.so.5.15.12 /usr/lib64/libQt5Qml.so.5.15.12 /usr/lib64/libQt5Network.so.5.15.12 /usr/lib64/libQt5Gui.so.5.15.12 /usr/lib64/libQt5Core.so.5.15.12 -lpulse -lX11 -lXtst -lXinerama -lxkbcommon -lxkbcommon-x11 -lxcb -lxcb-xkb external/lib/libqhotkey.a external/lib/libxdo.a external/lib/librnnoise-nu.a -larchive -lfmt external/lib/libvad.a -llzma -lRHVoice_core -lRHVoice external/lib/libespeak-ng.a external/lib/libpiper_api.a external/lib/libspdlog.a external/lib/libpiper_phonemize.a -lonnxruntime external/lib/libssplit.a external/lib/libpcre2-8.a external/lib/libpcre2-posix.a /usr/lib64/libpython3.11.so -laprilasr -lrubberband -lfftw3 external/lib/libavfilter.a external/lib/libavdevice.a external/lib/libavformat.a external/lib/libavcodec.a external/lib/libswresample.a external/lib/libswscale.a external/lib/libavutil.a external/lib/libmp3lame.a external/lib/libvorbis.a external/lib/libvorbisenc.a external/lib/libvorbisfile.a external/lib/libogg.a external/lib/libopus.a -ltag -lnumbertext-1.0 external/lib/libhtml2md.a
This time what before was "-lX11 /usr/lib64/libXtst.so /usr/lib64/libXinerama.so" becomes "-lX11 -lXtst -lXinerama" and the linking is successful.
- when installing the python module: webdataset it creates the file <python-dest>/bin/widsindex Since for other python modules that install commands in bin you have a cleanup: entry in the yaml file that removes such executable, I'm wondering if something similar is needed in the python3-whisperspeech section.
This time what before was "-lX11 /usr/lib64/libXtst.so /usr/lib64/libXinerama.so" becomes "-lX11 -lXtst -lXinerama" and the linking is successful.
Thanks! Changed in f9170337f2b77c259eff15b0a14811f234d4a44a use pkg-config, which effectively inserts -lXtst and -lXinerama into a linker command.
when installing the python module: webdataset it creates the file
You refer to the Flatpak manifest. Indeed, this file is not needed and can be removed. Fixed in a3db5fd5db5b0d2915e07c59ab98b4ef677fd7ca. Thanks!
Since speechnote 4.7 a native package is available for openSUSE in the packman Extra repository. OpenSUSE users most likely have such repository already enabled, if not follow the indications here: https://en.opensuse.org/Additional_package_repositories
Once the repository is enabled install speechnote with:
zypper in speechnote
I just tested it, it's great :) I was a long time OpenSUSE user, so this warms my heart even more. Thanks a lot!
I will update the README to include information about OpenSUSE.
The installation command:
zypper in speechnote
normally should install the two packages: speechnote and speechnote-python-modules.
But, due to a issue with the packman repository, speechnote-python-modules is not
automatically installed. To overcome the problem, for the time being the installation command should be:
zypper in speechnote speechnote-python-modules
Oh, this Python package provides Conqui and FasterWhisper. That's more than I expected!
I just added the info to my README.
I noticed some glitches in the default openSUSE color theme. Some widgets display dark text on a dark background :/ I will try to fix all UI issues in the next version.
Thanks again!
I'm testing the build of the upcoming 4.8.0 release. So far in 4.8.0b2 I have encountered two problems.
- If I enable -DBUILD_XDO=ON and -DBUILD_XKBCOMMON=ON the build fails with the error: xdo.c:34:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory #include <xkbcommon/xkbcommon.h>
XKBCOMMON should be build before XDO not in parallel.
- openblas is not detected properly. In 4.7.1 CMakeLists.txt contains: pkg_search_module(openblas REQUIRED openblas) which does detect the presence of openblas.
In 4.8.0b2 CMakeLists.txt includes openblas_pkgconfig.cmake.
Such file fails to detect openblas, creates build/openblas.pc and then the configuration process fails with the message:
-- Checking for module 'openblas64'
-- No package 'openblas64' found
-- Checking for module 'openblas'
-- Variable 'libnamesuffix${libsuffix' not defined in '/home/abuild/rpmbuild/BUILD/dsnote-4.8.0/build/openblas.pc'
CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:619 (message):
The following required packages were not found:
- openblas
It is not clear to me why openblas_pkgconfig.cmake is not able to detect the presence of openblas and creates a openblas.pc file which probably works for fedora but it does not for openSUSE.
Thanks a lot for letting me know. I will look into it.
Hi. Sorry for the very late reply.
Both problems have now been resolved.
https://github.com/mkiol/dsnote/commit/aaf0abde808cd6cc4941c8ebda4b32db222d3093 https://github.com/mkiol/dsnote/commit/69c2e36ba60581e53ed87f6c4ed1142e0bfdd040
The openblas issue is fixed. About xkbcommon, it is build before xdo, but xdo fails to find the xkbcommon include files. The fix is simple. In cmake/xdo.cmake the line:
BUILD_COMMAND make libxdo.a
should be changed to:
BUILD_COMMAND CPATH=${external_include_dir} make libxdo.a
I have also prepared a small patch that you may want to apply. It clean-up some leftover directories in the Flatpak manifest.
Thank you a lot!
Fixes: 375c82727ac0cc09c2d397ecaba3a87d5849d079 d1d2d5ec4e3e659527c562c79e263dfab572002d
This is a good time to fix bugs, as I plan to release the new version v4.8.1 later this week (new git tag v4.8.1). If you found something that needs to be resolved, please report it so I can fix it before the new version is released.
I have an issue with 1.8.0 that I have compiled on openSUSE. Coqui tts is not found. I have attached the logs of speechnote started with --verbose for both 1.7.1 and 1.8.0. May be you can help me figure it out what is going on.
The log of 1.8.0 shows an error message:
CalledProcessError: Command '['espeak-ng', '-q', '-b', '1', '--voices']' returned non-zero exit status 1
Indeed if I run manually the command:
/usr/share/dsnote/bin/espeak-ng -q -b 1 --voices
it shows the error:
Error processing file '<build_path>/build/external/share/espeak-ng-data/phontab': No such file or directory
(the file phontab being present in ~/.local/share/net.mkiol/dsnote/espeakdata)
However, the same command shows the same error if I run it with speechnote 1.7.1.
So it doesn't seem to be the cause of the problem but probably a consequence.
Firstly, are you sure which espeak-ng is actually being executed? It may be espeak-ng that is already installed in /usr/bin. If it is /usr/share/dsnote/bin/espeak-ng, you can override the "espeak data path" with the ESPEAK_DATA_PATH environment variable.
Try this:
ESPEAK_DATA_PATH=/usr/share/dsnote/share/espeak-ng-data /usr/share/dsnote/bin/espeak-ng -q -b 1 --voices
PS: I checked if this problem also occurs on Arch, which also has the unsanboxed package. It does not occur. Executing /usr/share/dsnote/bin/espeak-ng -q -b 1 --voices returns the correct list of voices.
Firstly, are you sure which
espeak-ngis actually being executed? It may be espeak-ng that is already installed in /usr/bin.
There is currently no espeak-ng on openSUSE only espeak.
If it is
/usr/share/dsnote/bin/espeak-ng, you can override the "espeak data path" with theESPEAK_DATA_PATHenvironment variable.
If I set ESPEAK_DATA_PATH then everything works as before.
Probably this is happening because in 1.8.0 you have changed a little bit the build process for espeak (stripping and changing the rpath for libespeak). Anyway, the fix works and I'm ready to release the new version for openSUSE. Although I may wait a few more days until 1.8.1 comes out.
If I set ESPEAK_DATA_PATH then everything works as before.
Good :) Do you want me to do anything with ESPEAK_DATA_PATH? If needed I can set this variable just before starting Coqui engine.
Although I may wait a few more days until 1.8.1 comes out.
Yes, please wait for 4.8.1. I'm planning to release it next Sunday.
If I set ESPEAK_DATA_PATH then everything works as before.
Good :) Do you want me to do anything with
ESPEAK_DATA_PATH? If needed I can set this variable just before starting Coqui engine.
That I'll leave to you. Both ways work for me.
That I'll leave to you. Both ways work for me.
All right, so I'm not going to change anything for now.
FYI: v4.8.1 is out
I have released 4.8.1 for openSUSE on packman. I'm going to close this issue now. In the future, I'll open a new one if I need it.