From af82db92464f535fbb026605702decf9de2aae9b Mon Sep 17 00:00:00 2001 From: Raymond Kim Date: Wed, 29 Nov 2023 21:26:58 +0000 Subject: [PATCH] #3058: WIP PLS REDO --- tests/tt_eager/module.mk | 2 +- tt_eager/dtx/module.mk | 7 +------ tt_eager/tt_dnn/module.mk | 7 +------ tt_eager/tt_lib/csrc/module.mk | 8 +++++--- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/tests/tt_eager/module.mk b/tests/tt_eager/module.mk index 72b150713077..530c64366cc4 100644 --- a/tests/tt_eager/module.mk +++ b/tests/tt_eager/module.mk @@ -36,7 +36,7 @@ TT_EAGER_TESTS += \ TT_EAGER_TESTS_SRCS = $(addprefix tests/tt_eager/, $(addsuffix .cpp, $(TT_EAGER_TESTS:tests/%=%))) TT_EAGER_TESTS_INCLUDES = $(TEST_INCLUDES) $(TT_EAGER_INCLUDES) -TT_EAGER_TESTS_LDFLAGS = $(TT_METAL_TESTS_LDFLAGS) $(TT_LIB_LDFLAGS) +TT_EAGER_TESTS_LDFLAGS = $(TT_METAL_TESTS_LDFLAGS) $(TT_LIB_LDFLAGS) -ltt_eager TT_EAGER_TESTS_OBJS = $(addprefix $(OBJDIR)/, $(TT_EAGER_TESTS_SRCS:.cpp=.o)) TT_EAGER_TESTS_DEPS = $(addprefix $(OBJDIR)/, $(TT_EAGER_TESTS_SRCS:.cpp=.d)) diff --git a/tt_eager/dtx/module.mk b/tt_eager/dtx/module.mk index 0f2523743a53..8cf5beaef76b 100644 --- a/tt_eager/dtx/module.mk +++ b/tt_eager/dtx/module.mk @@ -1,5 +1,4 @@ # Every variable in subdir must be prefixed with subdir (emulating a namespace) -DTX_LIB = $(LIBDIR)/libdtx.a DTX_DEFINES = DTX_INCLUDES = $(TT_EAGER_INCLUDES) DTX_CFLAGS = $(CFLAGS) -Werror -Wno-int-to-pointer-cast @@ -34,11 +33,7 @@ DTX_DEPS = $(addprefix $(OBJDIR)/, $(DTX_SRCS:.cpp=.d)) -include $(DTX_DEPS) # Each module has a top level target as the entrypoint which must match the subdir name -tt_eager/dtx: $(DTX_LIB) - -$(DTX_LIB): $(COMMON_LIB) $(TT_METAL_LIB) $(TENSOR_LIB) $(DTX_OBJS) - @mkdir -p $(@D) - ar rcs -o $@ $(DTX_OBJS) +tt_eager/dtx: $(DTX_OBJS) $(TENSOR_OBJS) $(OBJDIR)/tt_eager/dtx/%.o: tt_eager/dtx/%.cpp @mkdir -p $(@D) diff --git a/tt_eager/tt_dnn/module.mk b/tt_eager/tt_dnn/module.mk index f469867a5898..0d8aef5a5206 100644 --- a/tt_eager/tt_dnn/module.mk +++ b/tt_eager/tt_dnn/module.mk @@ -173,7 +173,6 @@ TT_DNN_SRCS = \ tt_eager/tt_dnn/op_library/upsample/upsample_op.cpp \ -TT_DNN_LIB = $(LIBDIR)/libtt_dnn.a TT_DNN_DEFINES = TT_DNN_INCLUDES = $(TT_EAGER_INCLUDES) TT_DNN_CFLAGS = $(CFLAGS) -Werror -Wno-int-to-pointer-cast @@ -184,11 +183,7 @@ TT_DNN_DEPS = $(addprefix $(OBJDIR)/, $(TT_DNN_SRCS:.cpp=.d)) -include $(TT_DNN_DEPS) # Each module has a top level target as the entrypoint which must match the subdir name -tt_eager/tt_dnn: $(TT_DNN_LIB) - -$(TT_DNN_LIB): $(COMMON_LIB) $(DTX_LIB) $(TT_DNN_OBJS) - @mkdir -p $(LIBDIR) - ar rcs -o $@ $(TT_DNN_OBJS) +tt_eager/tt_dnn: $(TT_DNN_OBJS) $(DTX_OBJS) $(OBJDIR)/tt_eager/tt_dnn/%.o: tt_eager/tt_dnn/%.cpp @mkdir -p $(@D) diff --git a/tt_eager/tt_lib/csrc/module.mk b/tt_eager/tt_lib/csrc/module.mk index 6d57f87f334f..7863a7fed7d9 100644 --- a/tt_eager/tt_lib/csrc/module.mk +++ b/tt_eager/tt_lib/csrc/module.mk @@ -2,7 +2,7 @@ TT_LIB_LIB = $(LIBDIR)/libtt_lib_csrc.so TT_LIB_LIB_LOCAL_SO = tt_eager/tt_lib/_C.so TT_LIB_DEFINES = TT_LIB_INCLUDES = $(TT_EAGER_INCLUDES) $(shell python3-config --includes) -Itt_metal/third_party/pybind11/include -TT_LIB_LDFLAGS = -ltt_dnn -ldtx -ltensor -lqueue -ltt_metal -lyaml-cpp $(LDFLAGS) +TT_LIB_LDFLAGS = -ltensor -ltt_metal -lyaml-cpp $(LDFLAGS) TT_LIB_CFLAGS = $(CFLAGS) -Werror -Wno-int-to-pointer-cast -fno-var-tracking TT_LIB_SRCS = \ @@ -23,10 +23,12 @@ TT_LIB_DEPS = $(addprefix $(OBJDIR)/, $(TT_LIB_SRCS:.cpp=.d)) tt_lib: $(TT_LIB_LIB) +TT_LIB_DEP_OBJS = $(TT_LIB_OBJS) $(TT_DNN_OBJS) $(DTX_OBJS) $(QUEUE_OBJS) + # Link obj files into shared lib -$(TT_LIB_LIB): $(TT_LIB_OBJS) $(TT_DNN_LIB) $(TENSOR_LIB) $(DTX_LIB) $(TT_METAL_LIB) +$(TT_LIB_LIB): $(TT_LIB_DEP_OBJS) $(TENSOR_LIB) $(TT_METAL_LIB) @mkdir -p $(LIBDIR) - $(CXX) $(TT_LIB_CFLAGS) $(CXXFLAGS) $(SHARED_LIB_FLAGS) -o $@ $(TT_LIB_OBJS) $(TT_LIB_LDFLAGS) + $(CXX) $(TT_LIB_CFLAGS) $(CXXFLAGS) $(SHARED_LIB_FLAGS) -o $@ $(TT_LIB_DEP_OBJS) $(TT_LIB_LDFLAGS) $(TT_LIB_LIB_LOCAL_SO): $(TT_LIB_LIB) cp -fp $^ $@