blob: e48b2b74ebcd547da65d7d34a82b58f46fd68b92 [file] [log] [blame]
Sheri Zhangd813bab2021-04-30 16:53:41 +01001///
Gunes Bayiree905002022-02-25 15:20:00 +00002/// Copyright (c) 2017-2022 Arm Limited.
Sheri Zhangd813bab2021-04-30 16:53:41 +01003///
4/// SPDX-License-Identifier: MIT
5///
6/// Permission is hereby granted, free of charge, to any person obtaining a copy
7/// of this software and associated documentation files (the "Software"), to
8/// deal in the Software without restriction, including without limitation the
9/// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10/// sell copies of the Software, and to permit persons to whom the Software is
11/// furnished to do so, subject to the following conditions:
12///
13/// The above copyright notice and this permission notice shall be included in all
14/// copies or substantial portions of the Software.
15///
16/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22/// SOFTWARE.
23///
24namespace arm_compute
25{
26/** @page how_to_build How to Build and Run Examples
27
28@tableofcontents
29
30@section S1_1_build_options Build options
31
32scons 2.3 or above is required to build the library.
Michalis Spyroua3f7cd22022-07-04 15:32:02 +010033To see the build options available simply run ```scons -h```
Freddie Liardetf289e572021-08-06 09:12:26 +010034
Sheri Zhangd813bab2021-04-30 16:53:41 +010035@section S1_2_linux Building for Linux
36
37@subsection S1_2_1_library How to build the library ?
38
39For Linux, the library was successfully built and tested using the following Linaro GCC toolchain:
40
41 - gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf
42 - gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu
43
44To cross-compile the library in debug mode, with Arm® Neon™ only support, for Linux 32bit:
45
46 scons Werror=1 -j8 debug=1 neon=1 opencl=0 os=linux arch=armv7a
47
48To cross-compile the library in asserts mode, with OpenCL only support, for Linux 64bit:
49
Gunes Bayiree905002022-02-25 15:20:00 +000050 scons Werror=1 -j8 debug=0 asserts=1 neon=0 opencl=1 embed_kernels=1 os=linux arch=armv8a
Sheri Zhangd813bab2021-04-30 16:53:41 +010051
52You can also compile the library natively on an Arm device by using <b>build=native</b>:
53
Gunes Bayiree905002022-02-25 15:20:00 +000054 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv8a build=native
Sheri Zhangd813bab2021-04-30 16:53:41 +010055 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv7a build=native
56
57@note g++ for Arm is mono-arch, therefore if you want to compile for Linux 32bit on a Linux 64bit platform you will have to use a cross compiler.
58
59For example on a 64bit Debian based system you would have to install <b>g++-arm-linux-gnueabihf</b>
60
61 apt-get install g++-arm-linux-gnueabihf
62
63Then run
64
65 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv7a build=cross_compile
66
67or simply remove the build parameter as build=cross_compile is the default value:
68
69 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv7a
70
71@subsection S1_2_2_examples How to manually build the examples ?
72
73The examples get automatically built by scons as part of the build process of the library described above. This section just describes how you can build and link your own application against our library.
74
75@note The following command lines assume the arm_compute libraries are present in the current directory or in the system library path. If this is not the case you can specify the location of the pre-built libraries with the compiler option -L. When building the OpenCL example the commands below assume that the CL headers are located in the include folder where the command is executed.
76
77To cross compile a Arm® Neon™ example for Linux 32bit:
78
Jakub Sujakee301b32021-06-04 09:46:08 +010079 arm-linux-gnueabihf-g++ examples/neon_cnn.cpp utils/Utils.cpp -I. -Iinclude -std=c++14 -mfpu=neon -L. -larm_compute -larm_compute_core -o neon_cnn
Sheri Zhangd813bab2021-04-30 16:53:41 +010080
81To cross compile a Arm® Neon™ example for Linux 64bit:
82
Jakub Sujakee301b32021-06-04 09:46:08 +010083 aarch64-linux-gnu-g++ examples/neon_cnn.cpp utils/Utils.cpp -I. -Iinclude -std=c++14 -L. -larm_compute -larm_compute_core -o neon_cnn
Sheri Zhangd813bab2021-04-30 16:53:41 +010084
85(notice the only difference with the 32 bit command is that we don't need the -mfpu option and the compiler's name is different)
86
87To cross compile an OpenCL example for Linux 32bit:
88
Jakub Sujakee301b32021-06-04 09:46:08 +010089 arm-linux-gnueabihf-g++ examples/cl_sgemm.cpp utils/Utils.cpp -I. -Iinclude -std=c++14 -mfpu=neon -L. -larm_compute -larm_compute_core -o cl_sgemm -DARM_COMPUTE_CL
Sheri Zhangd813bab2021-04-30 16:53:41 +010090
91To cross compile an OpenCL example for Linux 64bit:
92
Jakub Sujakee301b32021-06-04 09:46:08 +010093 aarch64-linux-gnu-g++ examples/cl_sgemm.cpp utils/Utils.cpp -I. -Iinclude -std=c++14 -L. -larm_compute -larm_compute_core -o cl_sgemm -DARM_COMPUTE_CL
Sheri Zhangd813bab2021-04-30 16:53:41 +010094
95(notice the only difference with the 32 bit command is that we don't need the -mfpu option and the compiler's name is different)
96
97To cross compile the examples with the Graph API, such as graph_lenet.cpp, you need to link the examples against arm_compute_graph.so too.
98
99i.e. to cross compile the "graph_lenet" example for Linux 32bit:
100
101 arm-linux-gnueabihf-g++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp utils/CommonGraphOptions.cpp -I. -Iinclude -std=c++14 -mfpu=neon -L. -larm_compute_graph -larm_compute -larm_compute_core -Wl,--allow-shlib-undefined -o graph_lenet
102
103i.e. to cross compile the "graph_lenet" example for Linux 64bit:
104
105 aarch64-linux-gnu-g++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp utils/CommonGraphOptions.cpp -I. -Iinclude -std=c++14 -L. -larm_compute_graph -larm_compute -larm_compute_core -Wl,--allow-shlib-undefined -o graph_lenet
106
107(notice the only difference with the 32 bit command is that we don't need the -mfpu option and the compiler's name is different)
108
109@note If compiling using static libraries, this order must be followed when linking: arm_compute_graph_static, arm_compute, arm_compute_core
110
111To compile natively (i.e directly on an Arm device) for Arm® Neon™ for Linux 32bit:
112
Jakub Sujakee301b32021-06-04 09:46:08 +0100113 g++ examples/neon_cnn.cpp utils/Utils.cpp -I. -Iinclude -std=c++14 -mfpu=neon -larm_compute -larm_compute_core -o neon_cnn
Sheri Zhangd813bab2021-04-30 16:53:41 +0100114
115To compile natively (i.e directly on an Arm device) for Arm® Neon™ for Linux 64bit:
116
Jakub Sujakee301b32021-06-04 09:46:08 +0100117 g++ examples/neon_cnn.cpp utils/Utils.cpp -I. -Iinclude -std=c++14 -larm_compute -larm_compute_core -o neon_cnn
Sheri Zhangd813bab2021-04-30 16:53:41 +0100118
119(notice the only difference with the 32 bit command is that we don't need the -mfpu option)
120
121To compile natively (i.e directly on an Arm device) for OpenCL for Linux 32bit or Linux 64bit:
122
Jakub Sujakee301b32021-06-04 09:46:08 +0100123 g++ examples/cl_sgemm.cpp utils/Utils.cpp -I. -Iinclude -std=c++14 -larm_compute -larm_compute_core -o cl_sgemm -DARM_COMPUTE_CL
Sheri Zhangd813bab2021-04-30 16:53:41 +0100124
125To compile natively the examples with the Graph API, such as graph_lenet.cpp, you need to link the examples against arm_compute_graph.so too.
126
127i.e. to natively compile the "graph_lenet" example for Linux 32bit:
128
129 g++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp utils/CommonGraphOptions.cpp -I. -Iinclude -std=c++14 -mfpu=neon -L. -larm_compute_graph -larm_compute -larm_compute_core -Wl,--allow-shlib-undefined -o graph_lenet
130
131i.e. to natively compile the "graph_lenet" example for Linux 64bit:
132
133 g++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp utils/CommonGraphOptions.cpp -I. -Iinclude -std=c++14 -L. -larm_compute_graph -larm_compute -larm_compute_core -Wl,--allow-shlib-undefined -o graph_lenet
134
135(notice the only difference with the 32 bit command is that we don't need the -mfpu option)
136
137@note If compiling using static libraries, this order must be followed when linking: arm_compute_graph_static, arm_compute, arm_compute_core
138
Gunes Bayiree905002022-02-25 15:20:00 +0000139@note These two commands assume libarm_compute.so is available in your library path, if not add the path to it using -L (e.g. -Llib/linux-armv8a-neon-cl-asserts/)
Sheri Zhangd813bab2021-04-30 16:53:41 +0100140@note You might need to export the path to OpenCL library as well in your LD_LIBRARY_PATH if Compute Library was built with OpenCL enabled.
141
142To run the built executable simply run:
143
Jakub Sujakee301b32021-06-04 09:46:08 +0100144 LD_LIBRARY_PATH=build ./neon_cnn
Sheri Zhangd813bab2021-04-30 16:53:41 +0100145
146or
147
Jakub Sujakee301b32021-06-04 09:46:08 +0100148 LD_LIBRARY_PATH=build ./cl_sgemm
Sheri Zhangd813bab2021-04-30 16:53:41 +0100149
150@note Examples accept different types of arguments, to find out what they are run the example with \a --help as an argument. If no arguments are specified then random values will be used to execute the graph.
151
152For example:
153
154 LD_LIBRARY_PATH=. ./graph_lenet --help
155
156Below is a list of the common parameters among the graph examples :
157@snippet utils/CommonGraphOptions.h Common graph examples parameters
158
159@subsection S1_2_3_sve Build for SVE or SVE2
160
161In order to build for SVE or SVE2 you need a compiler that supports them. You can find more information in the following these links:
162 -# GCC: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/sve-support
163 -# LLVM: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/llvm-toolchain/sve-support
164
165@note You the need to indicate the toolchains using the scons "toolchain_prefix" parameter.
166
167An example build command with SVE is:
168
Gunes Bayiree905002022-02-25 15:20:00 +0000169 scons arch=armv8.2-a-sve os=linux build_dir=arm64 -j55 standalone=0 opencl=0 openmp=0 validation_tests=1 neon=1 cppthreads=1 toolchain_prefix=aarch64-none-linux-gnu-
Sheri Zhangd813bab2021-04-30 16:53:41 +0100170
171@section S1_3_android Building for Android
172
173For Android, the library was successfully built and tested using Google's standalone toolchains:
Gunes Bayiree905002022-02-25 15:20:00 +0000174 - clang++ from NDK r20b for armv8a
175 - clang++ from NDK r20b for armv8.2-a with FP16 support
Sheri Zhangd813bab2021-04-30 16:53:41 +0100176
177For NDK r18 or older, here is a guide to <a href="https://developer.android.com/ndk/guides/standalone_toolchain.html">create your Android standalone toolchains from the NDK</a>:
178- Download the NDK r18b from here: https://developer.android.com/ndk/downloads/index.html to directory $NDK
179- Make sure you have Python 2.7 installed on your machine.
Jakub Sujakee301b32021-06-04 09:46:08 +0100180- Generate the 32 and/or 64 toolchains by running the following commands to your toolchain directory $MY_TOOLCHAINS:
Sheri Zhangd813bab2021-04-30 16:53:41 +0100181
182 $NDK/build/tools/make_standalone_toolchain.py --arch arm64 --install-dir $MY_TOOLCHAINS/aarch64-linux-android-ndk-r18b --stl libc++ --api 21
SiCong Li56c3ca82022-05-19 18:43:33 +0100183
Sheri Zhangd813bab2021-04-30 16:53:41 +0100184 $NDK/build/tools/make_standalone_toolchain.py --arch arm --install-dir $MY_TOOLCHAINS/arm-linux-android-ndk-r18b --stl libc++ --api 21
185
186For NDK r19 or newer, you can directly <a href="https://developer.android.com/ndk/downloads">Download</a> the NDK package for your development platform, without the need to launch the make_standalone_toolchain.py script. You can find all the prebuilt binaries inside $NDK/toolchains/llvm/prebuilt/$OS_ARCH/bin/.
SiCong Life1b1f62022-05-19 18:58:31 +0100187@parblock
188@attention The building script will look for a binary named "aarch64-linux-android-clang++", while the prebuilt binaries will have their API version as a suffix to their filename (e.g. "aarch64-linux-android21-clang++"). You can instruct scons to use the correct version by using a combination of the toolchain_prefix and the "CC" "CXX" environment variables.
189@attention For this particular example, you can specify:
Sheri Zhangd813bab2021-04-30 16:53:41 +0100190
SiCong Life1b1f62022-05-19 18:58:31 +0100191 CC=clang CXX=clang++ scons toolchain_prefix=aarch64-linux-android21-
192
193@attention or:
194
195 CC=aarch64-linux-android21-clang CXX=aarch64-linux-android21-clang++ scons toolchain_prefix=""
196
197@endparblock
198
199@parblock
Sheri Zhangd813bab2021-04-30 16:53:41 +0100200@attention We used to use gnustl but as of NDK r17 it is deprecated so we switched to libc++
SiCong Life1b1f62022-05-19 18:58:31 +0100201@endparblock
Sheri Zhangd813bab2021-04-30 16:53:41 +0100202
203@note Make sure to add the toolchains to your PATH:
204
205 export PATH=$PATH:$MY_TOOLCHAINS/aarch64-linux-android-ndk-r18b/bin:$MY_TOOLCHAINS/arm-linux-android-ndk-r18b/bin
206
207@subsection S1_3_1_library How to build the library ?
208
209To cross-compile the library in debug mode, with Arm® Neon™ only support, for Android 32bit:
210
211 CXX=clang++ CC=clang scons Werror=1 -j8 debug=1 neon=1 opencl=0 os=android arch=armv7a
212
213To cross-compile the library in asserts mode, with OpenCL only support, for Android 64bit:
214
Gunes Bayiree905002022-02-25 15:20:00 +0000215 CXX=clang++ CC=clang scons Werror=1 -j8 debug=0 asserts=1 neon=0 opencl=1 embed_kernels=1 os=android arch=armv8a
Sheri Zhangd813bab2021-04-30 16:53:41 +0100216
217@subsection S1_3_2_examples How to manually build the examples ?
218
219The examples get automatically built by scons as part of the build process of the library described above. This section just describes how you can build and link your own application against our library.
220
221@note The following command lines assume the arm_compute libraries are present in the current directory or in the system library path. If this is not the case you can specify the location of the pre-built libraries with the compiler option -L. When building the OpenCL example the commands below assume that the CL headers are located in the include folder where the command is executed.
222
223Once you've got your Android standalone toolchain built and added to your path you can do the following:
224
225To cross compile a Arm® Neon™ example:
226
227 #32 bit:
Jakub Sujakee301b32021-06-04 09:46:08 +0100228 arm-linux-androideabi-clang++ examples/neon_cnn.cpp utils/Utils.cpp -I. -Iinclude -std=c++14 -larm_compute-static -larm_compute_core-static -L. -o neon_cnn_arm -static-libstdc++ -pie
Sheri Zhangd813bab2021-04-30 16:53:41 +0100229 #64 bit:
Jakub Sujakee301b32021-06-04 09:46:08 +0100230 aarch64-linux-android-clang++ examples/neon_cnn.cpp utils/Utils.cpp -I. -Iinclude -std=c++14 -larm_compute-static -larm_compute_core-static -L. -o neon_cnn_aarch64 -static-libstdc++ -pie
Sheri Zhangd813bab2021-04-30 16:53:41 +0100231
232To cross compile an OpenCL example:
233
234 #32 bit:
Jakub Sujakee301b32021-06-04 09:46:08 +0100235 arm-linux-androideabi-clang++ examples/cl_sgemm.cpp utils/Utils.cpp -I. -Iinclude -std=c++14 -larm_compute-static -larm_compute_core-static -L. -o cl_sgemm_arm -static-libstdc++ -pie -DARM_COMPUTE_CL
Sheri Zhangd813bab2021-04-30 16:53:41 +0100236 #64 bit:
Jakub Sujakee301b32021-06-04 09:46:08 +0100237 aarch64-linux-android-clang++ examples/cl_sgemm.cpp utils/Utils.cpp -I. -Iinclude -std=c++14 -larm_compute-static -larm_compute_core-static -L. -o cl_sgemm_aarch64 -static-libstdc++ -pie -DARM_COMPUTE_CL
Sheri Zhangd813bab2021-04-30 16:53:41 +0100238
239To cross compile the examples with the Graph API, such as graph_lenet.cpp, you need to link the library arm_compute_graph also.
240
241 #32 bit:
242 arm-linux-androideabi-clang++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp utils/CommonGraphOptions.cpp -I. -Iinclude -std=c++14 -Wl,--whole-archive -larm_compute_graph-static -Wl,--no-whole-archive -larm_compute-static -larm_compute_core-static -L. -o graph_lenet_arm -static-libstdc++ -pie -DARM_COMPUTE_CL
243 #64 bit:
244 aarch64-linux-android-clang++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp utils/CommonGraphOptions.cpp -I. -Iinclude -std=c++14 -Wl,--whole-archive -larm_compute_graph-static -Wl,--no-whole-archive -larm_compute-static -larm_compute_core-static -L. -o graph_lenet_aarch64 -static-libstdc++ -pie -DARM_COMPUTE_CL
245
246@note Due to some issues in older versions of the Arm® Mali™ OpenCL DDK (<= r13p0), we recommend to link arm_compute statically on Android.
247@note When linked statically the arm_compute_graph library currently needs the --whole-archive linker flag in order to work properly
248
249Then you need to do is upload the executable and the shared library to the device using ADB:
250
Jakub Sujakee301b32021-06-04 09:46:08 +0100251 adb push neon_cnn_arm /data/local/tmp/
252 adb push cl_sgemm_arm /data/local/tmp/
Sheri Zhangd813bab2021-04-30 16:53:41 +0100253 adb push gc_absdiff_arm /data/local/tmp/
254 adb shell chmod 777 -R /data/local/tmp/
255
256And finally to run the example:
257
Jakub Sujakee301b32021-06-04 09:46:08 +0100258 adb shell /data/local/tmp/neon_cnn_arm
259 adb shell /data/local/tmp/cl_sgemm_arm
Sheri Zhangd813bab2021-04-30 16:53:41 +0100260 adb shell /data/local/tmp/gc_absdiff_arm
261
262For 64bit:
263
Jakub Sujakee301b32021-06-04 09:46:08 +0100264 adb push neon_cnn_aarch64 /data/local/tmp/
265 adb push cl_sgemm_aarch64 /data/local/tmp/
Sheri Zhangd813bab2021-04-30 16:53:41 +0100266 adb push gc_absdiff_aarch64 /data/local/tmp/
267 adb shell chmod 777 -R /data/local/tmp/
268
269And finally to run the example:
270
Jakub Sujakee301b32021-06-04 09:46:08 +0100271 adb shell /data/local/tmp/neon_cnn_aarch64
272 adb shell /data/local/tmp/cl_sgemm_aarch64
Sheri Zhangd813bab2021-04-30 16:53:41 +0100273 adb shell /data/local/tmp/gc_absdiff_aarch64
274
275@note Examples accept different types of arguments, to find out what they are run the example with \a --help as an argument. If no arguments are specified then random values will be used to execute the graph.
276
277For example:
278 adb shell /data/local/tmp/graph_lenet --help
279
Jakub Sujakee301b32021-06-04 09:46:08 +0100280In this case the first argument of LeNet (like all the graph examples) is the target (i.e 0 to run on Neon™, 1 to run on OpenCL if available, 2 to run on OpenCL using the CLTuner), the second argument is the path to the folder containing the npy files for the weights and finally the third argument is the number of batches to run.
Sheri Zhangd813bab2021-04-30 16:53:41 +0100281
282@section S1_4_macos Building for macOS
283
284The library was successfully natively built for Apple Silicon under macOS 11.1 using clang v12.0.0.
285
286To natively compile the library with accelerated CPU support:
287
Gunes Bayiree905002022-02-25 15:20:00 +0000288 scons Werror=1 -j8 neon=1 opencl=0 os=macos arch=armv8a build=native
Sheri Zhangd813bab2021-04-30 16:53:41 +0100289
290@note Initial support disables feature discovery through HWCAPS and thread scheduling affinity controls
291
292@section S1_5_bare_metal Building for bare metal
293
294For bare metal, the library was successfully built using linaro's latest (gcc-linaro-6.3.1-2017.05) bare metal toolchains:
295 - arm-eabi for armv7a
Gunes Bayiree905002022-02-25 15:20:00 +0000296 - aarch64-elf for armv8a
Sheri Zhangd813bab2021-04-30 16:53:41 +0100297
Gunes Bayiree905002022-02-25 15:20:00 +0000298Download linaro for <a href="https://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/arm-eabi/">armv7a</a> and <a href="https://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/aarch64-elf/">armv8a</a>.
Sheri Zhangd813bab2021-04-30 16:53:41 +0100299
300@note Make sure to add the toolchains to your PATH: export PATH=$PATH:$MY_TOOLCHAINS/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-elf/bin:$MY_TOOLCHAINS/gcc-linaro-6.3.1-2017.05-x86_64_arm-eabi/bin
301
302@subsection S1_5_1_library How to build the library ?
303
Gunes Bayiree905002022-02-25 15:20:00 +0000304To cross-compile the library with Arm® Neon™ support for baremetal armv8a:
Sheri Zhangd813bab2021-04-30 16:53:41 +0100305
Gunes Bayiree905002022-02-25 15:20:00 +0000306 scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=bare_metal arch=armv8a build=cross_compile cppthreads=0 openmp=0 standalone=1
Sheri Zhangd813bab2021-04-30 16:53:41 +0100307
308@subsection S1_5_2_examples How to manually build the examples ?
309
310Examples are disabled when building for bare metal. If you want to build the examples you need to provide a custom bootcode depending on the target architecture and link against the compute library. More information about bare metal bootcode can be found <a href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0527a/index.html">here</a>.
311
312@section S1_6_windows_host Building on a Windows host system
313
314Using `scons` directly from the Windows command line is known to cause
315problems. The reason seems to be that if `scons` is setup for cross-compilation
316it gets confused about Windows style paths (using backslashes). Thus it is
317recommended to follow one of the options outlined below.
318
319@subsection S1_6_1_ubuntu_on_windows Bash on Ubuntu on Windows
320
321The best and easiest option is to use
322<a href="https://msdn.microsoft.com/en-gb/commandline/wsl/about">Ubuntu on Windows</a>.
323This feature is still marked as *beta* and thus might not be available.
324However, if it is building the library is as simple as opening a *Bash on
325Ubuntu on Windows* shell and following the general guidelines given above.
326
327@subsection S1_6_2_cygwin Cygwin
328
329If the Windows subsystem for Linux is not available <a href="https://www.cygwin.com/">Cygwin</a>
330can be used to install and run `scons`, the minimum Cygwin version must be 3.0.7 or later. In addition
331to the default packages installed by Cygwin `scons` has to be selected in the installer. (`git` might
332also be useful but is not strictly required if you already have got the source
333code of the library.) Linaro provides pre-built versions of
334<a href="http://releases.linaro.org/components/toolchain/binaries/">GCC cross-compilers</a>
335that can be used from the Cygwin terminal. When building for Android the
336compiler is included in the Android standalone toolchain. After everything has
337been set up in the Cygwin terminal the general guide on building the library
338can be followed.
339
340@section S1_7_cl_requirements OpenCL DDK Requirements
341
342@subsection S1_7_1_cl_hard_requirements Hard Requirements
343
344Compute Library requires OpenCL 1.1 and above with support of non uniform workgroup sizes, which is officially supported in the Arm® Mali™ OpenCL DDK r8p0 and above as an extension (respective extension flag is \a -cl-arm-non-uniform-work-group-size).
345
346Enabling 16-bit floating point calculations require \a cl_khr_fp16 extension to be supported. All Arm® Mali™ GPUs with compute capabilities have native support for half precision floating points.
347
348@subsection S1_7_2_cl_performance_requirements Performance improvements
349
350Integer dot product built-in function extensions (and therefore optimized kernels) are available with Arm® Mali™ OpenCL DDK r22p0 and above for the following GPUs : G71, G76. The relevant extensions are \a cl_arm_integer_dot_product_int8, \a cl_arm_integer_dot_product_accumulate_int8 and \a cl_arm_integer_dot_product_accumulate_int16.
351
352OpenCL kernel level debugging can be simplified with the use of printf, this requires the \a cl_arm_printf extension to be supported.
353
354SVM allocations are supported for all the underlying allocations in Compute Library. To enable this OpenCL 2.0 and above is a requirement.
355
356*/
357} // namespace arm_compute