diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-07-11 15:18:16 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-07-11 15:18:16 +0200 |
| commit | 4abb81c230bfcd599ccceb2b1bcbdcadbd859537 (patch) | |
| tree | 41dd1cf04d0ff34022fa7669c0b00cd2f051f7d9 | |
| parent | 275d8c66d2aa4793d986bcc7939cb4adcd64e018 (diff) | |
| download | nissy-core-4abb81c230bfcd599ccceb2b1bcbdcadbd859537.tar.gz nissy-core-4abb81c230bfcd599ccceb2b1bcbdcadbd859537.zip | |
Cleanup makefile and tools
Diffstat (limited to '')
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | TODO.txt | 1 | ||||
| -rwxr-xr-x | configure.sh | 5 | ||||
| -rwxr-xr-x | test/test.sh | 12 | ||||
| -rwxr-xr-x | tools/run_tool.sh | 14 | ||||
| -rw-r--r-- | tools/stats_tables_h48/stats_tables_h48.c | 2 |
6 files changed, 8 insertions, 32 deletions
| @@ -15,15 +15,15 @@ clean: | |||
| 15 | rm -rf *.o run | 15 | rm -rf *.o run |
| 16 | 16 | ||
| 17 | test: debugcube.o | 17 | test: debugcube.o |
| 18 | CUBETYPE=${CUBETYPE} TEST=${TEST} ./test/test.sh | 18 | CC="${CC} ${DBGFLAGS}" ./test/test.sh |
| 19 | 19 | ||
| 20 | tool: cube.o | 20 | tool: cube.o |
| 21 | mkdir -p tools/results | 21 | mkdir -p tools/results |
| 22 | CUBETYPE=${CUBETYPE} ./tools/run_tool.sh | 22 | CC="${CC} ${CFLAGS}" CUBEOBJ=cube.o ./tools/run_tool.sh |
| 23 | 23 | ||
| 24 | debugtool: debugcube.o | 24 | debugtool: debugcube.o |
| 25 | mkdir -p tools/results | 25 | mkdir -p tools/results |
| 26 | CUBETYPE=${CUBETYPE} DEBUG=1 ./tools/run_tool.sh | 26 | CC="${CC} ${DBGFLAGS}" CUBEOBJ=debugcube.o ./tools/run_tool.sh |
| 27 | 27 | ||
| 28 | shell: cube.o | 28 | shell: cube.o |
| 29 | mkdir -p tables | 29 | mkdir -p tables |
| @@ -99,7 +99,6 @@ switch. Here NISS may be useful. | |||
| 99 | * transform edges only for h48 coord calculation | 99 | * transform edges only for h48 coord calculation |
| 100 | * ptable: since it is fully symmetric, do only U or U2 at depth 1 | 100 | * ptable: since it is fully symmetric, do only U or U2 at depth 1 |
| 101 | * use threads: how to detect at runtime? what is sane number to default to? | 101 | * use threads: how to detect at runtime? what is sane number to default to? |
| 102 | pthreads or threads.h? | ||
| 103 | * multisolve with adaptive threading | 102 | * multisolve with adaptive threading |
| 104 | * Trans: don't do full compose, for some trans composing perm is enough. | 103 | * Trans: don't do full compose, for some trans composing perm is enough. |
| 105 | Split out sumco() as a separate function and refactor, optimize. | 104 | Split out sumco() as a separate function and refactor, optimize. |
diff --git a/configure.sh b/configure.sh index d5586db..76d02de 100755 --- a/configure.sh +++ b/configure.sh | |||
| @@ -21,9 +21,10 @@ WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function" | |||
| 21 | [ -n "$(detectsan address)" ] && ADDR="-fsanitize=address" | 21 | [ -n "$(detectsan address)" ] && ADDR="-fsanitize=address" |
| 22 | [ -n "$(detectsan undefined)" ] && UNDEF="-fsanitize=undefined" | 22 | [ -n "$(detectsan undefined)" ] && UNDEF="-fsanitize=undefined" |
| 23 | SAN="$ADDR $UNDEF" | 23 | SAN="$ADDR $UNDEF" |
| 24 | LIBS="-lpthread" | ||
| 24 | 25 | ||
| 25 | CFLAGS="$STD $WFLAGS $AVX -O3" | 26 | CFLAGS="$STD $LIBS $WFLAGS $AVX -O3" |
| 26 | DBGFLAGS="$STD $WFLAGS $SAN $AVX -g3 -DDEBUG" | 27 | DBGFLAGS="$STD $LIBS $WFLAGS $SAN $AVX -g3 -DDEBUG" |
| 27 | 28 | ||
| 28 | echo "Cube type: CUBE_$TYPE" | 29 | echo "Cube type: CUBE_$TYPE" |
| 29 | echo "Compiler: ${CC:-cc}" | 30 | echo "Compiler: ${CC:-cc}" |
diff --git a/test/test.sh b/test/test.sh index 8e50cf5..33613b1 100755 --- a/test/test.sh +++ b/test/test.sh | |||
| @@ -1,19 +1,7 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | detectsan() { | ||
| 4 | cc -fsanitize=$1 -dM -E -x c - </dev/null 2>/dev/null \ | ||
| 5 | | grep "SANITIZE" | ||
| 6 | } | ||
| 7 | |||
| 8 | re="${TEST:-$@}" | 3 | re="${TEST:-$@}" |
| 9 | 4 | ||
| 10 | CC="cc -DDEBUG -std=c99 -pedantic -Wall -Wextra \ | ||
| 11 | -Wno-unused-parameter -Wno-unused-function -g3 -D$CUBETYPE" | ||
| 12 | |||
| 13 | [ "$CUBETYPE" = "CUBE_AVX2" ] && CC="$CC -mavx2" | ||
| 14 | [ -n "$(detectsan address)" ] && CC="$CC -fsanitize=address" | ||
| 15 | [ -n "$(detectsan undefined)" ] && CC="$CC -fsanitize=undefined" | ||
| 16 | |||
| 17 | TESTBIN="test/run" | 5 | TESTBIN="test/run" |
| 18 | TESTOUT="test/last.out" | 6 | TESTOUT="test/last.out" |
| 19 | TESTERR="test/last.err" | 7 | TESTERR="test/last.err" |
diff --git a/tools/run_tool.sh b/tools/run_tool.sh index 14d0e45..495d68c 100755 --- a/tools/run_tool.sh +++ b/tools/run_tool.sh | |||
| @@ -5,19 +5,7 @@ if [ -z "$TOOL" ]; then | |||
| 5 | exit 1 | 5 | exit 1 |
| 6 | fi | 6 | fi |
| 7 | 7 | ||
| 8 | CC="cc -std=c99 -pedantic -Wall -Wextra \ | 8 | CC="$CC -D_POSIX_C_SOURCE=199309L" |
| 9 | -Wno-unused-parameter -Wno-unused-function -D$CUBETYPE \ | ||
| 10 | -D_POSIX_C_SOURCE=199309L" | ||
| 11 | |||
| 12 | if [ -n "$DEBUG" ]; then | ||
| 13 | CC="$CC -fsanitize=address -g3" | ||
| 14 | CUBEOBJ="debugcube.o" | ||
| 15 | else | ||
| 16 | CC="$CC -O3" | ||
| 17 | CUBEOBJ="cube.o" | ||
| 18 | fi | ||
| 19 | |||
| 20 | [ "$CUBETYPE" = "CUBE_AVX2" ] && CC="$CC -mavx2" | ||
| 21 | 9 | ||
| 22 | BIN="tools/run" | 10 | BIN="tools/run" |
| 23 | d="$(date +'%Y-%m-%d-%H-%M-%S')" | 11 | d="$(date +'%Y-%m-%d-%H-%M-%S')" |
diff --git a/tools/stats_tables_h48/stats_tables_h48.c b/tools/stats_tables_h48/stats_tables_h48.c index fc8c981..7c6bc3c 100644 --- a/tools/stats_tables_h48/stats_tables_h48.c +++ b/tools/stats_tables_h48/stats_tables_h48.c | |||
| @@ -127,7 +127,7 @@ int getdata(int64_t size) { | |||
| 127 | return 0; | 127 | return 0; |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | int main() { | 130 | int main(void) { |
| 131 | int64_t size; | 131 | int64_t size; |
| 132 | 132 | ||
| 133 | srand(time(NULL)); | 133 | srand(time(NULL)); |
