Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@
[submodule "meta-intel-realsense"]
path = meta-intel-realsense
url = https://github.com/IntelRealSense/meta-intel-realsense.git
[submodule "meta-clang"]
path = meta-clang
url = https://github.com/kraj/meta-clang.git
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add this with -b krogoth

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added branch = krogoth, I guess that's what you meant?

branch = krogoth
1 change: 1 addition & 0 deletions meta-clang
Submodule meta-clang added at dc1d9d
1 change: 1 addition & 0 deletions meta-iotqa/conf/test/refkit-image-computervision.manifest
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Tests for computervision profile
oeqa.runtime.computervision.realsense_headless
oeqa.runtime.computervision.opencl_viennacl_1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from oeqa.oetest import oeRuntimeTest

class OpenCLViennaCL1Test(oeRuntimeTest):
def test_opencl_viennacl_1(self):
# Run an example test from viennacl-examples
(status, output) = self.target.run('dense_blas-bench-opencl')
self.assertEqual(status, 0, msg="Error messages: %s" % output)
3 changes: 2 additions & 1 deletion meta-refkit/conf/bblayers.conf.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
LCONF_VERSION = "1"
LCONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""
Expand All @@ -15,6 +15,7 @@ REFKIT_LAYERS = " \
##OEROOT##/../meta-iotqa \
##OEROOT##/../meta-security-isafw \
##OEROOT##/../meta-intel-realsense \
##OEROOT##/../meta-clang \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a learning from meta-intel-realsense addition: we need to update the LCONF_VERSION and LAYER_CONF_VERSION too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, do you mean that we need to bump up LCONF_VERSION to 2 in bblayers.conf.sample?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and also LAYER_CONF_VERSION in layer.conf. This ensures that users update their build/conf/bblayers.conf before bitbake parses the recipes with these changes included. The recipe parsing fails with an error because this PR brings a bbappend but the corresponding bb is in meta-clang (which is unlikely enabled unless we force it with the conf version change).

"

# REFKIT_LAYERS += "##OEROOT##/../meta-openembedded/meta-efl"
Expand Down
6 changes: 6 additions & 0 deletions meta-refkit/conf/distro/include/refkit-supported-recipes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ base-passwd@core
bash-completion@core
bash@core
bc@core
beignet-570x@refkit
beignet-minnowmax@refkit
binutils@core
bison@core
bluez5@core
Expand All @@ -56,6 +58,7 @@ ca-certificates@core
cairo@core
cantarell-fonts@core
chrpath@core
clang@clang-layer
connman-conf@core
connman@core
coreutils@core
Expand Down Expand Up @@ -203,7 +206,9 @@ ncurses@core
netbase@core
nettle@core
nodejs@iotweb
ocl-icd@refkit
oe-swupd-helpers@meta-swupd
opencl-headers@refkit
opencv@openembedded-layer
openjdk-8@meta-java
openssh@core
Expand Down Expand Up @@ -279,6 +284,7 @@ util-macros@core
v4l-utils@openembedded-layer
v86d@core
valgrind@core
viennacl@refkit
vim@openembedded-layer
volatile-binds@core
wget@core
Expand Down
1 change: 1 addition & 0 deletions meta-refkit/conf/distro/include/refkit_security_flags.inc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ SECURITY_CFLAGS_pn-krb5 = "${SECURITY_NO_PIE_CFLAGS} ${SECURITY_PIC_CFLAGS}"
SECURITY_CFLAGS_pn-tbb = "${SECURITY_NO_PIE_CFLAGS} ${SECURITY_PIC_CFLAGS}"
SECURITY_CFLAGS_pn-protobuf = "${SECURITY_NO_PIE_CFLAGS} ${SECURITY_PIC_CFLAGS}"
SECURITY_CFLAGS_pn-glog = "${SECURITY_NO_PIE_CFLAGS} ${SECURITY_PIC_CFLAGS}"
SECURITY_CFLAGS_pn-clang = "${SECURITY_NO_PIE_CFLAGS} ${SECURITY_PIC_CFLAGS}"

# openjdk-8 ends up linking with "-shared -pie -fpie" in some cases (see
# hotspot/make/linux/makefiles/saproc.make) which then tries (and fails) to
Expand Down
5 changes: 5 additions & 0 deletions meta-refkit/conf/distro/refkit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ PACKAGECONFIG_remove_pn-gstreamer1.0-plugins-base = "pango"

PACKAGECONFIG_remove_pn-pulseaudio = "avahi"

# since we have OpenCL support, turn it on
PACKAGECONFIG_append_pn-opencv = " opencl"
PREFERRED_PROVIDER_virtual/opencl-headers = "opencl-headers"
PREFERRED_PROVIDER_virtual/opencl-headers-cxx = "opencl-headers-cxx"

MAINTAINER = "Mikko Ylinen <mikko.ylinen@linux.intel.com>"

TARGET_VENDOR = "-refkit"
Expand Down
2 changes: 1 addition & 1 deletion meta-refkit/conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ REFKIT_LOCALCONF_VERSION = "2"
LOCALCONF_VERSION = "${REFKIT_LOCALCONF_VERSION}"

# Same for LCONF_VERSION in bblayer.conf.sample.
REFKIT_LAYER_CONF_VERSION = "1"
REFKIT_LAYER_CONF_VERSION = "2"
LAYER_CONF_VERSION = "${REFKIT_LAYER_CONF_VERSION}"

# The default error messages use shell meta* wildcards to find the
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From dd07cf878a84662b684c0d59e6fd8effb341174e Mon Sep 17 00:00:00 2001
From: Ismo Puustinen <ismo.puustinen@intel.com>
Date: Tue, 21 Feb 2017 15:13:59 +0200
Subject: [PATCH] opencv: link dynamically against OpenCL library.

This removes the need for runtime /usr/lib/libOpenCL.so symlink.

Upstream-status: Inappropriate

Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
---
cmake/OpenCVDetectOpenCL.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmake/OpenCVDetectOpenCL.cmake b/cmake/OpenCVDetectOpenCL.cmake
index 433f244..5858945 100644
--- a/cmake/OpenCVDetectOpenCL.cmake
+++ b/cmake/OpenCVDetectOpenCL.cmake
@@ -3,7 +3,7 @@ if(APPLE)
set(OPENCL_LIBRARY "-framework OpenCL" CACHE STRING "OpenCL library")
set(OPENCL_INCLUDE_DIR "" CACHE PATH "OpenCL include directory")
else(APPLE)
- set(OPENCL_LIBRARY "" CACHE STRING "OpenCL library")
+ set(OPENCL_LIBRARY "-lOpenCL" CACHE STRING "OpenCL library")
set(OPENCL_INCLUDE_DIR "${OpenCV_SOURCE_DIR}/3rdparty/include/opencl/1.2" CACHE PATH "OpenCL include directory")
endif(APPLE)
mark_as_advanced(OPENCL_INCLUDE_DIR OPENCL_LIBRARY)
--
2.9.3

7 changes: 7 additions & 0 deletions meta-refkit/recipes-computervision/opencv/opencv_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI_append = " \
file://0001-opencv-link-dynamically-against-OpenCL-library.patch \
"

PACKAGECONFIG[opencl] = "-DWITH_OPENCL=ON,-DWITH_OPENCL=OFF,virtual/opencl-headers virtual/opencl-icd,"
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ RDEPENDS_${PN} = " \
opencv-samples \
python3-opencv \
librealsense-examples \
viennacl-examples \
"
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ RDEPENDS_${PN} = " \
gstreamer1.0-plugins-good \
libva-intel-driver \
librealsense \
packagegroup-opencl \
"
17 changes: 17 additions & 0 deletions meta-refkit/recipes-devtools/clang/clang_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# From meta-clang (cb30aad4d6ff5e996f7a8c5837591071243dcd2c):
#
# Author: Mikko Ylinen <mikko.ylinen@linux.intel.com>
# Date: Mon Feb 13 18:06:00 2017 +0200
#
# clang: set target DEPENDS for gcc TOOLCHAIN
#
# With the layer defaults (TOOLCHAIN ??= gcc) clang for target fails
# to build due to missing compilers in the native (recipe specific)
# sysroot.
#
# Set the necessary additional DEPENDS if TOOLCHAIN = gcc to get the
# compilers installed.
#
# Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com>

DEPENDS_append_class-target = " clang-cross-${TARGET_ARCH} ${@bb.utils.contains('TOOLCHAIN', 'gcc', 'virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++', '', d)}"
5 changes: 5 additions & 0 deletions meta-refkit/recipes-opencl/beignet/beignet-570x_git.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Recipe for compiling beignet for Intel Joule 570x

require beignet.inc

EXTRA_OECMAKE_append = " -DGEN_PCI_ID=0x1A84"
5 changes: 5 additions & 0 deletions meta-refkit/recipes-opencl/beignet/beignet-minnowmax_git.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Recipe for compiling beignet for Minnowboard Max

require beignet.inc

EXTRA_OECMAKE_append = " -DGEN_PCI_ID=0x0F31"
72 changes: 72 additions & 0 deletions meta-refkit/recipes-opencl/beignet/beignet.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
LICENSE = "LGPLv2.1+"
LIC_FILES_CHKSUM = "file://COPYING;md5=6b566c5b4da35d474758324899cb4562"

SRC_URI = "git://anongit.freedesktop.org/beignet;nobranch=1 \
file://fix-llvm-paths.patch \
file://0001-api-mark-platform-not-supported-if-device-is-not-fou.patch \
"
SRC_URI_append_class-native = " file://0001-reduced-native-for-1.3.0.patch"
SRC_URI_append_class-target = " file://0001-Run-native-gbe_bin_generater-to-compile-built-in-ker.patch"

BBCLASSEXTEND = "native"

# CMake cannot digest "+" in pathes -> replace it with dots.
PV = "1.3.0.${@ 'git${SRCPV}'.replace('+', '.')}"
SRCREV = "c8b47b1737402ff78151daec65c774d437f0b546"
S = "${WORKDIR}/git"

# we need to depend on ocl-icd, so that the exported symbols go right
DEPENDS = "${PN}-native clang libdrm mesa ocl-icd"
DEPENDS_class-native = "clang-native"

# To solve the PCI_ID problem, we use the target from filename for
# installing the library.

CL_HW_TARGET ?= "${@d.getVar('PN').split('-')[1]}"

# built-in kernels depend on libocl's headers (e.g. ocl_as.h) yet there is no
# dependency specified for that in beignet's build system. This causes race
# condition when libgbe.so is compiled for the target.
PARALLEL_MAKE = ""

inherit cmake pkgconfig

# There is no python in sysroot -> look for it on the build host.
# WARNING: remove CLang from the host otherwise it might get into use
# instead of the one from meta-clang.
OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "BOTH"

EXTRA_OECMAKE = " -DSTANDALONE_GBE_COMPILER_DIR=${STAGING_BINDIR_NATIVE} -DLLVM_LIBRARY_DIR=${STAGING_LIBDIR} -DBEIGNET_INSTALL_DIR=${libdir}/beignet-${CL_HW_TARGET}"
EXTRA_OECMAKE_class-native = " -DBEIGNET_INSTALL_DIR=/usr/lib/beignet -DLLVM_LIBRARY_DIR=${STAGING_LIBDIR_NATIVE}"

# TODO respect distrofeatures for x11
PACKAGECONFIG ??= ""
PACKAGECONFIG[examples] = '-DBUILD_EXAMPLES=1,-DBUILD_EXAMPLES=0,libva'
# TODO: add explicit on/off upstream
PACKAGECONFIG[x11] = ",,libxext libxfixes"

FILES_${PN} += " \
${sysconfdir}/OpenCL/vendors/intel-beignet-${CL_HW_TARGET}.icd \
${libdir} \
${libdir}/beignet-${CL_HW_TARGET}/ \
${libdir}/beignet-${CL_HW_TARGET}/* \
"

do_install_append_class-target () {
# Change the intel-beignet.icd file
rm ${D}${sysconfdir}/OpenCL/vendors/intel-beignet.icd
echo ${libdir}/beignet-${CL_HW_TARGET}/libcl.so > ${D}${sysconfdir}/OpenCL/vendors/intel-beignet-${CL_HW_TARGET}.icd
}

do_install_class-native() {
install -d ${D}${libdir}/cmake
install -m644 ${S}/CMake/FindStandaloneGbeCompiler.cmake ${D}${libdir}/cmake

install -d ${D}${bindir}
install ${B}/backend/src/gbe_bin_generater ${D}${bindir}
install ${B}/backend/src/libgbe.so ${D}${libdir}

install -d ${D}${bindir}/include
install ${B}/backend/src/libocl/usr/lib/beignet/include/* ${D}${bindir}/include
install ${B}/backend/src/libocl/usr/lib/beignet/beignet.bc ${D}${bindir}/
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From ea825ebc2ec47db4d3e794fef85de698c0f955a2 Mon Sep 17 00:00:00 2001
From: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
Date: Tue, 14 Jun 2016 12:33:40 +0300
Subject: [PATCH] Run native gbe_bin_generater to compile built-in kernels

Upstream-Status: Inappropriate [libgbe.so isn't supposed to be cross-compiled]

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
---
backend/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt
index 915d60f..c3041bc 100644
--- a/backend/CMakeLists.txt
+++ b/backend/CMakeLists.txt
@@ -58,6 +58,6 @@ set (GBE_BIN_GENERATER
PARENT_SCOPE)
else (USE_STANDALONE_GBE_COMPILER STREQUAL "true")
set (GBE_BIN_GENERATER
- ${GBE_BIN_GENERATER} LD_LIBRARY_PATH=${CMAKE_CURRENT_BINARY_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src/gbe_bin_generater
+ ${GBE_BIN_GENERATER} ${STANDALONE_GBE_COMPILER_DIR}/gbe_bin_generater
PARENT_SCOPE)
endif (USE_STANDALONE_GBE_COMPILER STREQUAL "true")
--
2.5.5

Loading