blob: 6aff690ebe4b3789af137c186fc00d052b728e68 (
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
PORTNAME= ispc
DISTVERSIONPREFIX= v
DISTVERSION= 1.18.0
CATEGORIES= devel
MAINTAINER= yuri@FreeBSD.org
COMMENT= Intel's compiler for high-performance SIMD programming
WWW= https://ispc.github.io/
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
ONLY_FOR_ARCHS= aarch64 amd64 i386
ONLY_FOR_ARCHS_REASON= only available for these architectures
BUILD_DEPENDS= ${LOCALBASE}/bin/flex:textproc/flex \
m4:devel/m4
LIB_DEPENDS= libLLVM.so:devel/llvm${LLVM_VERSION}
USES= bison cmake compiler:c++14-lang python:build,test shebangfix
USE_LDCONFIG= yes
USE_GITHUB= yes
GH_TUPLE= google:googletest:6a7ed31:googletest/ispcrt/tests/vendor/google/googletest
SHEBANG_FILES= *.py
CONFIGURE_ENV= PATH=${LOCALBASE}/llvm${LLVM_VERSION}/bin:${PATH} # see https://github.com/ispc/ispc/issues/2318
CMAKE_OFF= ISPC_NO_DUMPS DISPCRT_BUILD_GPU ISPC_INCLUDE_TESTS ISPCRT_BUILD_TESTS ISPC_INCLUDE_EXAMPLES
CMAKE_ARGS= -DFREEBSD_LLVM_VERSION=${LLVM_VERSION} # see https://github.com/ispc/ispc/issues/2318
BINARY_ALIAS= flex=${LOCALBASE}/bin/flex python=${PYTHON_CMD} m4=${LOCALBASE}/bin/gm4
OPTIONS_DEFINE_amd64= ARM XE
OPTIONS_DEFINE_i386= ARM
ARM_DESC= Enable ARM support - requires ARM backend in LLVM
ARM_CMAKE_BOOL= ARM_ENABLED
XE_DESC= Enable Intel Xe support
XE_BUILD_DEPENDS= ${LOCALBASE}/llvm${LLVM_VERSION}/lib/libLLVMGenXIntrinsics.a:devel/vc-intrinsics@llvm${LLVM_VERSION}
XE_LIB_DEPENDS= libze_loader.so:devel/level-zero \
libLLVMSPIRVLib.so.${LLVM_VERSION}:devel/spirv-llvm-translator@llvm${LLVM_VERSION}
XE_CMAKE_BOOL= XE_ENABLED
XE_CMAKE_BOOL_OFF= ISPCRT_BUILD_TESTS
XE_CMAKE_ON= -DXE_DEPS_DIR:PATH="${LOCALBASE}/llvm${LLVM_VERSION}" -DISPC_INCLUDE_XE_EXAMPLES=OFF
XE_PLIST_FILES= include/ispcrt/ispcrt.h \
include/ispcrt/ispcrt.hpp \
include/ispcrt/ispcrt.isph \
lib/cmake/ispcrt-${PORTVERSION}/Finddpcpp_compiler.cmake \
lib/cmake/ispcrt-${PORTVERSION}/Findlevel_zero.cmake \
lib/cmake/ispcrt-${PORTVERSION}/interop.cmake \
lib/cmake/ispcrt-${PORTVERSION}/ispc.cmake \
lib/cmake/ispcrt-${PORTVERSION}/ispcrtConfig.cmake \
lib/cmake/ispcrt-${PORTVERSION}/ispcrt_Exports-%%CMAKE_BUILD_TYPE%%.cmake \
lib/cmake/ispcrt-${PORTVERSION}/ispcrt_Exports.cmake \
lib/libispcrt.so \
lib/libispcrt.so.1 \
lib/libispcrt.so.${PORTVERSION} \
lib/libispcrt_static.a
XE_BROKEN= Unknown architecture
#.include <bsd.port.options.mk>
#.if ${LLVM_DEFAULT:M[7891]0} || ${LLVM_DEFAULT:M1[12]} # max(LLVM_DEFAULT,13)
#LLVM_VERSION= 13
#.else
#LLVM_VERSION= ${LLVM_DEFAULT}
#.endif
LLVM_VERSION?= 13
do-test: # all tests pass
@cd ${WRKSRC} && ISPC_HOME=${BUILD_WRKSRC}/bin ./run_tests.py
test-check-all: # the upstream claims that some of these checks are broken without using their patched llvm version, hence using llvm-devel
@cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} check-all
run-examples: build
@[ -f ${LOCALBASE}/lib/libtbb.so ] || ! echo "ERROR run-examples target requires devel/tbb package installed"
.for e in simple sort mandelbrot stencil
@cd ${WRKSRC}/examples/${e} && \
${ECHO} "===> Running example ${e}" && \
${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} && \
./${e}
.endfor
.include <bsd.port.mk>
|