i5-roofline/Makefile

121 lines
4.3 KiB
Makefile
Raw Permalink Normal View History

2020-09-03 16:49:50 +00:00
all: clean bin lib
# Roofline Binary
## This is the least demanding target, use it if nothing else works
nofancy: roofline roofline_o3
mkdir bin
mv $^ bin
## Your processor needs an FMA unit for this target to work
fmacap: roofline roofline_o3 roofline_fma roofline_fma_o3 roofline_fma_fast_o3 roofline_fma_fast_o2 roofline_fma_fast_fastmath_o3
mkdir bin
mv $^ bin
## This will compile just everything
bin: roofline roofline_o3 roofline_fma roofline_fma_o3 roofline_fma_fast_o3 roofline_fma_fast_o2 roofline_fma_fast_fastmath_o3 roofline_full roofline_profile roofline_full_clang roofline_full_manpack
mkdir bin
mv $^ bin
roofline: roofline.c aikern.a
gcc -Wall -Wextra -std=c99 -fopenmp $^ -o $@
roofline_o3: roofline.c aikern_o3.a
gcc -Wall -Wextra -std=c99 -fopenmp $^ -o $@
roofline_fma: roofline.c aikern_fma.a
gcc -Wall -Wextra -std=c99 -fopenmp $^ -o $@
roofline_fma_o3: roofline.c aikern_fma_o3.a
gcc -Wall -Wextra -std=c99 -fopenmp $^ -o $@
roofline_fma_fast_o3: roofline.c aikern_fma_fast_o3.a
gcc -Wall -Wextra -std=c99 -fopenmp $^ -o $@
roofline_fma_fast_o2: roofline.c aikern_fma_fast_o2.a
gcc -Wall -Wextra -std=c99 -fopenmp $^ -o $@
roofline_fma_fast_fastmath_o3: roofline.c aikern_fma_fast_fastmath_o3.a
gcc -Wall -Wextra -std=c99 -fopenmp $^ -o $@
roofline_full: roofline.c aikern_full.a
gcc -Wall -Wextra -std=c99 -fopenmp -O3 -mavx -mfma -fopenmp -Ofast -ffast-math -malign-double -march=native $^ -o $@
roofline_full_clang: roofline.c aikern_full_clang.a
clang -Wall -Wextra -std=c99 -fopenmp -O3 -mavx -mfma -fopenmp -Ofast -ffast-math -march=native $^ -o $@
roofline_full_manpack: roofline.c aikern_full_manpack.a
gcc -Wall -Wextra -std=c99 -fopenmp -DINTRINS -O3 -mavx -mfma -fopenmp -Ofast -ffast-math -malign-double -march=native $^ -o $@
roofline_profile: roofline.c aikern_profile.a
gcc -Wall -Wextra -std=c99 -fopenmp -O0 -g -pg $^ -o $@
# Static Libraries
lib: aikern.a aikern_o3.a aikern_fma.a aikern_fma_o3.a aikern_fma_fast_o2.a aikern_fma_fast_o3.a aikern_fma_fast_fastmath_o3.a aikern_full.a aikern_full_clang.a aikern_profile.a aikern_full_manpack.a
mkdir lib
mv $^ lib
aikern.a: aikern.c aikern.h
gcc -Wall -Wextra -Wno-unused -fopenmp -c -o aikern.o $<
ar rcs aikern.a aikern.o
rm aikern.o
aikern_o3.a: aikern.c aikern.h
gcc -Wall -Wextra -Wno-unused -O3 -fopenmp -c -o aikern_o3.o $<
ar rcs $@ aikern_o3.o
rm aikern_o3.o
aikern_fma.a: aikern.c aikern.h
gcc -Wall -Wextra -Wno-unused -O2 -mavx -mfma -fopenmp -c -o aikern_fma.o $<
ar rcs $@ aikern_fma.o
rm aikern_fma.o
aikern_fma_o3.a: aikern.c aikern.h
gcc -Wall -Wextra -Wno-unused -O3 -mavx -mfma -fopenmp -c -o aikern_fma_o3.o $<
ar rcs $@ aikern_fma_o3.o
rm aikern_fma_o3.o
aikern_fma_fast_o2.a: aikern.c aikern.h
gcc -Wall -Wextra -Wno-unused -O2 -mavx -mfma -fopenmp -Ofast -c -o aikern_fma_fast_o2.o $<
ar rcs $@ aikern_fma_fast_o2.o
rm aikern_fma_fast_o2.o
aikern_fma_fast_o3.a: aikern.c aikern.h
gcc -Wall -Wextra -Wno-unused -O3 -mavx -mfma -fopenmp -Ofast -c -o aikern_fma_fast_o3.o $<
ar rcs $@ aikern_fma_fast_o3.o
rm aikern_fma_fast_o3.o
aikern_fma_fast_fastmath_o3.a: aikern.c aikern.h
gcc -Wall -Wextra -Wno-unused -O3 -mavx -mfma -fopenmp -Ofast -ffast-math -c -o aikern_fma_fast_fastmath_o3.o $<
ar rcs $@ aikern_fma_fast_fastmath_o3.o
rm aikern_fma_fast_fastmath_o3.o
aikern_full.a: aikern.c aikern.h
gcc -Wall -Wextra -Wno-unused -O3 -mavx -mfma -fopenmp -Ofast -ffast-math -malign-double -march=native -c -o aikern_full.o $<
ar rcs $@ aikern_full.o
rm aikern_full.o
aikern_full_clang.a: aikern.c aikern.h
gcc -Wall -Wextra -Wno-unused -O3 -mavx -mfma -fopenmp -Ofast -ffast-math -march=native -c -o aikern_full_clang.o $<
ar rcs $@ aikern_full_clang.o
rm aikern_full_clang.o
aikern_profile.a: aikern.c aikern.h
gcc -Wall -Wextra -Wno-unused -fopenmp -O0 -g -pg -c -o aikern_profile.o $<
ar rcs $@ aikern_profile.o
rm aikern_profile.o
aikern_full_manpack.a: aikern.c aikern.h
gcc -Wall -Wextra -Wno-unused -DINTRINS -O3 -mavx -mfma -fopenmp -Ofast -ffast-math -malign-double -march=native -c -o aikern_full_manpack.o $<
ar rcs $@ aikern_full_manpack.o
rm aikern_full_manpack.o
# Cleanup
clean:
rm -f *.a
rm -f *.o
rm -f roofline roofline_o3 roofline_fma roofline_fma_o3 roofline_fma_fast_o3 roofline_fma_fast_o2 roofline_fma_fast_fastmath_o3 roofline_fma_fast_fastmath_aligned_o3 roofline_profile roofline_full_clang
rm -fR bin
rm -fR lib