From f5671d86c1c981622060a2f5adf64d0ba25c4a9f Mon Sep 17 00:00:00 2001 From: Fei Gao Date: Mon, 19 Sep 2016 03:07:15 -0700 Subject: [PATCH] Build with Multiverso and ASGD --- Makefile | 32 ++++++++++++++++++++++++++------ Tools/setup_mv.sh | 4 ++++ 2 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 Tools/setup_mv.sh diff --git a/Makefile b/Makefile index 55664e161..1496bfc44 100644 --- a/Makefile +++ b/Makefile @@ -431,6 +431,8 @@ $(CNTKLIBRARY_TESTS): $(CNTKLIBRARY_TESTS_OBJ) | $(CNTKLIBRARY_LIB) @mkdir -p $(dir $@) @echo building output for $(ARCH) with build type $(BUILDTYPE) $(CXX) $(LDFLAGS) $(patsubst %,-L%, $(LIBDIR) $(LIBPATH) $(GDK_NVML_LIB_PATH)) $(patsubst %,$(RPATH)%, $(ORIGINLIBDIR) $(LIBPATH)) -o $@ $^ $(LIBS) -l$(CNTKLIBRARY) -l$(CNTKMATH) + + ######################################## # LibEval @@ -464,11 +466,11 @@ EVAL_LIB:=$(LIBDIR)/lib$(EVAL).so ALL+=$(EVAL_LIB) SRC+=$(EVAL_SRC) -$(EVAL_LIB): $(EVAL_OBJ) | $(CNTKMATH_LIB) +$(EVAL_LIB): $(EVAL_OBJ) | $(CNTKMATH_LIB) $(MULTIVERSO_LIB) @echo $(SEPARATOR) @mkdir -p $(dir $@) @echo Building $(EVAL_LIB) for $(ARCH) with build type $(BUILDTYPE) - $(CXX) $(LDFLAGS) -shared $(patsubst %,-L%, $(LIBDIR) $(LIBPATH) $(GDK_NVML_LIB_PATH)) $(patsubst %,$(RPATH)%, $(ORIGINDIR) $(LIBPATH)) -o $@ $^ $(LIBS) -l$(CNTKMATH) + $(CXX) $(LDFLAGS) -shared $(patsubst %,-L%, $(LIBDIR) $(LIBPATH) $(GDK_NVML_LIB_PATH)) $(patsubst %,$(RPATH)%, $(ORIGINDIR) $(LIBPATH)) -o $@ $^ $(LIBS) -l$(CNTKMATH) -lmultiverso ######################################## # Eval Sample client @@ -770,6 +772,7 @@ endif # temporarily adding to 1bit, need to work with others to fix it endif + ######################################## # ASGD(multiverso) setup ######################################## @@ -780,11 +783,28 @@ ifeq (,$(wildcard Source/Multiverso/include/multiverso/*.h)) $(error Build with Multiverso was requested but cannot find the code. Please check https://github.com/Microsoft/DMTK to learn more.) endif - INCLUDEPATH += $(SOURCEDIR)/Multiverso/include - LIBPATH += $(SOURCEDIR)/Multiverso/x64/$(BUILDTYPE) - LIBS += -lmultiverso -ldl +INCLUDEPATH += $(SOURCEDIR)/Multiverso/include +LIBPATH += $(LIBDIR) +LIBS += -lmultiverso -ldl +COMMON_FLAGS += -DMULTIVERSO_SUPPORT + +MULTIVERSO_LIB:=$(LIBDIR)/libmultiverso.so +MULTIVERSO_TEST:=$(BINDIR)/multiversotests + +ALL+=$(MULTIVERSO_LIB) +ALL+=$(MULTIVERSO_TEST) + +MULTIVERSO: + @echo "Build Multiverso lib and unit tests" + @mkdir -p $(SOURCEDIR)/Multiverso/build + @sh $(SOURCEDIR)/../Tools/setup_mv.sh + +$(MULTIVERSO_LIB): MULTIVERSO + @cp $(SOURCEDIR)/Multiverso/build/src/libmultiverso.so $(MULTIVERSO_LIB) + +$(MULTIVERSO_TEST): MULTIVERSO + @cp $(SOURCEDIR)/Multiverso/build/Test/unittests/multiverso.ut $(MULTIVERSO_TEST) - COMMON_FLAGS += -DMULTIVERSO_SUPPORT endif ######################################## diff --git a/Tools/setup_mv.sh b/Tools/setup_mv.sh new file mode 100644 index 000000000..b57ab609a --- /dev/null +++ b/Tools/setup_mv.sh @@ -0,0 +1,4 @@ +cd Source/Multiverso/build +cmake .. +make -j multiverso +make -j multiverso.ut