public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Marek Szuba" <marecki@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/beignet/files/, dev-libs/beignet/
Date: Wed, 11 Jul 2018 10:07:42 +0000 (UTC)	[thread overview]
Message-ID: <1531303657.f6b57af58d4fed1bb3144aa11e12abc7652754cd.marecki@gentoo> (raw)

commit:     f6b57af58d4fed1bb3144aa11e12abc7652754cd
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 11 10:06:08 2018 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Wed Jul 11 10:07:37 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6b57af5

dev-libs/beignet: support LLVM-6

Uses an unofficial patch from Arch Linux. Seems to work fine.

Suggested-by: Hanno Meyer-Thurow <h.mth <AT> web.de>
Closes: https://bugs.gentoo.org/show_bug.cgi?id=658794
Package-Manager: Portage-2.3.40, Repoman-2.3.9

 dev-libs/beignet/beignet-1.3.2-r1.ebuild         | 106 +++++++++++++++++++++++
 dev-libs/beignet/files/beignet-1.3.2_llvm6.patch |  27 ++++++
 2 files changed, 133 insertions(+)

diff --git a/dev-libs/beignet/beignet-1.3.2-r1.ebuild b/dev-libs/beignet/beignet-1.3.2-r1.ebuild
new file mode 100644
index 00000000000..c562b68c13b
--- /dev/null
+++ b/dev-libs/beignet/beignet-1.3.2-r1.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+CMAKE_BUILD_TYPE="Release"
+
+inherit python-any-r1 cmake-multilib flag-o-matic llvm toolchain-funcs
+
+DESCRIPTION="OpenCL implementation for Intel GPUs"
+HOMEPAGE="https://01.org/beignet"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+IUSE="ocl-icd ocl20"
+
+if [[ "${PV}" == "9999" ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://anongit.freedesktop.org/git/beignet.git"
+	KEYWORDS=""
+else
+	KEYWORDS="~amd64"
+	SRC_URI="https://01.org/sites/default/files/${P}-source.tar.gz"
+	S=${WORKDIR}/Beignet-${PV}-Source
+fi
+
+COMMON="media-libs/mesa[${MULTILIB_USEDEP}]
+	<sys-devel/clang-6.0.9999:=[${MULTILIB_USEDEP}]
+	>=x11-libs/libdrm-2.4.70[video_cards_intel,${MULTILIB_USEDEP}]
+	x11-libs/libXext[${MULTILIB_USEDEP}]
+	x11-libs/libXfixes[${MULTILIB_USEDEP}]"
+RDEPEND="${COMMON}
+	app-eselect/eselect-opencl"
+DEPEND="${COMMON}
+	${PYTHON_DEPS}
+	ocl-icd? ( dev-libs/ocl-icd )
+	virtual/pkgconfig"
+
+LLVM_MAX_SLOT=6
+
+PATCHES=(
+	"${FILESDIR}"/no-debian-multiarch.patch
+	"${FILESDIR}"/${PN}-1.3.2_cmake-llvm-config-multilib.patch
+	"${FILESDIR}"/${PN}-1.3.2_llvm6.patch
+	"${FILESDIR}"/${PN}-1.3.1-oclicd_no_upstream_icdfile.patch
+	"${FILESDIR}"/${PN}-1.2.0_no-hardcoded-cflags.patch
+	"${FILESDIR}"/llvm-terminfo.patch
+)
+
+DOCS=(
+	docs/.
+)
+
+pkg_pretend() {
+	if [[ ${MERGE_TYPE} != "binary" ]]; then
+		if tc-is-gcc; then
+			if [[ $(gcc-major-version) -eq 4 ]] && [[ $(gcc-minor-version) -lt 6 ]]; then
+				eerror "Compilation with gcc older than 4.6 is not supported"
+				die "Too old gcc found."
+			fi
+		fi
+	fi
+}
+
+pkg_setup() {
+	llvm_pkg_setup
+	python_setup
+}
+
+src_prepare() {
+	# See Bug #593968
+	append-flags -fPIC
+
+	cmake-utils_src_prepare
+	# We cannot run tests because they require permissions to access
+	# the hardware, and building them is very time-consuming.
+	cmake_comment_add_subdirectory utests
+}
+
+multilib_src_configure() {
+	VENDOR_DIR="/usr/$(get_libdir)/OpenCL/vendors/${PN}"
+
+	local mycmakeargs=(
+		-DCMAKE_INSTALL_PREFIX="${VENDOR_DIR}"
+		-DOCLICD_COMPAT=$(usex ocl-icd)
+		$(usex ocl20 "" "-DENABLE_OPENCL_20=OFF")
+	)
+
+	cmake-utils_src_configure
+}
+
+multilib_src_install() {
+	VENDOR_DIR="/usr/$(get_libdir)/OpenCL/vendors/${PN}"
+
+	cmake-utils_src_install
+
+	insinto /etc/OpenCL/vendors/
+	echo "${VENDOR_DIR}/lib/${PN}/libcl.so" > "${PN}-${ABI}.icd" || die "Failed to generate ICD file"
+	doins "${PN}-${ABI}.icd"
+
+	dosym "lib/${PN}/libcl.so" "${VENDOR_DIR}"/libOpenCL.so.1
+	dosym "lib/${PN}/libcl.so" "${VENDOR_DIR}"/libOpenCL.so
+	dosym "lib/${PN}/libcl.so" "${VENDOR_DIR}"/libcl.so.1
+	dosym "lib/${PN}/libcl.so" "${VENDOR_DIR}"/libcl.so
+}

diff --git a/dev-libs/beignet/files/beignet-1.3.2_llvm6.patch b/dev-libs/beignet/files/beignet-1.3.2_llvm6.patch
new file mode 100644
index 00000000000..be3ccbc4432
--- /dev/null
+++ b/dev-libs/beignet/files/beignet-1.3.2_llvm6.patch
@@ -0,0 +1,27 @@
+--- a/backend/src/llvm/llvm_to_gen.cpp
++++ b/backend/src/llvm/llvm_to_gen.cpp
+@@ -322,7 +322,11 @@ namespace gbe
+     DataLayout DL(&mod);
+     
+     gbeDiagnosticContext dc;
++#if LLVM_VERSION_MAJOR >= 6
++    mod.getContext().setDiagnosticHandlerCallBack(&gbeDiagnosticHandler,&dc);
++#else
+     mod.getContext().setDiagnosticHandler(&gbeDiagnosticHandler,&dc);
++#endif
+ 
+ #if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 37
+     mod.setDataLayout(DL);
+--- a/backend/src/llvm/llvm_unroll.cpp
++++ b/backend/src/llvm/llvm_unroll.cpp
+@@ -205,7 +205,9 @@ namespace gbe {
+           if (parentTripCount != 0 && currTripCount * parentTripCount > 32) {
+             //Don't change the unrollID if doesn't force unroll.
+             //setUnrollID(parentL, false);
+-#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
++#if LLVM_VERSION_MAJOR >= 6
++            loopInfo.erase(parentL);
++#elif LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
+             loopInfo.markAsRemoved(parentL);
+ #else
+             LPM.deleteLoopFromQueue(parentL);


             reply	other threads:[~2018-07-11 10:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11 10:07 Marek Szuba [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-06-30 12:58 [gentoo-commits] repo/gentoo:master commit in: dev-libs/beignet/files/, dev-libs/beignet/ Marek Szuba
2017-03-24 15:08 Marek Szuba
2017-02-19 17:46 Marek Szuba
2017-01-25 14:51 Marek Szuba
2016-09-16  7:35 Marek Szuba
2016-09-02  7:38 Marek Szuba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1531303657.f6b57af58d4fed1bb3144aa11e12abc7652754cd.marecki@gentoo \
    --to=marecki@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox