From 3fc51ee0c8135d95ec422dadd6562bf97261a757 Mon Sep 17 00:00:00 2001 From: jvech Date: Thu, 19 Sep 2024 16:22:19 -0500 Subject: fix: wrong memory allocation on csv_read() fixed --- Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b829f3d..b8efec3 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,10 @@ include config.mk # you can `export DEV_MODE=true` to compile the binaries with more warnings and debugging support ifdef DEV_MODE CFLAGS = -std=gnu11 -Wall -Wextra -g +LDFLAGS = #-fsanitize=address else CFLAGS = -std=gnu11 -Wall -O2 +LDFLAGS = endif CC = clang @@ -27,7 +29,7 @@ $(OBJDIR)/%.o: src/%.c $(HEADERS) ${CC} -c -o $@ $< ${CFLAGS} build: $(OBJS) - ${CC} ${DLIBS} -o ${BIN} ${OBJS} + ${CC} ${DLIBS} -o ${BIN} ${OBJS} ${LDFLAGS} install: all @# binary @@ -58,15 +60,15 @@ test_%: src/%.c $(OBJDIR) $(shell sed -n 's/.*compile: clang/clang/;/clang/p' $<) debug: build - gdb -x utils/commands.gdb --tui --args ${BIN} train data/xor.json -e 100 + gdb --tui --args ./${BIN} train -c utils/settings.cfg data/xor.csv @#gdb -x utils/commands.gdb --tui --args ${BIN} predict data/sample_data.json check_leaks: build - valgrind --leak-check=yes \ - --log-file=leaks.log \ + setarch x86_64 -R valgrind --log-file=leaks.log \ --leak-check=full \ --show-leak-kinds=all \ - ./${BIN} train -c utils/settings.cfg data/xor.json + --track-origins=yes \ + ./${BIN} train -c utils/settings.cfg data/xor.csv clean: @rm $(OBJDIR) -rv -- cgit v1.2.3-70-g09d2