summaryrefslogtreecommitdiffstats
path: root/dynamic-layers
diff options
context:
space:
mode:
authorNaveen Saini <naveen.kumar.saini@intel.com>2021-07-02 16:47:17 +0800
committerAnuj Mittal <anuj.mittal@intel.com>2021-07-03 22:48:10 +0800
commitf808528a90bc6fff3f25c69de2103af827c5d7e6 (patch)
tree88d93a1506caf1c6e26d1ab48c1d0b99329fe224 /dynamic-layers
parent73a27c9d8044280681486c871225afd21c2f9554 (diff)
downloadmeta-intel-f808528a90bc6fff3f25c69de2103af827c5d7e6.tar.gz
ispc: add recipe
Intel(R) Implicit SPMD Program Compiler (Intel(R) ISPC) ispc is a compiler for a variant of the C programming language, with extensions for single program, multiple data programming. Under the SPMD model, the programmer writes a program that generally appears to be a regular serial program, though the execution model is actually that a number of program instances execute in parallel on the hardware. https://ispc.github.io/downloads.html https://github.com/ispc/ispc Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'dynamic-layers')
-rw-r--r--dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-CMakeLists.txt-link-with-libclang-cpp-library-instea.patch28
-rw-r--r--dynamic-layers/clang-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch64
-rw-r--r--dynamic-layers/clang-layer/recipes-core/ispc/ispc/8b5d0f26916e776bc3664e6a4dc68eff3a198d7a.patch38
-rw-r--r--dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.16.0.bb36
4 files changed, 166 insertions, 0 deletions
diff --git a/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-CMakeLists.txt-link-with-libclang-cpp-library-instea.patch b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-CMakeLists.txt-link-with-libclang-cpp-library-instea.patch
new file mode 100644
index 00000000..4e25420c
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0001-CMakeLists.txt-link-with-libclang-cpp-library-instea.patch
@@ -0,0 +1,28 @@
1From b9bc0df996d1e65fd70d5eb2d40866693f23bb67 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Thu, 24 Jun 2021 17:53:27 +0800
4Subject: [PATCH] CMakeLists.txt: link with libclang-cpp library instead
5
6Upstream-Status: Inappropriate
7
8Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
9---
10 CMakeLists.txt | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/CMakeLists.txt b/CMakeLists.txt
14index ef88317e..7507d6a5 100644
15--- a/CMakeLists.txt
16+++ b/CMakeLists.txt
17@@ -281,7 +281,7 @@ if (WASM_ENABLED)
18 list(APPEND ISPC_TARGETS wasm-i32x4)
19 endif()
20
21-set(CLANG_LIBRARY_LIST clangFrontend clangDriver clangSerialization clangParse clangSema clangAnalysis clangAST clangBasic clangEdit clangLex)
22+set(CLANG_LIBRARY_LIST clang-cpp)
23 set(LLVM_COMPONENTS engine ipo bitreader bitwriter instrumentation linker option frontendopenmp)
24
25 if (X86_ENABLED)
26--
272.17.1
28
diff --git a/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch
new file mode 100644
index 00000000..5f3c7d0b
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch
@@ -0,0 +1,64 @@
1From 3f3f81bde7d9d80921515ed0bf7fe36e69319bc4 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Wed, 30 Jun 2021 13:47:41 +0800
4Subject: [PATCH] cmake: don't build for 32-bit targets
5
6Error log:
7| tmp/work/corei7-64-poky-linux/ispc/1.16.0-r0/recipe-sysroot/usr/include/bits/long-double.h:23:10: fatal error: 'bits/long-double-32.h' file not found
8| #include <bits/long-double-32.h>
9| ^~~~~~~~~~~~~~~~~~~~~~~
10| 1 error generated.
11
12Remove SYSTEM include search path and set -isysroot dir path
13for root dir for cross compilation.
14
15Upstream-Status: Inappropriate
16
17Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
18---
19 cmake/GenerateBuiltins.cmake | 8 ++++----
20 1 file changed, 4 insertions(+), 4 deletions(-)
21
22diff --git a/cmake/GenerateBuiltins.cmake b/cmake/GenerateBuiltins.cmake
23index 15a74788..db30f809 100644
24--- a/cmake/GenerateBuiltins.cmake
25+++ b/cmake/GenerateBuiltins.cmake
26@@ -249,7 +249,7 @@ function(builtin_to_cpp bit os_name arch supported_archs supported_oses resultFi
27 # In this case headers will be installed in /usr/arm-linux-gnueabihf/include and will not be picked up
28 # by clang by default. So the following line adds such path explicitly. If this path doesn't exist and
29 # the headers can be found in other locations, this should not be a problem.
30- set(includePath -isystem/usr/${debian_triple}/include)
31+ set(includePath -isysroot${SYSROOT_DIR})
32 endif()
33 endif()
34
35@@ -331,7 +331,7 @@ function (generate_target_builtins resultList)
36 set(regular_targets ${ARGN})
37 list(FILTER regular_targets EXCLUDE REGEX wasm)
38 foreach (ispc_target ${regular_targets})
39- foreach (bit 32 64)
40+ foreach (bit 64)
41 foreach (os_name ${TARGET_OS_LIST_FOR_LL})
42 target_ll_to_cpp(target-${ispc_target} ${bit} ${os_name} output${os_name}${bit})
43 list(APPEND tmpList ${output${os_name}${bit}})
44@@ -392,7 +392,7 @@ function (generate_common_builtins resultList)
45 endif()
46
47 message (STATUS "ISPC will be built with support of ${supported_oses} for ${supported_archs}")
48- foreach (bit 32 64)
49+ foreach (bit 64)
50 foreach (os_name "windows" "linux" "freebsd" "macos" "android" "ios" "ps4" "web")
51 foreach (arch "x86" "arm" "wasm32")
52 builtin_to_cpp(${bit} ${os_name} ${arch} "${supported_archs}" "${supported_oses}" res${bit}${os_name}${arch})
53@@ -405,7 +405,7 @@ function (generate_common_builtins resultList)
54 endforeach()
55 endforeach()
56 if (GENX_ENABLED)
57- foreach (bit 32 64)
58+ foreach (bit 64)
59 builtin_genx_to_cpp(${bit} res_genx_${bit})
60 list(APPEND tmpList ${res_genx_${bit}} )
61 if(MSVC)
62--
632.17.1
64
diff --git a/dynamic-layers/clang-layer/recipes-core/ispc/ispc/8b5d0f26916e776bc3664e6a4dc68eff3a198d7a.patch b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/8b5d0f26916e776bc3664e6a4dc68eff3a198d7a.patch
new file mode 100644
index 00000000..1b87af4c
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-core/ispc/ispc/8b5d0f26916e776bc3664e6a4dc68eff3a198d7a.patch
@@ -0,0 +1,38 @@
1From 8b5d0f26916e776bc3664e6a4dc68eff3a198d7a Mon Sep 17 00:00:00 2001
2From: Dmitry Babokin <dmitry.y.babokin@intel.com>
3Date: Wed, 16 Jun 2021 20:38:44 -0700
4Subject: [PATCH] Do not use depricated file open flags
5
6Upstream-Status: Backport [https://github.com/ispc/ispc/commit/8b5d0f26916e776bc3664e6a4dc68eff3a198d7a]
7Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
8---
9 src/module.cpp | 2 +-
10 src/opt.cpp | 2 +-
11 2 files changed, 2 insertions(+), 2 deletions(-)
12
13diff --git a/src/module.cpp b/src/module.cpp
14index 1e68d30c4..352bcd09e 100644
15--- a/src/module.cpp
16+++ b/src/module.cpp
17@@ -1314,7 +1314,7 @@ bool Module::writeObjectFileOrAssembly(llvm::TargetMachine *targetMachine, llvm:
18 llvm::CodeGenFileType fileType = (outputType == Object) ? llvm::CGFT_ObjectFile : llvm::CGFT_AssemblyFile;
19 bool binary = (fileType == llvm::CGFT_ObjectFile);
20
21- llvm::sys::fs::OpenFlags flags = binary ? llvm::sys::fs::F_None : llvm::sys::fs::F_Text;
22+ llvm::sys::fs::OpenFlags flags = binary ? llvm::sys::fs::OF_None : llvm::sys::fs::OF_Text;
23
24 std::error_code error;
25
26diff --git a/src/opt.cpp b/src/opt.cpp
27index ae1a11d3d..de1b27e1e 100644
28--- a/src/opt.cpp
29+++ b/src/opt.cpp
30@@ -4687,7 +4687,7 @@ void DebugPassFile::run(llvm::Module &module, bool init) {
31 std::error_code EC;
32 char fname[100];
33 snprintf(fname, sizeof(fname), "%s_%d_%s.ll", init ? "init" : "ir", pnum, sanitize(std::string(pname)).c_str());
34- llvm::raw_fd_ostream OS(fname, EC, llvm::sys::fs::F_None);
35+ llvm::raw_fd_ostream OS(fname, EC, llvm::sys::fs::OF_None);
36 Assert(!EC && "IR dump file creation failed!");
37 module.print(OS, 0);
38 }
diff --git a/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.16.0.bb b/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.16.0.bb
new file mode 100644
index 00000000..5355140b
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-core/ispc/ispc_1.16.0.bb
@@ -0,0 +1,36 @@
1SUMMARY = "Intel(R) Implicit SPMD Program Compiler"
2DESCRIPTION = "ispc is a compiler for a variant of the C programming language, \
3with extensions for single program, multiple data programming."
4HOMEPAGE = "https://github.com/ispc/ispc"
5
6LICENSE = "BSD-3-Clause & Apache-2.0-with-LLVM-exception"
7LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=da5ecffdd210b3cf776b32b41c182e87 \
8 file://third-party-programs.txt;md5=3cd6f8a7c3bd9d2bb898fcb27c75221a"
9
10inherit cmake python3native
11
12S = "${WORKDIR}/git"
13
14SRC_URI = "git://github.com/ispc/ispc.git;protocol=https;branch=main \
15 file://0001-CMakeLists.txt-link-with-libclang-cpp-library-instea.patch \
16 file://0002-cmake-don-t-build-for-32-bit-targets.patch \
17 file://8b5d0f26916e776bc3664e6a4dc68eff3a198d7a.patch \
18 "
19SRCREV = "bdd411085d3e398cf7927cb3b94b00af676737ba"
20
21COMPATIBLE_HOST = '(x86_64).*-linux'
22
23DEPENDS += " clang-native bison-native "
24RDEPENDS_${PN} += " clang-libllvm clang"
25
26EXTRA_OECMAKE += " \
27 -DISPC_INCLUDE_TESTS=OFF \
28 -DISPC_INCLUDE_EXAMPLES=OFF \
29 -DISPC_NO_DUMPS=ON \
30 -DARM_ENABLED=OFF \
31 -DISPC_CROSS=ON \
32 -DSYSROOT_DIR=${STAGING_DIR_NATIVE} \
33 "
34
35TOOLCHAIN = "clang"
36BBCLASSEXTEND = "native nativesdk"