Opened 7 years ago

Last modified 7 years ago

#5979 new defect

Fix for OpenCl & OpenGL on OSX

Reported by: G Owned by:
Priority: normal Component: avdevice
Version: git-master Keywords: opencl, opengl, osx
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

git clone blah blah blah
configure lots of options --enable-opencl --enable-opengl 

/opt/local/include/GL/glext.h:111:54: error: unknown type name 'GLenum'; did you mean 'enum'?
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei co...
                                                     ^~~~~~
                                                     enum
/opt/local/include/GL/glext.h:111:61: warning: declaration of 'enum mode' will not be visible outside of this
      function [-Wvisibility]
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei co...
                                                            ^
/opt/local/include/GL/glext.h:111:67: error: unknown type name 'GLuint'
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei co...
                                                                  ^
/opt/local/include/GL/glext.h:111:81: error: unknown type name 'GLuint'
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei co...
                                                                                ^
/opt/local/include/GL/glext.h:111:93: error: unknown type name 'GLsizei'
typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLe...
                                                                                            ^
/opt/local/include/GL/glext.h:111:108: error: unknown type name 'GLenum'; did you mean 'enum'?
  ...PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const ...
                                                                                        ^~~~~~
                                                                                        enum
/opt/local/include/GL/glext.h:111:115: warning: declaration of 'enum type' will not be visible outside of this
      function [-Wvisibility]
  ...PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const ...
                                                                                               ^
/opt/local/include/GL/glext.h:112:47: error: unknown type name 'GLenum'; did you mean 'enum'?
typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsize...
                                              ^~~~~~
                                              enum
/opt/local/include/GL/glext.h:112:54: warning: declaration of 'enum target' will not be visible outside of
      this function [-Wvisibility]
typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsize...

/opt/local/include/GL/glext.h:112:164: warning: declaration of 'enum format' will not be visible outside of
      this function [-Wvisibility]
  ...GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenu...
                                                                                              ^
/opt/local/include/GL/glext.h:112:172: error: unknown type name 'GLenum'; did you mean 'enum'?
  ...GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pi...
                                                                                ^~~~~~
                                                                                enum
/opt/local/include/GL/glext.h:112:179: warning: declaration of 'enum type' will not be visible outside of this
      function [-Wvisibility]
  ...GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pi...                                                     
                                                                                            ^
/opt/local/include/GL/glext.h:113:108: error: unknown type name 'GLint'
  ...PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsi...
                                                                                        ^

'''+ a shitload of more errors'''

fatal error: too many errors emitted, stopping now [-ferror-limit=]



modify opengl_enc.c

was

#if HAVE_WINDOWS_H
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#if HAVE_OPENGL_GL3_H
#include <OpenGL/gl3.h>
#elif HAVE_ES2_GL_H
#include <ES2/gl.h>
#else
#include <GL/gl.h>
#include <GL/glext.h>
#endif
#if HAVE_GLXGETPROCADDRESS
#include <GL/glx.h>
#endif

#if HAVE_SDL2
#include <SDL.h>
#include <SDL/SDL_video.h>
#endif

my fix to make this compile on OSX 10.11.6, using

--cc=clang-mp-3.9 --cxx=clang++-mp-3.9
--optflags='-O3 -pipe -arch x86_64 -m64 -mtune=haswell -march=haswell -mmacosx-version-min=10.11 -fopenmp -fomit-frame-pointer -fno-common -funroll-loops -mavx2 -mfma -mfpmath=sse -msse2 -msse3 -msse4.1 -msse4.2'

is

#include <SDL.h>
#include <SDL/SDL_video.h>
#include <GLES3/gl32.h>
#include <OpenGL/glu.h>
#include <OpenCL/opencl.h>}}}

Change History (1)

comment:1 by Carl Eugen Hoyos, 7 years ago

Please send your patch made with git format-patch to the development mailing list, change requests are ignored here.

Note: See TracTickets for help on using tickets.