f265e5d905
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 Clover (Mesa3D's OpenCL implementation for AMD GPUs. It needs to be compiled with host-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 can be built dynamically on the target using libclang and libLLVM, it is necessary to have clc headers installed on the target. Buildroot removes /usr/include in its target-finalize step, so clc headers are installed to /usr/share/clc. Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr> Signed-off-by: Valentin Korenblit <valentinkorenblit@gmail.com> Reviewed-by: Romain Naour <romain.naour@smile.fr> [Thomas: - fix license information as noticed by Romain - add comment to explain why --includedir=/usr/share is used] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
48 lines
1.4 KiB
Makefile
48 lines
1.4 KiB
Makefile
################################################################################
|
|
#
|
|
# libclc
|
|
#
|
|
################################################################################
|
|
|
|
# There are only two releases: release_35 and release_38, but the last
|
|
# commit is from 2 years ago. Master has some recent activity.
|
|
LIBCLC_VERSION = dabae5a2afb78cba0320a86e3f5f0b5dc83e077c
|
|
LIBCLC_SITE = https://git.llvm.org/git/libclc
|
|
LIBCLC_SITE_METHOD = git
|
|
LIBCLC_LICENSE = NCSA or MIT
|
|
LIBCLC_LICENSE_FILES = LICENSE.TXT
|
|
|
|
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.
|
|
#
|
|
# The headers are installed in /usr/share and not /usr/include,
|
|
# because they are needed at runtime on the target to build the OpenCL
|
|
# kernels.
|
|
LIBCLC_CONF_OPTS = \
|
|
--with-llvm-config=$(HOST_DIR)/usr/bin/llvm-config \
|
|
--prefix=/usr \
|
|
--includedir=/usr/share \
|
|
--pkgconfigdir=/usr/lib/pkgconfig \
|
|
--with-cxx-compiler=$(HOSTCXX)
|
|
|
|
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))
|