How to build ffmpeg with OpenCL
I'm trying to figure out how to build ffmpeg with opencl. I add the flag --enable-opencl to the configure. Am using mingw on Ubuntu to build for Win32 and Win64 targets. The configure fails with the following error: configuring ffmpeg_git (/home/mcebuddy/Software/ffmpeg/sandbox/win32/ffmpeg_git) as $ PATH=/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games ./configure --arch=x86 --target-os=mingw32 --cross-prefix=/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-config=pkg-config --enable-gpl --enable-libx264 --enable-avisynth --enable-libxvid --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --disable-w32threads --enable-frei0r --enable-filter=frei0r --enable-libvo-aacenc --enable-bzlib --enable-libxavs --extra-cflags=-DPTW32_STATIC_LIB --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libvpx --enable-libilbc --enable-iconv --enable-libtwolame --enable-opencl --extra-cflags=-DLIBTWOLAME_STATIC --enable-libmodplug --extra-libs=-lstdc++ --enable-libzvbi --enable-libcaca --prefix=/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32 --enable-static --disable-shared --enable-libsoxr --enable-fontconfig --enable-libass --enable-libutvideo --enable-libbluray --extra-cflags= --enable-nonfree --enable-libfdk-aac --enable-runtime-cpudetect ERROR: opencl not found I've downloaded the OpenCL 1.2 Headers using the guide from: http://streamcomputing.eu/blog/2011-06- ... u-orderly/ into /usr/include/CL anyone have any ideas what's going on?
Ramit Bhalla <ramitbhalla <at> gmail.com> writes:
ERROR: opencl not found
Please provide the tail of config.log Carl Eugen
ERROR: opencl not found
Please provide the tail of config.log
Carl Eugen
/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/bin/i686-w64-mingw32-gcc -Wl,--nxcompat -Wl,--dynamicbase -Wl,--as-needed -o /tmp/ffconf.eoyrURcv.exe /tmp/ffconf.HuXYx7p5.o -lzvbi -lxvidcore -lxavs -lx264 -lvpx -lvpx -lvpx -lvorbisenc -lvorbis -logg -lvo-amrwbenc -lvo-aacenc -lutvideo -lstdc++ -ltwolame -ltwolame -ltheoraenc -ltheoradec -logg -lspeex -lsoxr -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lschroedinger-1.0 -lorc-0.4 -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lrtmp -lwinmm -lz -lgnutls -lnettle -lhogweed -lgmp -lcrypt32 -lws2_32 -liconv -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lopus -lopenjpeg -lopencore-amrwb -lopencore-amrnb -lmp3lame -lmodplug -lilbc -lgsm -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lfreetype -lexpat -lfdk-aac -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lcaca -lbluray -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lass -lm -lfontconfig -lfribidi -lfreetype -lexpat -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lgnutls -lnettle -lhogweed -lgmp -lcrypt32 -lws2_32 -liconv -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lfontconfig -lfreetype -lexpat -lm -lbz2 -lz -pthread -lpsapi -ladvapi32 -lshell32 -lstdc++ check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL check_func_headers OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL check_ld cc -Wl,-framework,OpenCL check_cc -Wl,-framework,OpenCL BEGIN /tmp/ffconf.L86KcP8R.c 1 #include <OpenCL/cl.h> 2 long check_clEnqueueNDRangeKernel(void) { return (long) clEnqueueNDRangeKernel; } 3 int main(void) { return 0; } END /tmp/ffconf.L86KcP8R.c /home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/bin/i686-w64-mingw32-gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 -D__printf__=__gnu_printf__ -DPTW32_STATIC_LIB -DLIBTWOLAME_STATIC -std=c99 -fomit-frame-pointer -pthread -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/fribidi -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/freetype2 -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/freetype2 -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/opus -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/schroedinger-1.0 -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/orc-0.4 -Wl,-framework,OpenCL -c -o /tmp/ffconf.HuXYx7p5.o /tmp/ffconf.L86KcP8R.c /tmp/ffconf.L86KcP8R.c:1:23: fatal error: OpenCL/cl.h: No such file or directory #include <OpenCL/cl.h> ^ compilation terminated. check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL check_func_headers CL/cl.h clEnqueueNDRangeKernel -lOpenCL check_ld cc -lOpenCL check_cc BEGIN /tmp/ffconf.L86KcP8R.c 1 #include <CL/cl.h> 2 long check_clEnqueueNDRangeKernel(void) { return (long) clEnqueueNDRangeKernel; } 3 int main(void) { return 0; } END /tmp/ffconf.L86KcP8R.c /home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/bin/i686-w64-mingw32-gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 -D__printf__=__gnu_printf__ -DPTW32_STATIC_LIB -DLIBTWOLAME_STATIC -std=c99 -fomit-frame-pointer -pthread -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/fribidi -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/freetype2 -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/freetype2 -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/opus -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/schroedinger-1.0 -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/orc-0.4 -c -o /tmp/ffconf.HuXYx7p5.o /tmp/ffconf.L86KcP8R.c /home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/bin/i686-w64-mingw32-gcc -Wl,--nxcompat -Wl,--dynamicbase -Wl,--as-needed -o /tmp/ffconf.eoyrURcv.exe /tmp/ffconf.HuXYx7p5.o -lOpenCL -lzvbi -lxvidcore -lxavs -lx264 -lvpx -lvpx -lvpx -lvorbisenc -lvorbis -logg -lvo-amrwbenc -lvo-aacenc -lutvideo -lstdc++ -ltwolame -ltwolame -ltheoraenc -ltheoradec -logg -lspeex -lsoxr -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lschroedinger-1.0 -lorc-0.4 -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lrtmp -lwinmm -lz -lgnutls -lnettle -lhogweed -lgmp -lcrypt32 -lws2_32 -liconv -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lopus -lopenjpeg -lopencore-amrwb -lopencore-amrnb -lmp3lame -lmodplug -lilbc -lgsm -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lfreetype -lexpat -lfdk-aac -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lcaca -lbluray -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lass -lm -lfontconfig -lfribidi -lfreetype -lexpat -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lgnutls -lnettle -lhogweed -lgmp -lcrypt32 -lws2_32 -liconv -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lfontconfig -lfreetype -lexpat -lm -lbz2 -lz -pthread -lpsapi -ladvapi32 -lshell32 -lstdc++ /Software/ffmpeg/sandbox/mingw-w64-i686/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w64-mingw32/bin/ld: cannot find -lOpenCL collect2: error: ld returned 1 exit status ERROR: opencl not found
Ramit Bhalla <ramitbhalla <at> gmail.com> writes:
cannot find -lOpenCL
It appears that you have installed the headers but not the actual library. Carl Eugen
Thanks Carl. Yes once i built and installed the libOpenCL.so library with the compiler libraries it started working but I ran into another issue (unrelated I think) for which I posted a separate query.
cannot find -lOpenCL
It appears that you have installed the headers but not the actual library.
Okay I take that back, it's still not working. I build libOpenCL.so and placed it in the compiler lib folder. I'm still seeing this, any idea why and what I'm doing wrong? /Software/ffmpeg/sandbox/mingw-w64-i686/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w64-mingw32/bin/ld: -f may not be used without -shared collect2: error: ld returned 1 exit status check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL check_func_headers CL/cl.h clEnqueueNDRangeKernel -lOpenCL check_ld cc -lOpenCL check_cc BEGIN /tmp/ffconf.krpZS1gQ.c 1 #include <CL/cl.h> 2 long check_clEnqueueNDRangeKernel(void) { return (long) clEnqueueNDRangeKernel; } 3 int main(void) { return 0; } END /tmp/ffconf.krpZS1gQ.c /Software/ffmpeg/sandbox/mingw-w64-i686/bin/i686-w64-mingw32-gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 -D__printf__=__gnu_printf__ -DPTW32_STATIC_LIB -DLIBTWOLAME_STATIC -std=c99 -fomit-frame-pointer -pthread -I/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/fribidi -I/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/freetype2 -I/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/freetype2 -I/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/opus -I/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include -I/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/schroedinger-1.0 -I/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/include/orc-0.4 -c -o /tmp/ffconf.ojOFiHPn.o /tmp/ffconf.krpZS1gQ.c /Software/ffmpeg/sandbox/mingw-w64-i686/bin/i686-w64-mingw32-gcc -Wl,--nxcompat -Wl,--dynamicbase -Wl,--as-needed -o /tmp/ffconf.L6EvMcGZ.exe /tmp/ffconf.ojOFiHPn.o -lOpenCL -lzvbi -lxvidcore -lxavs -lx264 -lvpx -lvpx -lvpx -lvorbisenc -lvorbis -logg -lvo-amrwbenc -lvo-aacenc -lutvideo -lstdc++ -ltwolame -ltwolame -ltheoraenc -ltheoradec -logg -lspeex -lsoxr -L/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lschroedinger-1.0 -lorc-0.4 -L/home/mcebuddy/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -L/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lrtmp -lwinmm -lz -lgnutls -lnettle -lhogweed -lgmp -lcrypt32 -lws2_32 -liconv -L/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lopus -lopenjpeg -lopencore-amrwb -lopencore-amrnb -lmp3lame -lmodplug -lilbc -lgsm -L/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lfreetype -lexpat -lfdk-aac -L/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lcaca -lbluray -L/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lass -lm -lfontconfig -lfribidi -lfreetype -lexpat -L/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lgnutls -lnettle -lhogweed -lgmp -lcrypt32 -lws2_32 -liconv -L/Software/ffmpeg/sandbox/mingw-w64-i686/i686-w64-mingw32/lib -lfontconfig -lfreetype -lexpat -lm -lbz2 -lz -pthread -lpsapi -ladvapi32 -lshell32 -lstdc++ /Software/ffmpeg/sandbox/mingw-w64-i686/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w64-mingw32/bin/ld: cannot find -lOpenCL collect2: error: ld returned 1 exit status ERROR: opencl not found
Ramit Bhalla <ramitbhalla <at> gmail.com> writes:
Okay I take that back, it's still not working. I build libOpenCL.so and placed it in the compiler lib folder.
I'm still seeing this, any idea why and what I'm doing wrong?
cannot find -lOpenCL
Consider showing us the content of the compiler lib folder. Carl Eugen
Consider showing us the content of the compiler lib folder.
Carl Eugen
I was able to resolve this with another users's help, but thanks anyways. The issue was that I needed to use a .a file instead of a .so file while building.
More details here: http://ffmpeg.zeranoe.com/forum/viewtopic.php?f=10&t=1284&start=10#p6199
participants (2)
-
Carl Eugen Hoyos -
Ramit Bhalla