make install with DESTDIR fails
I found that using make install DESTDIR=/tmp/ng to install built ngraph in a location of my choice leads to build failure. If I use make install, as it is suggested in INSTALL.md, then the build is fine. Details below.
--
System: Ubuntu 16.04, gcc-5.4, cmake 3.5.1 git commit id: commit 37fca35c8c2724ff011c30b95f52d3b53d0a9e8c
--
Steps:
mkdir build cd build cmake .. -DNGRAPH_USE_PREBUILT_LLVM=1 make -j4 install DESTDIR=/tmp/ng
-- Quick analysis suggests that DESTDIR conflicts with how mkldnn install is done.
Snippet from build log below telling that mkldnn is installed under DESTDIR, but build looks
for mkldnn.hpp under build/third_party/mkldnn/include/mkldnn.hpp.
-- Installing: /tmp/ng/home/nhasabni/intel/nervana/jai_ngraph/build/third-party/mkldnn/include/mkldnn.h
-- Installing: /tmp/ng/home/nhasabni/intel/nervana/jai_ngraph/build/third-party/mkldnn/include/mkldnn_types.h
-- Installing: /tmp/ng/home/nhasabni/intel/nervana/jai_ngraph/build/third-party/mkldnn/include/mkldnn.hpp
Full build log attached: ng.build.log
I have a similar issue when trying to make install using INSTALL_PREFIX :
cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/ngraph -DNGRAPH_INSTALL_PREFIX=/tmp/ngraph
make install
...
Install the project...
-- Install configuration: "Release"
-- Installing: /usr/local/lib/libmklml_intel.so
CMake Error at cmake_install.cmake:36 (file):
file INSTALL cannot copy file
"/home/wtambellini/repos/ngraph/build/mkldnn/src/external/mkl/lib/libmklml_intel.so"
to "/usr/local/lib/libmklml_intel.so".
looks like mklml still tries to install into the default /usr/local I guess.
You should only need to use -DCMAKE_INSTALL_PREFIX=/tmp/ngraph. I tested this on Ubuntu 16.04
Install the project...
-- Install configuration: ""
-- Installing: /tmp/ngraph/lib
-- Installing: /tmp/ngraph/lib/libiomp5.so
-- Installing: /tmp/ngraph/lib/libmkldnn.so
-- Installing: /tmp/ngraph/lib/libmkldnn.so.0
-- Installing: /tmp/ngraph/lib/libmkldnn.so.0.14.0
-- Installing: /tmp/ngraph/lib/libmklml_intel.so
...
NGRAPH_INSTALL_PREFIX is deprecated