Intel-Media-SDK / MediaSDK

The Intel® Media SDK
MIT License
937 stars 460 forks source link

CMake doesn’t find some optional targets on Ubuntu Server 18.04 #348

Closed adydychk closed 5 years ago

adydychk commented 6 years ago

I try to build current MediaSDK HEAD on Ubuntu Server 18.04 but I have a problem that Google test framework and OpenCL does not recognized by Cmake.

As written in new documentation I installed following packages:

#Packages needed for test_monitor
sudo apt-get install googletest libgtest-dev libgtest-dev libpciaccess0 libpciaccess-dev

#Packages needed for rotate_opencl plugin
sudo apt-get install opencl-headers ocl-icd-dev

#Download package from https://github.com/intel/compute-runtime/releases/tag/18.24.10921
dpkg -i intel-opencl_18.24.10921_amd64.deb

The problem is that on Ubuntu packages have another names:

sudo yum install gtest gtest-devel libpciaccess libpciaccess-devel

sudo yum install opencl-headers ocl-icd ocl-icd-devel

#Compile OpenCL from these cources: https://github.com/intel/compute-runtime/releases/tag/2018ww18-010782
#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

I see that FindGTest.cmake uses hardcoded package names from CentOS. I apology that FindOpenCL usesthe same way. I want to mention that libpciaccess is found.

How can we fix it?

Output of Cmake (mention gtest and OpenCL):

-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- No build type selected, default to release
-- Intel OpenCL SDK was not found (optional). The following will not be built: rotate_opencl plugin.
-- CMAKE_INSTALL_PREFIX=/opt/intel/mediasdk
-- Intel(R) Media SDK was found here /localdisk/tmp/MediaSDKFull
-- Enabling API 1.27 feature set with flags
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'libva>=0.33'
--   Found libva, version 1.1.0
-- Checking for module 'libdrm'
--   Found libdrm, version 2.4.91
-- Checking for module 'libva-drm>=0.33'
--   Found libva-drm, version 1.1.0
-- Checking for module 'x11'
--   No package 'x11' found
-- Checking for module 'libva-x11>=0.33'
--   No package 'libva-x11' found
-- x11 modules not found (optional). Samples will be built without x11 support
-- Google tests libraries and headers were not found! Build GTest and install to /usr/local.
-- Global Configuration of Targets
-- Target Architecture to compile: sse4.2
-- CMAKE_INSTALL_PREFIX=/opt/intel/mediasdk
-- MFX_PLUGINS_DIR=/opt/intel/mediasdk/plugins
-- MFX_MODULES_DIR=/opt/intel/mediasdk/lib
-- Checking for module 'libdrm'
--   Found libdrm, version 2.4.91
-- Checking for module 'pciaccess'
--   Found pciaccess, version 0.14
-- Google tests was not found (optional), the following will not be built: test_monitor.
-- Intel OpenCL SDK was not found (optional). The following will not be built: rotate_opencl plugin.
Bhlowe commented 5 years ago

Same. Using docker "FROM ubuntu:18.04" Not super clear how to build libva from source.

onabiull commented 5 years ago

You could check out our CI implementation for libva: https://github.com/Intel-Media-SDK/product-configs/blob/master/conf_libva.py