Host Environment
ffmpeg 4.2-1
To Reproduce
> vcpkg install ffmpeg[opencl]:x64-windows-static
...
-- Building ffmpeg for Release
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
Command failed: D:/vcpkg/downloads/tools/msys2/msys64/usr/bin/bash.exe --noprofile --norc D:/vcpkg/ports/ffmpeg\build.sh D:/vcpkg/buildtrees/ffmpeg/x64-windows-static-rel D:/vcpkg/buildtrees/ffmpeg/src/n4.2-02d8c63f80 D:/vcpkg/packages/ffmpeg_x64-windows-static "--enable-asm --enable-yasm --disable-doc --enable-debug --enable-runtime-cpudetect --disable-openssl --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-libvpx --disable-libx264 --enable-opencl --disable-lzma --disable-bzlib --enable-avresample --extra-cflags=-DHAVE_UNISTD_H=0 --extra-cflags=-MT --extra-cxxflags=-MT"
Working Directory: D:/vcpkg/buildtrees/ffmpeg/x64-windows-static-rel
Error code: 1
...
> type buildtrees\ffmpeg\build-x64-windows-static-rel-out.log
=== CONFIGURING ===
ERROR: opencl not found
...
opencl:x64-windows-static IS installed.
ffmpeg[opencl]:x64-windows builds fine.
@cenit Could you have a look?
I tried to switch the build process to vcpkg_configure_make, but ffmpeg's bad macro usage caused the debug mode to fail to build.
Macro should not be used for if!
I finally got the reason: in static mode we should add -lAdvapi32 -lOle32 -lCfgmgr32 to configure.
The same seems to be true for some other optional dependencies though with slightly different errors sometimes:
ERROR: lzma requested but not found
ERROR: openssl not found
The rest of the optional dependencies DO seem to work:
x264
bzip2
vpx
@traumedy I can successfully build ffmpeg[lzma] on Windows and Linux, please provide your failure logs.
Thanks.
That basically is the entirety of the log.
D:\vcpkg>vcpkg install ffmpeg[lzma]:x64-windows-static
...
-- Building Options: --enable-asm --enable-yasm --disable-doc --enable-debug --enable-runtime-cpudetect --disable-openssl --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-libvpx --disable-libx264 --disable-opencl --enable-lzma --disable-bzlib --enable-avresample --extra-cflags=-DHAVE_UNISTD_H=0
-- Building Relase Options: --extra-cflags=-MT --extra-cxxflags=-MT
-- Building ffmpeg for Release
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
Command failed: D:/vcpkg/downloads/tools/msys2/msys64/usr/bin/bash.exe --noprofile --norc D:/vcpkg/ports/ffmpeg\build.sh D:/vcpkg/buildtrees/ffmpeg/x64-windows-static-rel D:/vcpkg/buildtrees/ffmpeg/src/n4.2-02d8c63f80 D:/vcpkg/packages/ffmpeg_x64-windows-static "--enable-asm --enable-yasm --disable-doc --enable-debug --enable-runtime-cpudetect --disable-openssl --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-libvpx --disable-libx264 --disable-opencl --enable-lzma --disable-bzlib --enable-avresample --extra-cflags=-DHAVE_UNISTD_H=0 --extra-cflags=-MT --extra-cxxflags=-MT"
Working Directory: D:/vcpkg/buildtrees/ffmpeg/x64-windows-static-rel
Error code: 1
See logs for more information:
D:\vcpkg\buildtrees\ffmpeg\build-x64-windows-static-rel-out.log
Call Stack (most recent call first):
ports/ffmpeg/portfile.cmake:189 (vcpkg_execute_required_process)
scripts/ports.cmake:94 (include)
...
D:\vcpkg> type D:\vcpkg\buildtrees\ffmpeg\build-x64-windows-static-rel-out.log
=== CONFIGURING ===
ERROR: lzma requested but not found
...
@traumedy Confirmed, thanks.
In _config.log_:
cl.exe -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_WIN32_WINNT=0x0600 -nologo -DHAVE_UNISTD_H=0 -MT -c -Fo./ffconf.pcZXGG5F/test.o ./ffconf.pcZXGG5F/test.c
test.c
./ffconf.pcZXGG5F/test.c(3): warning C4311: 'type cast': pointer truncation from 'uint32_t (__cdecl *)(void)' to 'long'
/f/vcpkg/buildtrees/ffmpeg/src/n4.2-02d8c63f80/compat/windows/mslink -nologo -out:./ffconf.pcZXGG5F/test.exe ./ffconf.pcZXGG5F/test.o lzma.lib
test.o : error LNK2019: unresolved external symbol __imp_lzma_version_number referenced in function check_lzma_version_number
./ffconf.pcZXGG5F/test.exe : fatal error LNK1120: 1 unresolved externals
I think the reason is that the lzma.lib path cannot be found.
Nope, the real reason is we need to define LZMA_API_STATIC.
After change if !defined(LZMA_API_STATIC) && defined(_WIN32) && !defined(__GNUC__) to if 0 in _VCPKG_PATH/installed/x64-windows-static/include/lzma.h_ line 191, it works.
Thanks for posting this issue. This issue has been fixed. So I am closing this issue for now.
On my system nvidia drivers is installed and I installed mingw-w64-x86_64-opencl-icd-git
and I built FFmpeg as following:
1-x86-x64 cross tools command prompt for VS 2019 run as administrator and Open mingw64 from the command prompt
2-cd c:ffmpeg_testffmpeg
3-./configure -- toolchain=msvc --enable-opencl
But opencl not found
I export Path of "cl" and opencl.dll is in c:windowssystem32
Would you mind telling me how to solve it?
@foroughmajidi Could you please open a new issue?
Thanks,
Most helpful comment
@cenit
Could you have a look?I tried to switch the build process to
vcpkg_configure_make, but ffmpeg's bad macro usage caused the debug mode to fail to build.Macro should not be used for
if!I finally got the reason: in static mode we should add
-lAdvapi32 -lOle32 -lCfgmgr32toconfigure.