diff options
Diffstat (limited to '')
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | README.md | 21 | ||||
| -rwxr-xr-x | configure.sh | 12 |
3 files changed, 26 insertions, 9 deletions
| @@ -5,7 +5,7 @@ all: cube.o debugcube.o | |||
| 5 | cube.o: clean | 5 | cube.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 | ||
| 8 | debugcube.o: | 8 | debugcube.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 | ||
| 11 | clean: | 11 | clean: |
| @@ -4,13 +4,30 @@ Work in progress. There is some documentation at the bottom of this page, | |||
| 4 | but do not believe it. Everything is in a state of flux and can change | 4 | but do not believe it. Everything is in a state of flux and can change |
| 5 | without notice. | 5 | without notice. |
| 6 | 6 | ||
| 7 | ## Running tests | 7 | ## Building and running tests |
| 8 | |||
| 9 | First run | ||
| 10 | |||
| 11 | ``` | ||
| 12 | $ ./configure.sh | ||
| 13 | ``` | ||
| 14 | |||
| 15 | or `TYPE=AVX2 ./configure.sh` if you want to use AVX2 instructions. | ||
| 16 | |||
| 17 | Then | ||
| 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 | ||
| 23 | to run the tests. You can also run | ||
| 24 | |||
| 25 | ``` | ||
| 26 | $ make benchmark | ||
| 27 | ``` | ||
| 28 | |||
| 29 | for 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 | ||
| 3 | CFLAGS="-std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -O3" | 3 | STD="-std=c99" |
| 4 | DBGFLAGS="-DDEBUG -std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -g3 -fsanitize=address -fsanitize=undefined" | 4 | WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter" |
| 5 | [ "$TYPE" = "AVX2" ] && AVX="-mavx2" | ||
| 6 | [ "$(uname)" = "Linux" ] && SAN="-fsanitize=address -fsanitize=undefined" | ||
| 5 | 7 | ||
| 6 | if [ "$TYPE" = "AVX2" ]; then | 8 | CFLAGS="$STD $WFLAGS $AVX -O3" |
| 7 | CFLAGS="$CFLAGS -mavx2" | 9 | DBGFLAGS="$STD $WFLAGS $AVX -g3 -DDEBUG" |
| 8 | DBGFLAGS="$DBGFLAGS -mavx2" | ||
| 9 | fi | ||
| 10 | 10 | ||
| 11 | { | 11 | { |
| 12 | echo "CUBETYPE = CUBE_$TYPE"; | 12 | echo "CUBETYPE = CUBE_$TYPE"; |
