Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Build Media SDK on CentOS

Dmitry Ermilov edited this page Nov 1, 2019 · 11 revisions

This build documentation was tested under clear CentOS 7.4 (with gcc-6.3.1 compiler) but it should work on another OS distributions with various versions of gcc and clang.

Prepare environment and dependencies

Install all required common packages:

sudo yum install git cmake3 pkgconfig

Build and install LibVA and its dependencies:

sudo yum install libdrm libdrm-devel automake autoconf libtool
yum install centos-release-scl
yum install devtoolset-6

#Take the recommended working version libva: https://github.com/intel/libva/releases/tag/2.3.0
#For that do the following:
git clone https://github.com/intel/libva.git
cd libva
git checkout tag/2.6.0.pre1

scl enable devtoolset-6 bash
./autogen.sh
make

#To install it on your system:
sudo make install

[Optional] In addition you can build and install some optional dependencies:

Enable epel repository:

sudo yum install epel-release

Packages needed for test_monitor:

sudo yum install libpciaccess libpciaccess-devel

Packages needed for rotate_opencl plugin:

sudo yum install ocl-icd ocl-icd-devel

#Compile OpenCL from these cources: https://github.com/intel/compute-runtime/releases/tag/18.24.10921
#By using these instructions: https://github.com/intel/compute-runtime/blob/master/documentation/BUILD_Centos.md
sudo rpm -ihv intel-opencl-1.0-0.x86_64-igdrcl.rpm

Packages needed for wayland:

yum install libffi libffi-devel expat expat-devel

#Install package:
wget https://wayland.freedesktop.org/releases/wayland-1.8.93.tar.xz
tar xf wayland-1.8.93.tar.xz
cd wayland-1.8.93
./configure --disable-documentation
# If wayland-client can't be found while cmake try this:
./configure --disable-documentation --prefix=/usr --libdir=/usr/lib64
make
make install

Packages needed for X11:

yum install libX11 libXext libXfixes libGL libGL-devel libX11-devel 
#After that rebuild libva   

Packages needed for Googletest:

#Version of googletest must be at least 1.7

git clone https://github.com/google/googletest
cd googletest
mkdir build
cd ./builld
cmake3 -DCMAKE_CXX_FLAGS="-fPIC -pthread" ..
make
make install

Build Media SDK

Get sources

Use the following Git* command (pay attention that to get full Media SDK sources bundle it is required to have Git* with LFS support):

git clone https://github.com/Intel-Media-SDK/MediaSDK msdk
cd msdk

Configure and build Media SDK install

Use cmake version 3.6.1 or later

scl enable devtoolset-6 bash
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig
mkdir build && cd build
cmake3 ..
make

ProTip: Output of cmake3 will have full information about the configuration in which Media SDK will be built. Read it carefully.

ProTip: Use following command to speed up the build: make -j12 where 12 - is number of cores on your host

After that you will have all Media SDK binaries in the folder build.

In case of clang building

In addition to all previous steps install clang and configure cmake to use clang during the build:

yum install clang-6.0
mkdir build && cd build
cmake3 .. -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0
make

If you want to install Media SDK on your host run:

make install
Clone this wiki locally