diff --git a/make/mshadow.mk b/make/mshadow.mk index ee87655dc121..61ff5e7e1050 100644 --- a/make/mshadow.mk +++ b/make/mshadow.mk @@ -54,7 +54,9 @@ else endif MSHADOW_LDFLAGS += -L${MKLROOT}/../compiler/lib/intel64 -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a -Wl,--end-group -liomp5 -ldl -lpthread -lm else - MSHADOW_LDFLAGS += -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 +ifneq ($(USE_MKLML), 1) + MSHADOW_LDFLAGS += -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 +endif endif else ifneq ($(USE_BLAS), NONE) @@ -62,6 +64,11 @@ ifneq ($(USE_BLAS), NONE) endif endif +ifeq ($(USE_MKLML), 1) + MSHADOW_CFLAGS += -I$(MKLROOT)/include + MSHADOW_LDFLAGS += -Wl,--as-needed -lmklml_intel -lmklml_gnu -liomp5 -L$(MKLROOT)/lib/ +endif + ifeq ($(USE_BLAS), openblas) MSHADOW_LDFLAGS += -lopenblas else ifeq ($(USE_BLAS), atlas) diff --git a/mshadow/base.h b/mshadow/base.h index e37fce93945e..3b5824ed126e 100644 --- a/mshadow/base.h +++ b/mshadow/base.h @@ -136,7 +136,7 @@ extern "C" { #include } #elif MSHADOW_USE_MKL - #include + #include #include #include #include