Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fix MKL-DNN installation on different platforms #16690

Merged
merged 1 commit into from
Nov 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions mkldnn.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ ifeq ($(USE_MKLDNN), 1)
MXNET_INCLDIR = $(ROOTDIR)/include
ifeq ($(UNAME_S), Darwin)
MKLDNN_LIBFILE = $(MKLDNNROOT)/lib/libmkldnn.1.dylib
MKLDNN_LIB64FILE = $(MKLDNNROOT)/lib64/libmkldnn.1.dylib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are the lib64 files being removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make the installation more deterministic. Now the binaries will be installed to MKLDNNROOT/lib while previously they will be installed to lib or lib64 or lib/x86_64-linux-gnu (as you can see in the issue report) according to different platforms.

else
MKLDNN_LIBFILE = $(MKLDNNROOT)/lib/libmkldnn.so.1
MKLDNN_LIB64FILE = $(MKLDNNROOT)/lib64/libmkldnn.so.1
endif
endif

Expand All @@ -35,16 +33,11 @@ mkldnn_build: $(MKLDNN_LIBFILE)

$(MKLDNN_LIBFILE):
mkdir -p $(MKLDNNROOT)/lib
cmake $(MKLDNN_SUBMODDIR) -DCMAKE_INSTALL_PREFIX=$(MKLDNNROOT) -B$(MKLDNN_BUILDDIR) -DMKLDNN_ARCH_OPT_FLAGS="" -DMKLDNN_BUILD_TESTS=OFF -DMKLDNN_BUILD_EXAMPLES=OFF -DMKLDNN_ENABLE_JIT_PROFILING=OFF
cmake $(MKLDNN_SUBMODDIR) -DCMAKE_INSTALL_PREFIX=$(MKLDNNROOT) -DCMAKE_INSTALL_LIBDIR=lib -B$(MKLDNN_BUILDDIR) -DMKLDNN_ARCH_OPT_FLAGS="" -DMKLDNN_BUILD_TESTS=OFF -DMKLDNN_BUILD_EXAMPLES=OFF -DMKLDNN_ENABLE_JIT_PROFILING=OFF
$(MAKE) -C $(MKLDNN_BUILDDIR) VERBOSE=1
$(MAKE) -C $(MKLDNN_BUILDDIR) install
mkdir -p $(MXNET_LIBDIR)
if [ -f "$(MKLDNN_LIB64FILE)" ]; then \
cp $(MKLDNNROOT)/lib64/libmkldnn* $(MXNET_LIBDIR); \
cp $(MKLDNNROOT)/lib64/libmkldnn* $(MKLDNNROOT)/lib/; \
else \
cp $(MKLDNNROOT)/lib/libmkldnn* $(MXNET_LIBDIR); \
fi
cp $(MKLDNN_LIBFILE) $(MXNET_LIBDIR)
cp $(MKLDNN_BUILDDIR)/include/mkldnn_version.h $(MXNET_INCLDIR)/mkldnn/.

mkldnn_clean:
Expand Down