All of lore.kernel.org
 help / color / mirror / Atom feed
From: Valentin Korenblit <valentin.korenblit@smile.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4 09/11] package/libclc: new package
Date: Thu, 29 Mar 2018 13:33:44 +0200	[thread overview]
Message-ID: <20180329113346.10367-10-valentin.korenblit@smile.fr> (raw)
In-Reply-To: <20180329113346.10367-1-valentin.korenblit@smile.fr>

This patch provides libclc, an open source implementation of the
library requirements of the OpenCL C programming language, as
specified by the OpenCL 1.1 Specification. It is intended to be used
with Mesa Clover.

It needs to be compiled with Clang, as it generates LLVM IR bitcode
files containing device builtin functions for each target.

Currently, libclc supports AMDGCN, R600 and NVPTX targets.

As OpenCL kernels are built dynamically on the target using libClang and
libLLVM, it is necessary to copy /usr/include/clc from STAGING_DIR to the
target manually, as Buildroot doesn't include this directory.

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
---
 DEVELOPERS               |  1 +
 package/Config.in        |  1 +
 package/libclc/Config.in |  9 +++++++++
 package/libclc/libclc.mk | 38 ++++++++++++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+)
 create mode 100644 package/libclc/Config.in
 create mode 100644 package/libclc/libclc.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 47aa2dd82a..6bcafb6d2a 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1860,6 +1860,7 @@ F:	package/tstools/
 
 N:	Valentin Korenblit <valentin.korenblit@smile.fr>
 F:	package/clang/
+F:	package/libclc/
 F:	package/llvm/
 
 N:	Vanya Sergeev <vsergeev@gmail.com>
diff --git a/package/Config.in b/package/Config.in
index 4d32d749fb..bc2228ed17 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -281,6 +281,7 @@ comment "Graphic libraries"
 	source "package/fbv/Config.in"
 	source "package/freerdp/Config.in"
 	source "package/imagemagick/Config.in"
+	source "package/libclc/Config.in"
 	source "package/linux-fusion/Config.in"
 	source "package/lite/Config.in"
 	source "package/mesa3d/Config.in"
diff --git a/package/libclc/Config.in b/package/libclc/Config.in
new file mode 100644
index 0000000000..797f090bfc
--- /dev/null
+++ b/package/libclc/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_LIBCLC
+	bool "libclc"
+	depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
+	help
+	  libclc is an open source, BSD licensed implementation of
+	  the library requirements of the OpenCL C programming language,
+	  as specified by the OpenCL 1.1 Specification.
+
+	  http://libclc.llvm.org/
diff --git a/package/libclc/libclc.mk b/package/libclc/libclc.mk
new file mode 100644
index 0000000000..b8b4dca273
--- /dev/null
+++ b/package/libclc/libclc.mk
@@ -0,0 +1,38 @@
+################################################################################
+#
+# libclc
+#
+################################################################################
+
+LIBCLC_VERSION = 00236279a293b3737dee08c14f25923a889d2795
+LIBCLC_SITE = https://git.llvm.org/git/libclc
+LIBCLC_SITE_METHOD = git
+
+LIBCLC_DEPENDENCIES = host-clang host-llvm
+LIBCLC_INSTALL_STAGING = YES
+
+# C++ compiler is used to build a small tool (prepare-builtins) for the host.
+# It must be built with the C++ compiler from the host, simply use
+# HOSTCXX_NOCCACHE.
+LIBCLC_CONF_OPTS = --with-llvm-config=$(HOST_DIR)/usr/bin/llvm-config \
+	--prefix="/usr" \
+	--pkgconfigdir="/usr/lib/pkgconfig" \
+	--with-cxx-compiler='$(HOSTCXX_NOCCACHE)'
+
+define LIBCLC_CONFIGURE_CMDS
+	(cd $(@D); $(TARGET_CONFIGURE_OPTS) ./configure.py $(LIBCLC_CONF_OPTS))
+endef
+
+define LIBCLC_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
+endef
+
+define LIBCLC_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
+endef
+
+define LIBCLC_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install
+endef
+
+$(eval $(generic-package))
-- 
2.14.3

  parent reply	other threads:[~2018-03-29 11:33 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29 11:33 [Buildroot] [PATCH v4 00/11] llvm for mesa3d Valentin Korenblit
2018-03-29 11:33 ` [Buildroot] [PATCH v4 01/11] package/llvm: new host package Valentin Korenblit
2018-04-01 20:36   ` Thomas Petazzoni
2018-03-29 11:33 ` [Buildroot] [PATCH v4 02/11] package/llvm: enable target variant Valentin Korenblit
2018-04-01 20:46   ` Thomas Petazzoni
2018-04-01 22:50     ` Arnout Vandecappelle
2018-03-29 11:33 ` [Buildroot] [PATCH v4 03/11] package/llvm: enable AMDGPU Valentin Korenblit
2018-03-30  9:02   ` Thomas Petazzoni
2018-03-30 11:33     ` Valentin Korenblit
2018-03-30 18:08     ` Arnout Vandecappelle
2018-03-30 19:06       ` Thomas Petazzoni
2018-03-30 20:33         ` Valentin Korenblit
2018-04-01 20:47           ` Thomas Petazzoni
2018-03-29 11:33 ` [Buildroot] [PATCH v4 04/11] package/mesa3d: enable llvm support Valentin Korenblit
2018-04-01 20:53   ` Thomas Petazzoni
2018-04-02 10:05     ` Valentin Korenblit
2018-04-02 12:01       ` Thomas Petazzoni
2018-03-29 11:33 ` [Buildroot] [PATCH v4 05/11] package/llvm: enable ARM Valentin Korenblit
2018-04-01 20:53   ` Thomas Petazzoni
2018-03-29 11:33 ` [Buildroot] [PATCH v4 06/11] package/llvm: enable AArch64 Valentin Korenblit
2018-03-29 11:33 ` [Buildroot] [PATCH v4 07/11] package/clang: new host package Valentin Korenblit
2018-03-30 16:56   ` Matthew Weber
2018-03-30 20:24     ` Valentin Korenblit
2018-04-01 20:56   ` Thomas Petazzoni
2018-03-29 11:33 ` [Buildroot] [PATCH v4 08/11] package/clang: enable target variant Valentin Korenblit
2018-03-30  9:07   ` Thomas Petazzoni
2018-03-30 12:16     ` Valentin Korenblit
2018-03-30 12:37       ` Thomas Petazzoni
2018-03-30 17:58   ` Matthew Weber
2018-04-01 21:25   ` Thomas Petazzoni
2018-03-29 11:33 ` Valentin Korenblit [this message]
2018-04-01 21:29   ` [Buildroot] [PATCH v4 09/11] package/libclc: new package Thomas Petazzoni
2018-04-03 12:27     ` Valentin Korenblit
2018-04-03 15:17       ` Thomas Petazzoni
2018-04-03 16:26         ` Valentin Korenblit
2018-03-29 11:33 ` [Buildroot] [PATCH v4 10/11] package/mesa3d: enable OpenCL support Valentin Korenblit
2018-04-01 21:32   ` Thomas Petazzoni
2018-04-02  5:23     ` Erik Larsson
2018-04-02  6:51       ` Thomas Petazzoni
2018-04-02 10:36     ` Valentin Korenblit
2018-04-02 12:03       ` Thomas Petazzoni
2018-03-29 11:33 ` [Buildroot] [PATCH v4 11/11] package/clinfo: new package Valentin Korenblit

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=20180329113346.10367-10-valentin.korenblit@smile.fr \
    --to=valentin.korenblit@smile.fr \
    --cc=buildroot@busybox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.