aboutsummaryrefslogtreecommitdiff
path: root/devel/intel-graphics-compiler/Makefile
blob: 09fa0d2a4024c5e026a3560133cb36525e144c72 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
PORTNAME=	intel-graphics-compiler
DISTVERSIONPREFIX=	igc-
DISTVERSION=	1.0.12504.5
CATEGORIES=	devel
PKGNAMESUFFIX=	-${FLAVOR}

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Intel Graphics Compiler for OpenCL
WWW=		https://01.org/compute-runtime

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/LICENSE.md

ONLY_FOR_ARCHS=	aarch64 amd64 i386
ONLY_FOR_ARCHS_REASON=	only Intel GPUs on x86 are supported
BROKEN_FreeBSD_14_i386=	lld crashes during build

BUILD_DEPENDS=	vc-intrinsics-${FLAVOR}>=0.4.0:devel/vc-intrinsics@${FLAVOR}
LIB_DEPENDS=	libLLVM-${FLAVOR:S/llvm//}.so:devel/${FLAVOR} \
		libopencl-clang.so.${FLAVOR:S/llvm//}:devel/opencl-clang@${FLAVOR} \
		libLLVMSPIRVLib.so.${FLAVOR:S/llvm//}:devel/spirv-llvm-translator@${FLAVOR}

FLAVORS=	${14 13 12 11:L:S/^/llvm/}

CONFLICTS_INSTALL=	${PORTNAME}-llvm*

USES=		bison cmake compiler:c++17-lang python:build
USE_GITHUB=	yes
USE_LDCONFIG=	yes
GH_ACCOUNT=	intel
GH_TUPLE=	KhronosGroup:SPIRV-Headers:1.5.4.raytracing.fixed-123-g814e728:headers/../SPIRV-Headers \
		KhronosGroup:SPIRV-Tools:v2021.4:tools/../SPIRV-Tools
CMAKE_ARGS=	-DCMAKE_PREFIX_PATH:PATH="${LOCALBASE}/${FLAVOR}" \
		-DIGC_OPTION__LLVM_PREFERRED_VERSION:STRING="${FLAVOR:S/llvm//}" \
		-DIGC_OPTION__VC_INTRINSICS_MODE:STRING=Prebuilds
CFLAGS+=	-Wno-macro-redefined # __fastcall
PLIST_SUB=	ARCH_SUFX=${ARCH:S/aarch//:S/amd//:S/i386/32/:S/x86_//}

post-patch:
# lang/python* don't install unsuffixed symlinks
	@${REINPLACE_CMD} -i .python \
		-e '/EXECUTABLE/s/"python"/"${PYTHON_CMD:T}"/' \
		-e '/IGC_PYTHON/s/"python"/"${PYTHON_CMD:T}"/' \
		${WRKSRC}/IGC/CMakeLists.txt \
		${WRKSRC}/IGC/BiFModule/linux/CMakeLists.txt
# No need to abort on every benign warning enabled by default
# Disable debug symbols unless WITH_DEBUG passed via CXXFLAGS
	@${REINPLACE_CMD} -e 's/"-Werror"//; /-Werror/d' \
		-e 's/"-g"//' \
		${WRKSRC}/IGC/CMakeLists.txt
# Search LLVMSPIRVLib.pc where devel/spirv-llvm-translator installs
	@${REINPLACE_CMD} -e '/pkgconfig/s,$${_libdir},&/../libdata,' \
		${WRKSRC}/IGC/cmake/modules/FindSPIRVLLVMTranslator.cmake

.include <bsd.port.mk>