OpenGL failing to build.
Posted: 20. Feb 2016, 20:51
Hi All
Any idea when they are going to fix the problems with OpenGL failing to build on Linux systems, particularly CentOS and RHEL.
I have encountered the problems on version CentOS 6.7, kernel 2.6.32-573.18.1.el6, VirtualBox 5.0.14
There are two problems I had to fix to get OpenGL to build.
1) some drm header files not found, have to add them to kernel headers every time the kernel is updated.
2) vboxvideo_drm.c fails to compile because drm_mmap is not available
Fix for 1
mkdir -p /usr/src/kernels/2.6.32-573.18.1.el6.x86_64/include/uapi/drm
cd /usr/src/kernels/2.6.32-573.18.1.el6.x86_64/include/uapi/drm
ln -s /usr/include/drm/drm_fourcc.h .
ln -s /usr/include/drm/drm.h .
ln -s /usr/include/drm/drm_mode.h .
ln -s /usr/include/drm/drm_sarea.h .
Fix for 2 not sure of the exact fix but the check for drm_mmap based on kernel version and RHEL version is incorrect in vboxvideo_drm.c
on my system I commented out the defines for DRM_HAVE_DRM_MAP around line 205
if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
# ifdef RHEL_RELEASE_CODE
# if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7, 2)
//# define DRM_HAVE_DRM_MAP
# endif
# else
//# define DRM_HAVE_DRM_MAP
# endif
#endif
Not sure, but might even have to do a #undef DRM_HAVE_DRM_MAP, indicating it is set somewhere else as well.
The second change to this file involves the use of this flag. drm_mmap is used twice in this file, but only one of the uses checks this flag.
around line 116
I changed
.mmap = drm_mmap,
to
# ifdef DRM_HAVE_DRM_MAP
/* This shouldn't be necessary even for old kernels as there is
* nothing sensible to mmap. But we play safe and keep it for
* legacy reasons. */
.mmap = drm_mmap,
# endif
Any idea when they are going to fix the problems with OpenGL failing to build on Linux systems, particularly CentOS and RHEL.
I have encountered the problems on version CentOS 6.7, kernel 2.6.32-573.18.1.el6, VirtualBox 5.0.14
There are two problems I had to fix to get OpenGL to build.
1) some drm header files not found, have to add them to kernel headers every time the kernel is updated.
2) vboxvideo_drm.c fails to compile because drm_mmap is not available
Fix for 1
mkdir -p /usr/src/kernels/2.6.32-573.18.1.el6.x86_64/include/uapi/drm
cd /usr/src/kernels/2.6.32-573.18.1.el6.x86_64/include/uapi/drm
ln -s /usr/include/drm/drm_fourcc.h .
ln -s /usr/include/drm/drm.h .
ln -s /usr/include/drm/drm_mode.h .
ln -s /usr/include/drm/drm_sarea.h .
Fix for 2 not sure of the exact fix but the check for drm_mmap based on kernel version and RHEL version is incorrect in vboxvideo_drm.c
on my system I commented out the defines for DRM_HAVE_DRM_MAP around line 205
if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
# ifdef RHEL_RELEASE_CODE
# if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7, 2)
//# define DRM_HAVE_DRM_MAP
# endif
# else
//# define DRM_HAVE_DRM_MAP
# endif
#endif
Not sure, but might even have to do a #undef DRM_HAVE_DRM_MAP, indicating it is set somewhere else as well.
The second change to this file involves the use of this flag. drm_mmap is used twice in this file, but only one of the uses checks this flag.
around line 116
I changed
.mmap = drm_mmap,
to
# ifdef DRM_HAVE_DRM_MAP
/* This shouldn't be necessary even for old kernels as there is
* nothing sensible to mmap. But we play safe and keep it for
* legacy reasons. */
.mmap = drm_mmap,
# endif