README.md
1# Standalone zscilib example (non-Zephyr)
2
3This sample shows how zscilib can be used in a stand-alone (non Zephyr-based)
4projects using a standard makefile (`Makefile`).
5
6`gcc` is used by default as the target compiler, but the exact compiler version
7can be easily changed in the Makefile.
8
9## Functionality
10
11- Adds two vector together.
12
13## Enabling Optimised Functions
14
15You can enable the optimised ARM THUMB-2 (etc.) assembly versions of certain
16vector functions by setting the following config flag in the `Makefile`:
17
18```
19# Optionally enable ARM THUMB-2 ASM optimised functions
20CFLAGS += -DCONFIG_ZSL_PLATFORM_OPT=2
21```
22
23This will cause the ASM functions in `include/zsl/asm/arm/asm_arm_vectors.h`
24to be used in place of the standard C function code.
25
26## Using this Example
27
28To build this example, simply run the following command(s):
29
30```bash
31make clean
32make
33```
34
35Which should produce the following output:
36
37```bash
38Compiling obj/main.o
39Compiling obj/matrices.o
40Compiling obj/vectors.o
41Compiling obj/zsl.o
42gcc obj/main.o obj/matrices.o obj/vectors.o obj/zsl.o -o bin/zscilib -Wall -Wconversion -Wno-sign-conversion -I. -I../../../include -lm
43```
44
45You can then run the resulting binary as follows:
46
47```bash
48bin/zscilib
49```
50
51Which should give you the following partial results:
52```
53Hello, zscilib!
54-1.000000 1.500000 2.100000
55```
56