m-ab-s / media-autobuild_suite

This Windows Batchscript helps setup a Mingw-w64 compiler environment for building ffmpeg and other media tools under Windows.
GNU General Public License v3.0
1.49k stars 257 forks source link

vvenc git fails #2625

Closed Fishman0919 closed 2 months ago

Fishman0919 commented 3 months ago

09:39:27 Running git update for vvenc... 09:39:28 ┌ vvenc git ................................ [Recently updated] 09:39:28 ├ Running cmake... 09:39:41 ├ Running build... Likely error (tail of the failed operation logfile): ninja: build stopped: subcommand failed. [1/20] Building CXX object source/Lib/vvenc/CMakeFiles/vvenc.dir//EncoderLib/InterSearch.cpp.o FAILED: source/Lib/vvenc/CMakeFiles/vvenc.dir//EncoderLib/InterSearch.cpp.o ccache C:\MABS\msys64\mingw64\bin\ccache.exe clang++ -DTARGET_SIMD_X86 -DVVENC_SOURCE -D_WIN32_WINNT=0x0600 -IC:/MABS/build/vvenc-git/source/Lib/vvenc/../../../include -IC:/MABS/build/vvenc-git/build-64bit -IC:/MABS/build/vvenc-git/source/Lib/vvenc/. -IC:/MABS/build/vvenc-git/source/Lib/vvenc/.. -IC:/MABS/build/vvenc-git/source/Lib/vvenc/../DecoderLib -IC:/MABS/build/vvenc-git/source/Lib/vvenc/../EncoderLib -IC:/MABS/build/vvenc-git/source/Lib/vvenc/../CommonLib -IC:/MABS/build/vvenc-git/source/Lib/vvenc/../CommonLib/x86 -IC:/MABS/build/vvenc-git/source/Lib/vvenc/../CommonLib/arm -IC:/MABS/build/vvenc-git/source/Lib/vvenc/../apputils -IC:/MABS/build/vvenc-git/source/Lib/vvenc/../../../thirdparty/nlohmann_json/single_include -isystem C:/MABS/build/vvenc-git/source/Lib/vvenc/../../../thirdparty -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1 -DVVENC_ENABLE_THIRDPARTY_JSON -DVVENC_ENABLE_THIRDPARTY_JSON -O3 -DNDEBUG -std=gnu++14 -fvisibility=hidden -fvisibility-inlines-hidden -msse4.1 -Wall -Werror -Wno-deprecated-register -Wno-unused-const-variable -Wno-unknown-attributes -MD -MT source/Lib/vvenc/CMakeFiles/vvenc.dir//EncoderLib/InterSearch.cpp.o -MF source\Lib\vvenc\CMakeFiles\vvenc.dir\\EncoderLib\InterSearch.cpp.o.d -o source/Lib/vvenc/CMakeFiles/vvenc.dir/__/EncoderLib/InterSearch.cpp.o -c C:/MABS/build/vvenc-git/source/Lib/EncoderLib/InterSearch.cpp C:/MABS/build/vvenc-git/source/Lib/EncoderLib/InterSearch.cpp:2064:15: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] 2064 | Mv prevMv[m_BlkUniMvInfoBuffer->m_uniMvListMaxSize]; | ^~~~~~~~~~~~ C:/MABS/build/vvenc-git/source/Lib/EncoderLib/InterSearch.cpp:2064:15: note: implicit use of 'this' pointer is only allowed within the evaluation of a call to a 'constexpr' member function 1 error generated. ninja: build stopped: subcommand failed. build failed. Check C:/MABS/build/vvenc-git/build-64bit/ab-suite.build.log This is required for other packages, so this script will exit. 09:40:24 Creating diagnostics file...

Attach C:\MABS\build\logs.zip to the GitHub issue. Make sure the suite is up-to-date before reporting an issue. It might've been fixed already.

Try running the build again at a later time.

logs.zip

L4cache commented 3 months ago

Likely some clang update caused issue, vvenc hasn't really updated much after I successfully built it with clang last time in 2024-03-02. Just some version number and help information typo update. Clang 18 is released 2024-03-05.

L4cache commented 3 months ago

Remove -Werror make clang not complain. This is just a makeshift "fix" though.

_check=(bin-video/vvenc{,FF}app.exe
    vvenc/vvenc.h
    libvvenc.{a,pc}
    lib/cmake/vvenc/vvencConfig.cmake)
if [[ $bits = 64bit && $vvenc = y ]] &&
    do_vcs "$SOURCE_REPO_LIBVVENC"; then
    do_uninstall include/vvenc lib/cmake/vvenc "${_check[@]}"
    find /build/vvenc-git -type f -name CMakeLists.txt | xargs sed -i 's/-Werror//g'
    do_cmakeinstall video -DVVENC_ENABLE_LINK_TIME_OPT=OFF -DVVENC_INSTALL_FULLFEATURE_APP=ON
    do_checkIfExist
fi
1480c1 commented 3 months ago

Caused by newer clang version and a commit from 3 years ago https://github.com/fraunhoferhhi/vvenc/commit/26d6cd56ce5ffa23f5ae519074ac220c58640fd1

I would recommend opening an issue upstream, as replacing a VLA has no clean solution, as moving to using new/malloc/vector could introduce a performance difference. For now, I will make a temporary patch, but upstream should probably find a more permanent solution.

1480c1 commented 2 months ago

Should be fixed with https://github.com/fraunhoferhhi/vvenc/commit/5cfc944b53b9ac14b07b4e135c63c43cb8ff4bae