h48

A prototype for an optimal Rubik's cube solver, work in progress.
git clone https://git.tronto.net/h48
Download | Log | Files | Refs | README | LICENSE

commit 9c1659d91a331735f88c127aa236a59153e23dfc
parent fc8bdd6c8ad23868dc3722104eb710f01da03ef9
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date:   Sat,  4 Nov 2023 22:07:15 +0100

Reverted some Makefile changes, cleanup

Diffstat:
MMakefile | 2+-
MREADME.md | 21+++++++++++++++++++--
Mconfigure.sh | 12++++++------
3 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile @@ -5,7 +5,7 @@ all: cube.o debugcube.o cube.o: clean ${CC} -D${CUBETYPE} ${CFLAGS} -c -o cube.o src/cube.c -debugcube.o: +debugcube.o: clean ${CC} -D${CUBETYPE} ${DBGFLAGS} -c -o debugcube.o src/cube.c clean: diff --git a/README.md b/README.md @@ -4,13 +4,30 @@ Work in progress. There is some documentation at the bottom of this page, but do not believe it. Everything is in a state of flux and can change without notice. -## Running tests +## Building and running tests + +First run + +``` +$ ./configure.sh +``` + +or `TYPE=AVX2 ./configure.sh` if you want to use AVX2 instructions. + +Then ``` -$ ./configure.sh # Run 'TYPE=AVX2 ./configure.sh' to use AVX2 instead $ make test ``` +to run the tests. You can also run + +``` +$ make benchmark +``` + +for benchmarks. + ## TODO: ### Cleanup / refactor diff --git a/configure.sh b/configure.sh @@ -1,12 +1,12 @@ #!/bin/sh -CFLAGS="-std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -O3" -DBGFLAGS="-DDEBUG -std=c99 -pthread -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -g3 -fsanitize=address -fsanitize=undefined" +STD="-std=c99" +WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter" +[ "$TYPE" = "AVX2" ] && AVX="-mavx2" +[ "$(uname)" = "Linux" ] && SAN="-fsanitize=address -fsanitize=undefined" -if [ "$TYPE" = "AVX2" ]; then - CFLAGS="$CFLAGS -mavx2" - DBGFLAGS="$DBGFLAGS -mavx2" -fi +CFLAGS="$STD $WFLAGS $AVX -O3" +DBGFLAGS="$STD $WFLAGS $AVX -g3 -DDEBUG" { echo "CUBETYPE = CUBE_$TYPE";