Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

several small build issues #163

Open
gcomes opened this issue Sep 29, 2024 · 13 comments
Open

several small build issues #163

gcomes opened this issue Sep 29, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@gcomes
Copy link

gcomes commented Sep 29, 2024

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. with -DBUILD_RUBBERBAND=ON there should be a requirement to have installed
    the package meson or the build fails.

  6. with -DBUILD_RHVOICE=ON there should be a requirement to have installed the
    package libboost_headers or the build fails.

ffmpeg.patch.gz
vosk.patch.gz

@mkiol
Copy link
Owner

mkiol commented Oct 3, 2024

Thank you very much for reporting these problems. This is invaluable feedback.

So I'm getting down to fixing.... :)

@mkiol mkiol added the bug Something isn't working label Oct 3, 2024
@mkiol
Copy link
Owner

mkiol commented Oct 5, 2024

The fix: 278507b

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.

@gcomes
Copy link
Author

gcomes commented Oct 5, 2024

libdir.patch.gz
openfst.patch.gz
While I'm progressing with the building/packaging task, I found more
minor issues:

  1. 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.

  2. building openfst fails with a recent version of gcc. The patch openfst.patch
    avoid such failure. Patch borrowed from fedora src.rpm.

  3. 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.

  4. 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?

  5. 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 ....)

  6. 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.

@mkiol
Copy link
Owner

mkiol commented Oct 6, 2024

Thanks for the new patches!

Update: 8c806da

  1. 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

  1. building openfst fails with a recent version of gcc.

Fixed

  1. 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

  1. 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:

  • torch
  • torchaudio
  • accelerate
  • transformers
  • TTS
  • faster-whisper
  • unikud
  • mycroft_mimic3_tts
  • whisperspeech

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.

image

  1. in install_desktop.cmake all the libraries get installed with the command
    install(FILES ....)

Thanks for catching that. I completely overlooked it. Fixed.

  1. 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...

@gcomes
Copy link
Author

gcomes commented Oct 9, 2024

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?

@mkiol
Copy link
Owner

mkiol commented Oct 9, 2024

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.

@gcomes
Copy link
Author

gcomes commented Oct 9, 2024

  1. 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.

@mkiol
Copy link
Owner

mkiol commented Oct 11, 2024

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: 7e66592

In addition, I noticed that linking with FFmpeg 7.x was not possible. This has also been resolved.

Fix: 67b61cf

@gcomes
Copy link
Author

gcomes commented Oct 29, 2024

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.

@gcomes
Copy link
Author

gcomes commented Oct 29, 2024

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)?

@mkiol
Copy link
Owner

mkiol commented Nov 2, 2024

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 01d78ad 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 5042164 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.

@gcomes
Copy link
Author

gcomes commented Jan 9, 2025

I have two remarks about speechnote 4.7.0.

  1. 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.

  1. 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.

@mkiol
Copy link
Owner

mkiol commented Jan 12, 2025

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 f917033 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 a3db5fd. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants