aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--README.md21
-rwxr-xr-xconfigure.sh12
3 files changed, 26 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 082b740..304433f 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ all: cube.o debugcube.o
5cube.o: clean 5cube.o: clean
6 ${CC} -D${CUBETYPE} ${CFLAGS} -c -o cube.o src/cube.c 6 ${CC} -D${CUBETYPE} ${CFLAGS} -c -o cube.o src/cube.c
7 7
8debugcube.o: 8debugcube.o: clean
9 ${CC} -D${CUBETYPE} ${DBGFLAGS} -c -o debugcube.o src/cube.c 9 ${CC} -D${CUBETYPE} ${DBGFLAGS} -c -o debugcube.o src/cube.c
10 10
11clean: 11clean:
diff --git a/README.md b/README.md
index b95977e..616c066 100644
--- a/README.md
+++ b/README.md
@@ -4,13 +4,30 @@ Work in progress. There is some documentation at the bottom of this page,
4but do not believe it. Everything is in a state of flux and can change 4but do not believe it. Everything is in a state of flux and can change
5without notice. 5without notice.
6 6
7## Running tests 7## Building and running tests
8
9First run
10
11```
12$ ./configure.sh
13```
14
15or `TYPE=AVX2 ./configure.sh` if you want to use AVX2 instructions.
16
17Then
8 18
9``` 19```
10$ ./configure.sh # Run 'TYPE=AVX2 ./configure.sh' to use AVX2 instead
11$ make test 20$ make test
12``` 21```
13 22
23to run the tests. You can also run
24
25```
26$ make benchmark
27```
28
29for benchmarks.
30
14## TODO: 31## TODO:
15 32
16### Cleanup / refactor 33### Cleanup / refactor
diff --git a/configure.sh b/configure.sh
index 17673fc..74df81e 100755
--- a/configure.sh
+++ b/configure.sh
@@ -1,12 +1,12 @@
1#!/bin/sh 1#!/bin/sh
2 2
3CFLAGS="-std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -O3" 3STD="-std=c99"
4DBGFLAGS="-DDEBUG -std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -g3 -fsanitize=address -fsanitize=undefined" 4WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter"
5[ "$TYPE" = "AVX2" ] && AVX="-mavx2"
6[ "$(uname)" = "Linux" ] && SAN="-fsanitize=address -fsanitize=undefined"
5 7
6if [ "$TYPE" = "AVX2" ]; then 8CFLAGS="$STD $WFLAGS $AVX -O3"
7 CFLAGS="$CFLAGS -mavx2" 9DBGFLAGS="$STD $WFLAGS $AVX -g3 -DDEBUG"
8 DBGFLAGS="$DBGFLAGS -mavx2"
9fi
10 10
11{ 11{
12echo "CUBETYPE = CUBE_$TYPE"; 12echo "CUBETYPE = CUBE_$TYPE";

Generated with cgit - Back to sebastiano.tronto.net