-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
83 lines (55 loc) · 1.92 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Define the name of the config makefile.
CONFIG_MK_FILE := plugin/config.mk
# Include the configuration file.
-include $(CONFIG_MK_FILE)
#CC = gcc-13
#CXX = g++
#ARCH = gcc-ar-13
#ARCHFLAGS = cr
#RANLIB = gcc-ranlib-13
BLIS_INCDIR := $(includedir)/blis
STRASSEN_DIR := ../
# Define the name of the common makefile.
COMMON_MK_FILE := $(sharedir)/blis/common.mk
# Include the configuration file.
# include $(COMMON_MK_FILE)
COMPILER_OPT_LEVEL=O0
CFLAGS = -$(COMPILER_OPT_LEVEL) -g -fopenmp -m64 -mavx2 -fPIC -march=native
LDFLAGS = -lpthread -lm -fopenmp
$(info * Using CFLAGS=$(CFLAGS))
$(info * Using LDFLAGS=$(LDFLAGS))
$(info * Using LDLIBS=$(LDLIBS))
INC_DIR = -Iframe/include -Iplugin
FMM_LIB = lib/libfmm.a
PLUGIN_LIB = plugin/lib/haswell/libblis_fmm_blis.a
LIBBLIS = $(libdir)/libblis.a
FRAME_CC_SRC= frame/util/bli_fmm_util.c \
frame/base/bli_strassen_ab.c \
frame/base/bli_read_fmm.c
# KERNEL_SRC= plugin/ref_kernels/bli_packm_fmm_ref.c \
# plugin/ref_kernels/bli_gemm_fmm_ref.c
TEST_SRC = test/test_strassen_oapi.c
OTHER_DEP = frame/include/bli_fmm.h
CFLAGS += $(INC_DIR) -I$(BLIS_INCDIR)
FMM_LIB_OBJ=$(FRAME_CC_SRC:.c=.o)
TEST_OBJ=$(TEST_SRC:.c=.o)
TEST_EXE= test_strassen.x
all: $(FMM_LIB) test
lib: $(FMM_LIB)
test: $(TEST_EXE)
$(TEST_EXE): $(TEST_OBJ) $(FMM_LIB)
$(CC) $(CFLAGS) $(TEST_OBJ) -o $(TEST_EXE) $(LDFLAGS) $(LIBBLIS) $(PLUGIN_LIB) $(FMM_LIB)
$(FMM_LIB): $(FMM_LIB_OBJ)
-mkdir -p lib
$(AR) $(ARFLAGS) $@ $(FMM_LIB_OBJ)
$(RANLIB) $@
# ---------------------------------------------------------------------------
# Object files compiling rules
# ---------------------------------------------------------------------------
%.o: %.c $(OTHER_DEP)
$(CC) $(CFLAGS) -c $< -o $@ $(LDFLAGS)
# ---------------------------------------------------------------------------
clean:
-rm -f $(FMM_LIB_OBJ) $(FMM_LIB) test/*.o *.x
-rm -r lib
#$(MAKE) clean -f Makefile -C test