Opened 3 years ago

Closed 3 years ago

#4366 closed defect (fixed)

Error building libavutil on Mac OS X 10.9.5 and clang 6.0

Reported by: mario_grgic Owned by:
Priority: important Component: avutil
Version: git-master Keywords: opencl
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I have been successfully building ffmpeg on Mac OS X for years now, including version 2.5.2 that I built last.

But when I attempted latest ffmpeg-2.6 I run into error in libavutil/opencl.c:

libavutil/opencl.c:42:44: note: expanded from macro 'UNLOCK_OPENCL'
#define UNLOCK_OPENCL pthread_mutex_unlock(atomic_opencl_lock)
                                           ^~~~~~~~~~~~~~~~~~
/usr/include/pthread.h:363:43: note: passing argument to parameter here
int pthread_mutex_unlock(pthread_mutex_t *);
                                          ^
libavutil/opencl.c:592:5: warning: passing 'volatile pthread_mutex_t *'
      (aka 'volatile struct _opaque_pthread_mutex_t *') to parameter of type 'pthread_mutex_t *' (aka
      'struct _opaque_pthread_mutex_t *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    LOCK_OPENCL;
    ^~~~~~~~~~~
libavutil/opencl.c:41:40: note: expanded from macro 'LOCK_OPENCL'
#define LOCK_OPENCL pthread_mutex_lock(atomic_opencl_lock)
                                       ^~~~~~~~~~~~~~~~~~
/usr/include/pthread.h:353:41: note: passing argument to parameter here
int pthread_mutex_lock(pthread_mutex_t *);
                                        ^
libavutil/opencl.c:614:10: error: use of undeclared identifier 'i'
    for (i = 0; i < opencl_ctx.kernel_code_count; i++) {
         ^
libavutil/opencl.c:614:17: error: use of undeclared identifier 'i'
    for (i = 0; i < opencl_ctx.kernel_code_count; i++) {
                ^
libavutil/opencl.c:614:51: error: use of undeclared identifier 'i'
    for (i = 0; i < opencl_ctx.kernel_code_count; i++) {
                                                  ^
libavutil/opencl.c:615:32: error: use of undeclared identifier 'i'
        opencl_ctx.kernel_code[i].is_compiled = 0;
                               ^
libavutil/opencl.c:621:5: warning: passing 'volatile pthread_mutex_t *'
      (aka 'volatile struct _opaque_pthread_mutex_t *') to parameter of type 'pthread_mutex_t *' (aka
      'struct _opaque_pthread_mutex_t *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    UNLOCK_OPENCL;
    ^~~~~~~~~~~~~

This is with

$ clang --version
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

on Mac OS X 10.9.5

ffmpeg was configured as follows

./configure --prefix=/Volumes/ramdisk/ffmpeg --as=yasm --disable-shared --enable-static --disable-ffplay --disable-ffserver --enable-gpl --enable-pthreads --enable-postproc --enable-gray --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-nonfree --enable-version3 --enable-runtime-cpudetect --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-avresample --enable-opengl --enable-opencl --datadir=/usr/share/ffmpeg --mandir=/usr/share/man

Change History (3)

comment:1 Changed 3 years ago by mario_grgic

  • Component changed from undetermined to avutil

comment:2 Changed 3 years ago by mario_grgic

Changing libabutil/opencl.c line 614 to

for (int i = 0; i < opencl_ctx.kernel_code_count; i++) {

Fixes this. Not sure how this compiled anywhere? All other methods that have similar loops declare int i; at the top of the method.

comment:3 Changed 3 years ago by cehoyos

  • Keywords opencl added
  • Priority changed from normal to important
  • Resolution set to fixed
  • Status changed from new to closed
  • Version changed from unspecified to git-master

The issue was fixed in ebd59d27 and 2.6.1

Note: See TracTickets for help on using tickets.