HandBrake icon indicating copy to clipboard operation
HandBrake copied to clipboard

Unable to Build Windows Nightly with QSV

Open dengelsma opened this issue 2 years ago • 7 comments

Problem Description

I used the HandBrake build instructions to cross-compile the Windows build on an Ubuntu VM and get an error during the libvpl build as shown in the attached log file.

Activity Log, Crash Log or any other details

.
.
.
 :  /usr/bin/install -c -m 644 src/testcommon/aligned_malloc.h src/testcommon/argparse.cpp src/testcommon/argparse.h src/testcommon/mmap.cpp src/testcommon/mmap.h src/testcommon/win32_bitmap.cpp src/testcommon/win32_bitmap.h '/home/dengelsma/HandBrake/build/contrib/share/doc/zimg/example/misc'
  :  /usr/bin/mkdir -p '/home/dengelsma/HandBrake/build/contrib/include'
  :  /usr/bin/install -c -m 644 src/zimg/api/zimg.h src/zimg/api/zimg++.hpp '/home/dengelsma/HandBrake/build/contrib/include'
  :  /usr/bin/mkdir -p '/home/dengelsma/HandBrake/build/contrib/lib/pkgconfig'
  :  /usr/bin/install -c -m 644 zimg.pc '/home/dengelsma/HandBrake/build/contrib/lib/pkgconfig'
  : gmake[3]: Leaving directory '/home/dengelsma/HandBrake/build/contrib/zimg/zimg-release-3.0.3'
  : gmake[2]: Leaving directory '/home/dengelsma/HandBrake/build/contrib/zimg/zimg-release-3.0.3'
  : gmake[1]: Leaving directory '/home/dengelsma/HandBrake/build/contrib/zimg/zimg-release-3.0.3'
  : touch contrib/zimg/.stamp.zimg.install
  : downloading https://github.com/oneapi-src/oneVPL/archive/refs/tags/v2022.1.2.tar.gz to ../download/oneVPL-2022.1.2.tar.gz
download total:   5849893 bytesytes
  : sha256 (../download/oneVPL-2022.1.2.tar.gz) = 8ff93be017273eefa83dc6cd7f5d82facb168e38eafabafa2e9613a4e742016f (pass)
  : /usr/bin/mkdir -p contrib/libvpl/
  : sha256 (../download/oneVPL-2022.1.2.tar.gz) = 8ff93be017273eefa83dc6cd7f5d82facb168e38eafabafa2e9613a4e742016f (pass)
  : /usr/bin/rm -fr ./contrib/libvpl/oneVPL-2022.1.2/
  : /usr/bin/tar xfC ../download/oneVPL-2022.1.2.tar.gz ./contrib/libvpl/
  : touch contrib/libvpl/.stamp.libvpl.extract
  : touch contrib/libvpl/.stamp.libvpl.patch
  : set -e; /usr/bin/mkdir -p ./contrib/libvpl/oneVPL-2022.1.2/build; cd ./contrib/libvpl/oneVPL-2022.1.2/build; CC=/home/dengelsma/toolchains/mingw-w64-x86_64/bin/x86_64-w64-mingw32-gcc CFLAGS="-I/home/dengelsma/HandBrake/build/contrib/include -std=gnu99 -mfpmath=sse -msse2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -mno-ms-bitfields" CXX=/home/dengelsma/toolchains/mingw-w64-x86_64/bin/x86_64-w64-mingw32-g++ CXXFLAGS="-I/home/dengelsma/HandBrake/build/contrib/include -mfpmath=sse -msse2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -mno-ms-bitfields" CPPFLAGS="-I/home/dengelsma/HandBrake/build/contrib/include " LDFLAGS="-L/home/dengelsma/HandBrake/build/contrib/lib -fstack-protector-strong" PKG_CONFIG_PATH="/home/dengelsma/HandBrake/build/contrib/lib/pkgconfig:" cmake --host=x86_64-w64-mingw32 -DCMAKE_HOST_SYSTEM="x86_64-pc-linux-gnu" -DCMAKE_INSTALL_PREFIX="/home/dengelsma/HandBrake/build/contrib/" -DBUILD_PREVIEW=OFF -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DWIN32=ON -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=/home/dengelsma/toolchains/mingw-w64-x86_64/bin/x86_64-w64-mingw32-gcc -DCMAKE_C_FLAGS="-static-libgcc -static-libstdc++ -static" -DCMAKE_SHARED_LIBRARY_LINK_C_FLAGS="-static-libgcc -static-libstdc++ -static" -DCMAKE_CXX_COMPILER=/home/dengelsma/toolchains/mingw-w64-x86_64/bin/x86_64-w64-mingw32-g++ -DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++ -static" -DCMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS="-static-libgcc -static-libstdc++ -static" -DCMAKE_RC_COMPILER=x86_64-w64-mingw32-windres -DCMAKE_SYSTEM_PROCESSOR=x86_64 "/home/dengelsma/HandBrake/build/contrib/libvpl/oneVPL-2022.1.2/"
  : CMake Error: Unknown argument --host=x86_64-w64-mingw32
  : CMake Error: Run 'cmake --help' for all supported options.
  : gmake: *** [../contrib/libvpl/module.rules:2: contrib/libvpl/.stamp.libvpl.configure] Error 1
-------------------------------------------------------------------------------
time end: Mon May 23 09:30:12 2022
duration: 7 minutes, 47 seconds (467.70s)
result: FAILURE (code 2)
-------------------------------------------------------------------------------
Build is finished!
You may now cd into ./build and examine the output.

What Operating System are you running?

Ubuntu 22.04

What version of HandBrake are you running?

Nightly as of May 23, 2022

Where did you download HandBrake from?

Github

dengelsma avatar May 23 '22 13:05 dengelsma

Full build log: build_log.txt

dengelsma avatar May 23 '22 13:05 dengelsma

@dengelsma I had the same problem.

Please try CMake 3.16.3 https://cmake.org/files/v3.16/cmake-3.16.3-Linux-x86_64.tar.gz

galinart avatar May 23 '22 20:05 galinart

@bradleysepos seems cmake --host= argument is not supported in latest cmake.

galinart avatar May 23 '22 20:05 galinart

Thanks for the hint. It looks like we may need to stop passing --host and instead use -DCMAKE_SYSTEM: https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM.html

I'll try to make time to take a deeper look sometime this week.

bradleysepos avatar May 23 '22 23:05 bradleysepos

@galinart Needs the same fix as in https://github.com/HandBrake/HandBrake/commit/97d8804d00c422bddfa2bb374a80819d3836e075

That gets past the parameter issue but unfortunately, it does not link here.

bradleysepos avatar May 25 '22 05:05 bradleysepos

@dengelsma I had the same problem.

Please try CMake 3.16.3 https://cmake.org/files/v3.16/cmake-3.16.3-Linux-x86_64.tar.gz

Thanks for the tip -- that does indeed work.

dengelsma avatar May 25 '22 12:05 dengelsma

I had the same issue on Fedora 36. Following the advice from @galinart to download the pre-compiled CMake tar.gz from the CMake website worked great. Extract it, add cmake-3.16.3-Linux-x86_64/bin to your path, and then build Handbrake. In my case, I was recompiling (for personal use) the latest production release (1.5.1) with FDK and FDK-AAC.

Thanks to @dengelsma for an excellent ticket (found it easily with a Google search), to @galinart for the workaround, and to @bradleysepos for initiating the work on the fix in the HandBrake build process.

tovodeverett avatar Jul 23 '22 15:07 tovodeverett