[FFmpeg-trac] #2422(avutil:new): Compilation with OpenCL fails when w32threads or os2threads are enabled

FFmpeg trac at avcodec.org
Tue Apr 2 08:39:51 CEST 2013


#2422: Compilation with OpenCL fails when w32threads or os2threads are enabled
--------------------------------------+--------------------------------
               Reporter:  jamal       |                  Owner:
                   Type:  defect      |                 Status:  new
               Priority:  important   |              Component:  avutil
                Version:  git-master  |               Keywords:  opencl
             Blocked By:              |               Blocking:
Reproduced by developer:  0           |  Analyzed by developer:  0
--------------------------------------+--------------------------------
 Mingw32-w64 example:

 {{{
 $ ./configure --enable-opencl

 [...]

 $ grep 'THREADS' config.mak
 !HAVE_PTHREADS=yes
 HAVE_W32THREADS=yes
 !HAVE_OS2THREADS=yes
 HAVE_THREADS=yes

 $ grep 'OPENCL' config.mak
 CONFIG_OPENCL=yes

 $ make

 [...]

 CC      libavutil/opencl.o
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c: In function
 'av_opencl_register_kernel_code':
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:188:5: error:
 'LOCK_OPENCL' undeclared (first use in this function)
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:188:5: note: each
 undeclared identifier is reported only once for each function it appears
 in
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:206:5: error:
 'UNLOCK_OPENCL' undeclared (first use in this function)
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c: In function
 'av_opencl_create_kernel':
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:214:5: error:
 'LOCK_OPENCL' undeclared (first use in this function)
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:243:5: error:
 'UNLOCK_OPENCL' undeclared (first use in this function)
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c: In function
 'av_opencl_release_kernel':
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:250:5: error:
 'LOCK_OPENCL' undeclared (first use in this function)
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:251:5: error: expected ';'
 before 'if'
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:263:5: error:
 'UNLOCK_OPENCL' undeclared (first use in this function)
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:264:1: error: expected ';'
 before '}' token
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:262:1: warning: label
 'end' defined but not used [-Wunused-label]
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c: In function
 'av_opencl_init':
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:516:5: error:
 'LOCK_OPENCL' undeclared (first use in this function)
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:517:5: error: expected ';'
 before 'if'
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:545:5: error:
 'UNLOCK_OPENCL' undeclared (first use in this function)
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:546:5: error: expected ';'
 before 'return'
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:515:24: warning: unused
 variable 'opt_device_entry' [-Wunused-variable]
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:514:24: warning: unused
 variable 'opt_platform_entry' [-Wunused-variable]
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c: In function
 'av_opencl_uninit':
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:553:5: error: unknown type
 name'LOCK_OPENCL'
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:554:12: error: expected
 '=', ',', ';', 'asm' or '__attribute__' before '.' token
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:587:5: error:
 'UNLOCK_OPENCL' undeclared (first use in this function)
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:588:1: error: expected ';'
 before '}' token
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c: At top level:
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:266:12: warning:
 'init_opencl_env' defined but not used [-Wunused-function]
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c: In function
 'av_opencl_init':
 D:/MinGW/msys/1.0/ffmpeg/src/libavutil/opencl.c:547:1: error: control
 reaches end of non-void function [-Werror=return-type]
 cc1.exe: some warnings being treated as errors
 make: *** [libavutil/opencl.o] Error 1
 }}}

 LOCK_OPENCL and UNLOCK_OPENCL are only defined when compiling with
 pthreads, or no threading at all.

 I sent an email to ffmpeg-devel with a possible way to deal with this, but
 I'm opening a ticket anyway to keep track of this problem.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2422>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list