aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-07-11 15:18:16 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-07-11 15:18:16 +0200
commit4abb81c230bfcd599ccceb2b1bcbdcadbd859537 (patch)
tree41dd1cf04d0ff34022fa7669c0b00cd2f051f7d9
parent275d8c66d2aa4793d986bcc7939cb4adcd64e018 (diff)
downloadnissy-core-4abb81c230bfcd599ccceb2b1bcbdcadbd859537.tar.gz
nissy-core-4abb81c230bfcd599ccceb2b1bcbdcadbd859537.zip
Cleanup makefile and tools
Diffstat (limited to '')
-rw-r--r--Makefile6
-rw-r--r--TODO.txt1
-rwxr-xr-xconfigure.sh5
-rwxr-xr-xtest/test.sh12
-rwxr-xr-xtools/run_tool.sh14
-rw-r--r--tools/stats_tables_h48/stats_tables_h48.c2
6 files changed, 8 insertions, 32 deletions
diff --git a/Makefile b/Makefile
index cdf5bcd..8ff5f47 100644
--- a/Makefile
+++ b/Makefile
@@ -15,15 +15,15 @@ clean:
15 rm -rf *.o run 15 rm -rf *.o run
16 16
17test: debugcube.o 17test: debugcube.o
18 CUBETYPE=${CUBETYPE} TEST=${TEST} ./test/test.sh 18 CC="${CC} ${DBGFLAGS}" ./test/test.sh
19 19
20tool: cube.o 20tool: 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
24debugtool: debugcube.o 24debugtool: 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
28shell: cube.o 28shell: cube.o
29 mkdir -p tables 29 mkdir -p tables
diff --git a/TODO.txt b/TODO.txt
index ac989c8..d6f79a8 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -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"
23SAN="$ADDR $UNDEF" 23SAN="$ADDR $UNDEF"
24LIBS="-lpthread"
24 25
25CFLAGS="$STD $WFLAGS $AVX -O3" 26CFLAGS="$STD $LIBS $WFLAGS $AVX -O3"
26DBGFLAGS="$STD $WFLAGS $SAN $AVX -g3 -DDEBUG" 27DBGFLAGS="$STD $LIBS $WFLAGS $SAN $AVX -g3 -DDEBUG"
27 28
28echo "Cube type: CUBE_$TYPE" 29echo "Cube type: CUBE_$TYPE"
29echo "Compiler: ${CC:-cc}" 30echo "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
3detectsan() {
4 cc -fsanitize=$1 -dM -E -x c - </dev/null 2>/dev/null \
5 | grep "SANITIZE"
6}
7
8re="${TEST:-$@}" 3re="${TEST:-$@}"
9 4
10CC="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
17TESTBIN="test/run" 5TESTBIN="test/run"
18TESTOUT="test/last.out" 6TESTOUT="test/last.out"
19TESTERR="test/last.err" 7TESTERR="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
6fi 6fi
7 7
8CC="cc -std=c99 -pedantic -Wall -Wextra \ 8CC="$CC -D_POSIX_C_SOURCE=199309L"
9 -Wno-unused-parameter -Wno-unused-function -D$CUBETYPE \
10 -D_POSIX_C_SOURCE=199309L"
11
12if [ -n "$DEBUG" ]; then
13 CC="$CC -fsanitize=address -g3"
14 CUBEOBJ="debugcube.o"
15else
16 CC="$CC -O3"
17 CUBEOBJ="cube.o"
18fi
19
20[ "$CUBETYPE" = "CUBE_AVX2" ] && CC="$CC -mavx2"
21 9
22BIN="tools/run" 10BIN="tools/run"
23d="$(date +'%Y-%m-%d-%H-%M-%S')" 11d="$(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
130int main() { 130int main(void) {
131 int64_t size; 131 int64_t size;
132 132
133 srand(time(NULL)); 133 srand(time(NULL));

Generated with cgit - Back to sebastiano.tronto.net