makefile (1236B)
1 MAKEFLAGS += --no-print-directory 2 3 ## Formatter 4 STYLE_BLUEPRINT=webkit 5 FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT) 6 7 ## Time to botec 8 TTB=./examples/more/12_time_to_botec_parallel/example 9 10 build-examples: 11 cd examples/core && make all 12 cd examples/more && make all 13 14 format-examples: 15 cd examples/core && make format-all 16 cd examples/more && make format-all 17 18 format: squiggle.c squiggle.h 19 $(FORMATTER) squiggle.c squiggle.h 20 $(FORMATTER) squiggle_more.c squiggle_more.h 21 22 lint: 23 clang-tidy squiggle.c -- -lm 24 clang-tidy squiggle_more.c -- -lm 25 26 profile: 27 sudo perf record -g ./examples/more/12_time_to_botec_parallel/example 28 sudo perf report 29 rm perf.data 30 sudo perf stat ./examples/more/12_time_to_botec_parallel/example 31 32 time-linux: 33 gcc -O3 -Wall -Wextra -Wdouble-promotion -Wconversion examples/more/12_time_to_botec_parallel/example.c squiggle.c squiggle_more.c -lm -fopenmp -o examples/more/12_time_to_botec_parallel/example 34 @echo "Running 100x and taking avg time: $(TTB)" 35 @t=$$(/usr/bin/time -f "%e" -p bash -c 'for i in {1..100}; do OMP_PROC_BIND=TRUE $(TTB); done' 2>&1 >/dev/null | grep real | awk '{print $$2}' ); echo "scale=2; 1000 * $$t / 100" | bc | sed "s|^|Time using 16 threads: |" | sed 's|$$|ms|' && echo