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

[ERROR] Build error: (cmake) "set_property can not be used on an ALIAS target" - and clone fails in step 2 #197

Open
RiQuY opened this issue Jan 20, 2025 · 1 comment

Comments

@RiQuY
Copy link

RiQuY commented Jan 20, 2025

Description

I tried building the project to use it on openSUSE Tumbleweed and I'm getting the following error when running this command cmake -B build-dir --preset linux-x86_64 -DUSE_SYSTEM_CURL=ON -DCMAKE_INSTALL_PREFIX=./output_dir:

Preset CMake variables:

  CMAKE_BUILD_TYPE="RelWithDebInfo"
  ENABLE_FRONTEND_API:BOOL="TRUE"
  ENABLE_QT:BOOL="TRUE"

-- The C compiler identification is GNU 14.2.1
-- The CXX compiler identification is GNU 14.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Qt version found: 6
-- Found OpenGL: /usr/lib64/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Found XKB: /usr/lib64/libxkbcommon.so (found suitable version "1.7.0", minimum required is "0.5.0")
-- Found WrapVulkanHeaders: /usr/include
CMake Error at cmake/common/helpers_common.cmake:89 (set_property):
  set_property can not be used on an ALIAS target.
Call Stack (most recent call first):
  CMakeLists.txt:26 (find_qt)


-- Found CURL: /usr/lib64/libcurl.so (found version "8.11.1")

The content of the line pointed in the error is:

  • set_property(TARGET Qt::${component} PROPERTY INTERFACE_COMPILE_FEATURES "")

I'm following these steps https://github.com/locaal-ai/obs-localvocal?tab=readme-ov-file#other-distros and before trying to build it I checked that I have installed the required libraries like, cmake, qt6 (and dev headers), libopenssl obs-studio and obs-studio-devel (equivalent to libobs), I'm doing this from master branch (last commit fe9a521).

System info

SO: openSUSE Tumbleweed
RAM: 32GB
CPU: AMD Ryzen 7 1700X
GPU: AMD Radeon RX 5700 XT

@RiQuY RiQuY changed the title Can't build on openSUSE Tumbleweed: (cmake) set_property can not be used on an ALIAS target. [ERROR] Can't build on openSUSE Tumbleweed: (cmake) set_property can not be used on an ALIAS target. Jan 20, 2025
@RiQuY
Copy link
Author

RiQuY commented Jan 20, 2025

Update: The problem with the first command gets fixed using the code on this PR #190

When trying to use the second command cmake --build build-dir --target install I'm getting the following errors that interrupt the build install:

[19/69] Performing download step (git clone) for 'ct2_build'
FAILED: ct2_build-prefix/src/ct2_build-stamp/ct2_build-download /media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build-stamp/ct2_build-download 
cd /media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src && /usr/bin/cmake -DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE -P /media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/tmp/ct2_build-gitclone.cmake && /usr/bin/cmake -E touch /media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build-stamp/ct2_build-download
Clonando en 'ct2_build'...
remote: Enumerating objects: 23515, done.        
remote: Counting objects: 100% (1904/1904), done.        
remote: Compressing objects: 100% (220/220), done.        
remote: Total 23515 (delta 1748), reused 1689 (delta 1684), pack-reused 21611 (from 2)        
Recibiendo objetos: 100% (23515/23515), 14.57 MiB | 3.82 MiB/s, listo.
Resolviendo deltas: 100% (17528/17528), listo.
HEAD está ahora en bfa0cb3c Fix classifiers cuda 12 (#1640)
Submódulo 'third_party/cpu_features' (https://github.com/google/cpu_features.git) registrado para ruta 'third_party/cpu_features'
Submódulo 'third_party/cxxopts' (https://github.com/jarro2783/cxxopts.git) registrado para ruta 'third_party/cxxopts'
Submódulo 'third_party/googletest' (https://github.com/google/googletest.git) registrado para ruta 'third_party/googletest'
Submódulo 'third_party/ruy' (https://github.com/google/ruy.git) registrado para ruta 'third_party/ruy'
Submódulo 'third_party/spdlog' (https://github.com/gabime/spdlog.git) registrado para ruta 'third_party/spdlog'
Submódulo 'third_party/thrust' (https://github.com/NVIDIA/thrust.git) registrado para ruta 'third_party/thrust'
Clonando en '/media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build/third_party/cpu_features'...
Clonando en '/media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build/third_party/cxxopts'...
Clonando en '/media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build/third_party/googletest'...
Clonando en '/media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build/third_party/ruy'...
error: RPC falló; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 2916 bytes de cuerpo se siguen esperando
fetch-pack: unexpected disconnect while reading sideband packet
fatal: EOF temprano
fatal: fetch-pack: salida de index-pack no válida
fatal: clonación de 'https://github.com/google/ruy.git' en la ruta de submódulo '/media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build/third_party/ruy' falló
Falló al clonar 'third_party/ruy'. Reintento programado
Clonando en '/media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build/third_party/spdlog'...
error: RPC falló; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 6221 bytes de cuerpo se siguen esperando
fetch-pack: unexpected disconnect while reading sideband packet
fatal: EOF temprano
fatal: fetch-pack: salida de index-pack no válida
fatal: clonación de 'https://github.com/gabime/spdlog.git' en la ruta de submódulo '/media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build/third_party/spdlog' falló
Falló al clonar 'third_party/spdlog'. Reintento programado
Clonando en '/media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build/third_party/thrust'...
error: RPC falló; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 2018 bytes de cuerpo se siguen esperando
fetch-pack: unexpected disconnect while reading sideband packet
fatal: EOF temprano
fatal: fetch-pack: salida de index-pack no válida
fatal: clonación de 'https://github.com/NVIDIA/thrust.git' en la ruta de submódulo '/media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build/third_party/thrust' falló
Falló al clonar 'third_party/thrust'. Reintento programado
Clonando en '/media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build/third_party/ruy'...
Clonando en '/media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build/third_party/spdlog'...
error: 7930 bytes de cuerpo se siguen esperando
fetch-pack: unexpected disconnect while reading sideband packet
fatal: EOF temprano
fatal: fetch-pack: salida de index-pack no válida
fatal: clonación de 'https://github.com/gabime/spdlog.git' en la ruta de submódulo '/media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build/third_party/spdlog' falló
Falló al clonar 'third_party/spdlog' una segunda vez, abortando
CMake Error at /media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/tmp/ct2_build-gitclone.cmake:75 (message):
  Failed to update submodules in:
  '/media/Almacen/Programas/obs-localvocal/build-dir/ct2_build-prefix/src/ct2_build'

Sorry about the spanish output, I don't know to change it to english, it says roughly: clone failed, RPC Failed (was not closed cleanly), fatal fetch-pack output of index-pack invalid.

After many tries (5 reruns of the command) the repos got cloned succesfully but I got the following error:

cd /media/Almacen/Programas/obs-localvocal/build-dir/ICU_build-prefix/lib64/icu/75.1/..; \
    rm -rf current && ln -s 75.1 current; \
    rm -f Makefile.inc && ln -s current/Makefile.inc Makefile.inc; \
    rm -f pkgdata.inc && ln -s current/pkgdata.inc pkgdata.inc
/bin/sh /media/Almacen/Programas/obs-localvocal/build-dir/ICU_build-prefix/src/ICU_build/icu4c/source/mkinstalldirs /media/Almacen/Programas/obs-localvocal/build-dir/ICU_build-prefix/share/man/man1
/usr/bin/install -c -m 644 config/icu-config.1 /media/Almacen/Programas/obs-localvocal/build-dir/ICU_build-prefix/share/man/man1
[68/69] Linking CXX shared module obs-localvocal.so
FAILED: obs-localvocal.so 
: && /usr/bin/c++ -fPIC -O2 -g -DNDEBUG  -Wl,--dependency-file=CMakeFiles/obs-localvocal.dir/link.d -shared  -o obs-localvocal.so CMakeFiles/obs-localvocal.dir/obs-localvocal_autogen/mocs_compilation.cpp.o CMakeFiles/obs-localvocal.dir/src/plugin-main.c.o CMakeFiles/obs-localvocal.dir/src/transcription-filter.cpp.o CMakeFiles/obs-localvocal.dir/src/transcription-filter.c.o CMakeFiles/obs-localvocal.dir/src/transcription-filter-callbacks.cpp.o CMakeFiles/obs-localvocal.dir/src/transcription-filter-properties.cpp.o CMakeFiles/obs-localvocal.dir/src/transcription-filter-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/transcription-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/model-utils/model-downloader.cpp.o CMakeFiles/obs-localvocal.dir/src/model-utils/model-downloader-ui.cpp.o CMakeFiles/obs-localvocal.dir/src/model-utils/model-infos.cpp.o CMakeFiles/obs-localvocal.dir/src/model-utils/model-find-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/whisper-processing.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/whisper-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/whisper-model-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/whisper-params.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/silero-vad-onnx.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/token-buffer-thread.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/vad-processing.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/language_codes.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/translation.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/translation-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/ui/filter-replace-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/translation-language-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/ui/filter-replace-dialog.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/azure.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/claude.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/curl-helper.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/custom-api.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/deepl.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/google-cloud.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/openai.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/papago.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/translation-cloud.cpp.o  -Wl,-rpath,/media/Almacen/Programas/obs-localvocal/build-dir/_deps/onnxruntime-src/lib:  /usr/lib64/libobs-frontend-api.so.30  /usr/lib64/libQt6Widgets.so.6.8.1  /usr/lib64/libcurl.so  _deps/onnxruntime-src/lib/libonnxruntime.so.1.19.2  libplugin-support.a  /usr/lib64/libobs.so.30  /usr/lib64/libQt6Gui.so.6.8.1  /usr/lib64/libGLX.so  /usr/lib64/libOpenGL.so  /usr/lib64/libQt6Core.so.6.8.1  Whispercpp_Build-prefix/lib/static/libwhisper.a  ct2_build-prefix/lib64/libctranslate2.a  cpu_features_build-prefix/lib64/libcpu_features.a  sentencepiece_build-prefix/lib64/libsentencepiece.a  ICU_build-prefix/lib/libicudata.a  ICU_build-prefix/lib/libicuuc.a  ICU_build-prefix/lib/libicui18n.a && :
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: no se puede encontrar ICU_build-prefix/lib/libicudata.a: No existe el fichero o el directorio
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: no se puede encontrar ICU_build-prefix/lib/libicuuc.a: No existe el fichero o el directorio
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: no se puede encontrar ICU_build-prefix/lib/libicui18n.a: No existe el fichero o el directorio
collect2: error: ld devolvió el estado de salida 1
ninja: build stopped: subcommand failed.

This last error occurs because those 3 files are on lib64 folder, lib folder is empty.

If I change this lines in BuildICU.cmake lines 85,86,87,94:

      <INSTALL_DIR>/lib64/${CMAKE_STATIC_LIBRARY_PREFIX}icudata${CMAKE_STATIC_LIBRARY_SUFFIX}
      <INSTALL_DIR>/lib64/${CMAKE_STATIC_LIBRARY_PREFIX}icuuc${CMAKE_STATIC_LIBRARY_SUFFIX}
      <INSTALL_DIR>/lib64/${CMAKE_STATIC_LIBRARY_PREFIX}icui18n${CMAKE_STATIC_LIBRARY_SUFFIX}

 set(ICU_LIBRARY_DIR "${INSTALL_DIR}/lib64")

Then I get this error in the build install command:

/usr/bin/install -c -m 644 config/icu-config.1 /media/Almacen/Programas/obs-localvocal/build-dir/ICU_build-prefix/share/man/man1
[78/79] Linking CXX shared module obs-localvocal.so
FAILED: obs-localvocal.so 
: && /usr/bin/c++ -fPIC -O2 -g -DNDEBUG  -Wl,--dependency-file=CMakeFiles/obs-localvocal.dir/link.d -shared  -o obs-localvocal.so CMakeFiles/obs-localvocal.dir/obs-localvocal_autogen/mocs_compilation.cpp.o CMakeFiles/obs-localvocal.dir/src/plugin-main.c.o CMakeFiles/obs-localvocal.dir/src/transcription-filter.cpp.o CMakeFiles/obs-localvocal.dir/src/transcription-filter.c.o CMakeFiles/obs-localvocal.dir/src/transcription-filter-callbacks.cpp.o CMakeFiles/obs-localvocal.dir/src/transcription-filter-properties.cpp.o CMakeFiles/obs-localvocal.dir/src/transcription-filter-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/transcription-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/model-utils/model-downloader.cpp.o CMakeFiles/obs-localvocal.dir/src/model-utils/model-downloader-ui.cpp.o CMakeFiles/obs-localvocal.dir/src/model-utils/model-infos.cpp.o CMakeFiles/obs-localvocal.dir/src/model-utils/model-find-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/whisper-processing.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/whisper-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/whisper-model-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/whisper-params.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/silero-vad-onnx.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/token-buffer-thread.cpp.o CMakeFiles/obs-localvocal.dir/src/whisper-utils/vad-processing.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/language_codes.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/translation.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/translation-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/ui/filter-replace-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/translation-language-utils.cpp.o CMakeFiles/obs-localvocal.dir/src/ui/filter-replace-dialog.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/azure.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/claude.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/curl-helper.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/custom-api.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/deepl.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/google-cloud.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/openai.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/papago.cpp.o CMakeFiles/obs-localvocal.dir/src/translation/cloud-translation/translation-cloud.cpp.o  -Wl,-rpath,/media/Almacen/Programas/obs-localvocal/build-dir/_deps/onnxruntime-src/lib:  /usr/lib64/libobs-frontend-api.so.30  /usr/lib64/libQt6Widgets.so.6.8.1  /usr/lib64/libcurl.so  _deps/onnxruntime-src/lib/libonnxruntime.so.1.19.2  libplugin-support.a  /usr/lib64/libobs.so.30  /usr/lib64/libQt6Gui.so.6.8.1  /usr/lib64/libGLX.so  /usr/lib64/libOpenGL.so  /usr/lib64/libQt6Core.so.6.8.1  Whispercpp_Build-prefix/lib/static/libwhisper.a  ct2_build-prefix/lib64/libctranslate2.a  cpu_features_build-prefix/lib64/libcpu_features.a  sentencepiece_build-prefix/lib64/libsentencepiece.a  ICU_build-prefix/lib64/libicudata.a  ICU_build-prefix/lib64/libicuuc.a  ICU_build-prefix/lib64/libicui18n.a && :
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: cpu_features_build-prefix/lib64/libcpu_features.a(impl_x86_linux_or_android.c.o): la reubicación R_X86_64_32 contra  «.rodata» no se puede usar cuando se crea un objeto compartido; recompile con -fPIC
/usr/lib64/gcc/x86_64-suse-linux/14/../../../../x86_64-suse-linux/bin/ld: no se han podido establecer los tamaños de las secciones dinámicas: valor incorrecto
collect2: error: ld devolvió el estado de salida 1
ninja: build stopped: subcommand failed.

Then I added this to BuildCTranslate2.cmake in the # build cpu_features from source block to make it build successfully:

# add after line 64
set(CPU_FEATURES_EXTRA_CXX_FLAGS "-fPIC")

# add at the end of CMAKE_ARGS block
-DCMAKE_CXX_FLAGS=${CPU_FEATURES_EXTRA_CXX_FLAGS} -DCMAKE_C_FLAGS=${CPU_FEATURES_EXTRA_CXX_FLAGS}

Then I did the following to install the plugin to OBS:

sudo cp -r /media/Almacen/Programas/obs-localvocal/output_dir/lib64/obs-plugins/* /usr/lib64/obs-plugins/
sudo cp -r /media/Almacen/Programas/obs-localvocal/output_dir/share/obs/obs-plugins/* /usr/share/obs/obs-plugins/

Proof that I got it working with those changes to the source code:

Image

@RiQuY RiQuY changed the title [ERROR] Can't build on openSUSE Tumbleweed: (cmake) set_property can not be used on an ALIAS target. [ERROR] Build error: (cmake) "set_property can not be used on an ALIAS target" - and clone fails in step 2 Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant