occ-ai/obs-backgroundremoval

Build issue on Fedora 40: failed to set dynamic section sizes: bad value

Closed this issue ยท 7 comments

Describe the bug

$ .github/scripts/build-linux --skip-deps
   =>   Configuring obs-backgroundremoval...
Preset CMake variables:

  ENABLE_FRONTEND_API:BOOL="TRUE"
  ENABLE_QT:BOOL="FALSE"

-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/obs-backgroundremoval/build_x86_64
   =>   Building obs-backgroundremoval...
[1/1] Linking CXX shared module obs-backgroundremoval.so
FAILED: obs-backgroundremoval.so 
: && /usr/bin/c++ -fPIC -O2 -g -DNDEBUG   -shared  -o obs-backgroundremoval.so CMakeFiles/obs-backgroundremoval.dir/src/plugin-main.c.o CMakeFiles/obs-backgroundremoval.dir/src/ort-utils/ort-session-utils.cpp.o CMakeFiles/obs-backgroundremoval.dir/src/obs-utils/obs-utils.cpp.o CMakeFiles/obs-backgroundremoval.dir/src/obs-utils/obs-config-utils.cpp.o CMakeFiles/obs-backgroundremoval.dir/src/update-checker/github-utils.cpp.o CMakeFiles/obs-backgroundremoval.dir/src/update-checker/update-checker.cpp.o CMakeFiles/obs-backgroundremoval.dir/src/background-filter-info.c.o CMakeFiles/obs-backgroundremoval.dir/src/background-filter.cpp.o CMakeFiles/obs-backgroundremoval.dir/src/enhance-filter.cpp.o CMakeFiles/obs-backgroundremoval.dir/src/enhance-filter-info.c.o  -Wl,-rpath,/tmp/obs-backgroundremoval/build_x86_64/_deps/onnxruntime-src/lib:  /usr/lib64/libobs-frontend-api.so.30  _deps/onnxruntime-src/lib/libonnxruntime.so.1.17.1  src/update-checker/CurlClient/libCurlClient.a  libplugin-support.a  _deps/opencv-src/lib/libopencv_imgproc.a  _deps/opencv-src/lib/libopencv_core.a  _deps/opencv-src/lib/opencv4/3rdparty/libzlib.a  /usr/lib64/libobs.so.30  /usr/lib64/libcurl.so && :
/usr/bin/ld: src/update-checker/CurlClient/libCurlClient.a(CurlClient.cpp.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

To Reproduce

Steps to reproduce the behavior:

Follow docs for building on fedora

Expected behavior

Builds

Desktop (please complete the following information):

  • OS: [Fedora 40]
  • Browser: [firefox]
  • Plugin Version: [HEAD]
  • OBS Version: [obs-studio-devel-30.1.1]

Additional context

Add any other context about the problem here.

@T0MASD
Fedora building instructions are not actively maintained because the OBS project doesn't support Fedora officially.
Please develop the instructions which can be used on Fedora by yourself ๐Ÿ˜„
Thank you for considering contributing our project ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘

fedora build instructions are correct and https://codeload.github.com/occ-ai/obs-backgroundremoval/zip/refs/tags/1.1.13 builds fine with:

.github/scripts/build-linux --skip-deps
sudo cmake --install build_x86_64 --prefix /usr

but not the code in HEAD (error in description)

@T0MASD It revealed that the Fedora build instructions are too old and invalid now. Can you develop a new building instructions based on OpenSUSE's one?

@T0MASD
I have revised the building instructions on Fedora for you.
Please try the following new instructions.
https://github.com/occ-ai/obs-backgroundremoval/blob/5ac9f1c607ada4e53ab509db1e2b4a309570168e/docs/BUILDING-FEDORA.md

This document will be included by #581

Thanks very much!

Confirming build using the new instructions

    cmake -B build_x86_64 \
      -DCMAKE_BUILD_TYPE=Release \
      -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
      -DENABLE_FRONTEND_API=ON \
      -DENABLE_QT=OFF \
      -DUSE_SYSTEM_OPENCV=ON
    cmake --build build_x86_64

passes:

      -- The C compiler identification is GNU 14.0.1
      -- The CXX compiler identification is GNU 14.0.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
      -- Found OpenCV: /usr (found version "4.9.0") found components: core imgproc
      -- Found CURL: /usr/lib64/libcurl.so (found version "8.6.0")
      -- Configuring done (253.9s)
      -- Generating done (0.0s)
      -- Build files have been written to: /tmp/obs-backgroundremoval-main/build_x86_64
      [  6%] Building C object CMakeFiles/plugin-support.dir/plugin-support.c.o
      [ 13%] Linking C static library libplugin-support.a
      [ 13%] Built target plugin-support
      [ 20%] Building CXX object src/update-checker/CurlClient/CMakeFiles/CurlClient.dir/CurlClient.cpp.o
      [ 26%] Linking CXX static library libCurlClient.a
      [ 26%] Built target CurlClient
      [ 33%] Building C object CMakeFiles/obs-backgroundremoval.dir/src/plugin-main.c.o
      [ 40%] Building CXX object CMakeFiles/obs-backgroundremoval.dir/src/ort-utils/ort-session-utils.cpp.o
      [ 46%] Building CXX object CMakeFiles/obs-backgroundremoval.dir/src/obs-utils/obs-utils.cpp.o
      [ 53%] Building CXX object CMakeFiles/obs-backgroundremoval.dir/src/obs-utils/obs-config-utils.cpp.o
      [ 60%] Building CXX object CMakeFiles/obs-backgroundremoval.dir/src/update-checker/github-utils.cpp.o
      [ 66%] Building CXX object CMakeFiles/obs-backgroundremoval.dir/src/update-checker/update-checker.cpp.o
      [ 73%] Building C object CMakeFiles/obs-backgroundremoval.dir/src/background-filter-info.c.o
      [ 80%] Building CXX object CMakeFiles/obs-backgroundremoval.dir/src/background-filter.cpp.o
      [ 86%] Building CXX object CMakeFiles/obs-backgroundremoval.dir/src/enhance-filter.cpp.o
      [ 93%] Building C object CMakeFiles/obs-backgroundremoval.dir/src/enhance-filter-info.c.o
      [100%] Linking CXX shared module obs-backgroundremoval.so
      [100%] Built target obs-backgroundremoval