diff options
author | Naveen Saini <naveen.kumar.saini@intel.com> | 2022-11-22 16:42:17 +0800 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2022-11-23 10:50:02 +0800 |
commit | f9e2e05f0d4896f4cfe674cbbc08294075ca9a04 (patch) | |
tree | d887dccabeb9ce725c432a7167a850c855c54b50 /documentation | |
parent | 18fcf4996df4ee1b00cc4013801fb4023ba177fc (diff) | |
download | meta-intel-f9e2e05f0d4896f4cfe674cbbc08294075ca9a04.tar.gz |
dpcpp-compiler.md: add document for icx installation
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/dpcpp-compiler.md | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/documentation/dpcpp-compiler.md b/documentation/dpcpp-compiler.md new file mode 100644 index 00000000..b709a685 --- /dev/null +++ b/documentation/dpcpp-compiler.md | |||
@@ -0,0 +1,107 @@ | |||
1 | Intel(R) oneAPI DPC++/C++ Compiler (ICX) toolchain | ||
2 | ========================================================================== | ||
3 | |||
4 | Get Started with the Intel oneAPI DPC++/C++ Compiler: | ||
5 | |||
6 | https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html# | ||
7 | |||
8 | |||
9 | Getting Started | ||
10 | =============== | ||
11 | |||
12 | Clone the required layers and include them in bblayers.conf: | ||
13 | |||
14 | ``` | ||
15 | git clone https://git.openembedded.org/openembedded-core | ||
16 | git clone https://git.openembedded.org/bitbake | ||
17 | git clone https://git.openembedded.org/meta-openembedded | ||
18 | git clone https://github.com/kraj/meta-clang.git | ||
19 | git clone https://git.yoctoproject.org/meta-intel | ||
20 | |||
21 | $ source openembedded-core/oe-init-build-env | ||
22 | |||
23 | $ bitbake-layers add-layer ../meta-openembedded/meta-oe/ | ||
24 | $ bitbake-layers add-layer ../meta-intel | ||
25 | $ bitbake-layers add-layer ../meta-clang | ||
26 | ``` | ||
27 | |||
28 | Distro | ||
29 | ====== | ||
30 | |||
31 | Note that oneAPI DPC++/C++ compiler currently only works when the vendor string is "oe". | ||
32 | |||
33 | ``` | ||
34 | DISTRO ?= "nodistro" | ||
35 | ``` | ||
36 | |||
37 | MACHINE configuration | ||
38 | ===================== | ||
39 | |||
40 | ``` | ||
41 | MACHINE ?= "intel-skylake-64" | ||
42 | ``` | ||
43 | |||
44 | Package installation | ||
45 | ==================== | ||
46 | |||
47 | ``` | ||
48 | # To include OpenCL driver that might be needed when compiling SYCL programs, include: | ||
49 | IMAGE_INSTALL:append = " intel-compute-runtime intel-graphics-compiler" | ||
50 | |||
51 | # To install only runtime libraries, include: | ||
52 | IMAGE_INSTALL:append = " intel-oneapi-dpcpp-cpp-runtime intel-oneapi-dpcpp-cpp-runtime-dev" | ||
53 | |||
54 | # To install the toolchain, include: | ||
55 | IMAGE_INSTALL:append = " intel-oneapi-dpcpp-cpp intel-oneapi-dpcpp-cpp-dev" | ||
56 | ``` | ||
57 | in local.conf. | ||
58 | |||
59 | Build an image | ||
60 | ============== | ||
61 | |||
62 | ``` | ||
63 | $ bitbake core-image-minimal | ||
64 | ``` | ||
65 | |||
66 | Including oneAPI C++/DPC++ compiler in generated SDK toolchain | ||
67 | ============================================================== | ||
68 | |||
69 | The compiler is not included in the generated SDK by default. If it is expected to be part of SDK, add ICXSDK = "1" in local.conf: | ||
70 | |||
71 | ``` | ||
72 | ICXSDK = "1" | ||
73 | ``` | ||
74 | |||
75 | Generate SDK: | ||
76 | ``` | ||
77 | bitbake core-image-minimal -c populate_sdk | ||
78 | ``` | ||
79 | |||
80 | |||
81 | To setup PATH variables on target | ||
82 | ================================= | ||
83 | |||
84 | Once image is booted successfully, some variables would need to be exported to make sure compiler can be used: | ||
85 | |||
86 | ``` | ||
87 | $ source /opt/intel/oneapi/compiler/2022.1.0/env/vars.sh | ||
88 | |||
89 | $ mkdir -p /lib64 | ||
90 | |||
91 | $ ln -sf /lib/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2 | ||
92 | ``` | ||
93 | |||
94 | Build application and run | ||
95 | ========================= | ||
96 | |||
97 | To compile a sycl application, for example: | ||
98 | |||
99 | ``` | ||
100 | $ icpx --target=x86_64-oe-linux -fsycl simple-sycl-app.c -o simple-sycl-app | ||
101 | ``` | ||
102 | |||
103 | To run: | ||
104 | |||
105 | ``` | ||
106 | $ ./simple-sycl-app | ||
107 | ``` | ||