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

[CMake] Make install / ninja install failing [dmlc-core] #13578

Closed
larroy opened this issue Dec 7, 2018 · 14 comments
Closed

[CMake] Make install / ninja install failing [dmlc-core] #13578

larroy opened this issue Dec 7, 2018 · 14 comments
Labels
Breaking CMake CMake related bugs/issues/improvements Installation

Comments

@larroy
Copy link
Contributor

larroy commented Dec 7, 2018

Description

install target fails:

-- Up-to-date: /usr/local/include/gtest/internal/gtest-filepath.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-param-util-generated.h.pump
-- Up-to-date: /usr/local/include/gtest/internal/custom
-- Up-to-date: /usr/local/include/gtest/internal/custom/gtest.h
-- Up-to-date: /usr/local/include/gtest/internal/custom/gtest-port.h
-- Up-to-date: /usr/local/include/gtest/internal/custom/gtest-printers.h
-- Up-to-date: /usr/local/include/gtest/gtest-printers.h
-- Up-to-date: /usr/local/include/gtest/gtest_pred_impl.h
-- Up-to-date: /usr/local/include/gtest/gtest-param-test.h
-- Up-to-date: /usr/local/include/gtest/gtest-death-test.h
-- Up-to-date: /usr/local/include/gtest/gtest-test-part.h
-- Up-to-date: /usr/local/lib/libdmlc.a
-- Up-to-date: /usr/local/./include
-- Installing: /usr/local/./include/dmlc
CMake Error at 3rdparty/dmlc-core/cmake_install.cmake:40 (file):
  file INSTALL cannot set permissions on "/usr/local/./include/dmlc"
Call Stack (most recent call first):
  cmake_install.cmake:68 (include)
  


Makefile:71: recipe for target 'install' failed
make: *** [install] Error 1

Reproduction

Build with CMake, do make install

./dev_menu.py build
cd build && ninja install

Environment

Ubuntu 16.04

@lebeg

@larroy
Copy link
Contributor Author

larroy commented Dec 7, 2018

We should test install target in CI.

@lanking520 lanking520 added Installation Breaking CMake CMake related bugs/issues/improvements labels Dec 7, 2018
@marcoabreu
Copy link
Contributor

Well you are building inside the container and trying to install outside of it. The dependency clojure and your environment could mismatch there.

@larroy
Copy link
Contributor Author

larroy commented Dec 8, 2018

This is all local no containers where harmed

@marcoabreu
Copy link
Contributor

Isn't "dev menu build" run inside the container?

@larroy
Copy link
Contributor Author

larroy commented Dec 8, 2018

no, that one is local. I run it also manually with ninja and make. the issue is legit.

@potetisensei
Copy link

I just encountered the same problem.

Seems the below symbolic link points to a relative path, and the installation works well when we change it into the absolute path?(I'm not confident)

# ls -al /usr/local/./include/dmlc
lrwxrwxrwx 1 root root 34 12月 12 22:54 /usr/local/./include/dmlc -> ../3rdparty/dmlc-core/include/dmlc
# ln -f -s /home/potetisensei/Pattern/mxnet/3rdparty/dmlc-core/include/dmlc /usr/local/./include/dmlc
# make install
[  2%] Built target dmlc
[ 54%] Built target mxnet_static
[ 78%] Built target mkldnn
[ 79%] Built target libomp-needed-headers
[ 88%] Built target omp
[ 89%] Built target im2rec
[ 90%] Built target mxnet
[ 91%] Built target gtest
[ 91%] Built target gtest_main
[ 95%] Built target dmlc_unit_tests
[100%] Built target mxnet_unit_tests
[100%] Built target image-classification-predict
Install the project...
-- Install configuration: ""
-- Up-to-date: /usr/local/lib/libmxnet.so
-- Up-to-date: /usr/local/lib/libmxnet.a
-- Up-to-date: /usr/local/include
-- Up-to-date: /usr/local/include/mxnet
-- Up-to-date: /usr/local/include/mxnet/kvstore.h
-- Up-to-date: /usr/local/include/mxnet/engine.h
-- Up-to-date: /usr/local/include/mxnet/io.h
-- Up-to-date: /usr/local/include/mxnet/operator_util.h
-- Up-to-date: /usr/local/include/mxnet/op_attr_types.h
-- Up-to-date: /usr/local/include/mxnet/base.h
-- Up-to-date: /usr/local/include/mxnet/random_generator.h
-- Up-to-date: /usr/local/include/mxnet/executor.h
-- Up-to-date: /usr/local/include/mxnet/c_api.h
-- Up-to-date: /usr/local/include/mxnet/storage.h
-- Up-to-date: /usr/local/include/mxnet/c_predict_api.h
-- Up-to-date: /usr/local/include/mxnet/ndarray.h
-- Up-to-date: /usr/local/include/mxnet/resource.h
-- Up-to-date: /usr/local/include/mxnet/rtc.h
-- Up-to-date: /usr/local/include/mxnet/c_api_test.h
-- Up-to-date: /usr/local/include/mxnet/graph_attr_types.h
-- Up-to-date: /usr/local/include/mxnet/tensor_blob.h
-- Up-to-date: /usr/local/include/mxnet/imperative.h
-- Up-to-date: /usr/local/include/mxnet/operator.h
-- Up-to-date: /usr/local/include/dlpack
-- Up-to-date: /usr/local/include/mshadow
-- Up-to-date: /usr/local/include/nnvm
-- Up-to-date: /usr/local/share/doc/mkldnn/LICENSE
-- Up-to-date: /usr/local/lib/libmkldnn.so.0.17.1.0
-- Up-to-date: /usr/local/lib/libmkldnn.so.0
-- Up-to-date: /usr/local/lib/libmkldnn.so
-- Up-to-date: /usr/local/include/mkldnn.h
-- Up-to-date: /usr/local/include/mkldnn_debug.h
-- Up-to-date: /usr/local/include/mkldnn_types.h
-- Up-to-date: /usr/local/include/mkldnn.hpp
-- Up-to-date: /usr/local/lib/libomp.so
-- Up-to-date: /usr/local/include/omp.h
-- Up-to-date: /usr/local/lib/libgtest.a
-- Up-to-date: /usr/local/lib/libgtest_main.a
-- Up-to-date: /usr/local/include/gtest
-- Up-to-date: /usr/local/include/gtest/gtest-message.h
-- Up-to-date: /usr/local/include/gtest/gtest-param-test.h
-- Up-to-date: /usr/local/include/gtest/gtest-test-part.h
-- Up-to-date: /usr/local/include/gtest/internal
-- Up-to-date: /usr/local/include/gtest/internal/custom
-- Up-to-date: /usr/local/include/gtest/internal/custom/gtest-port.h
-- Up-to-date: /usr/local/include/gtest/internal/custom/gtest.h
-- Up-to-date: /usr/local/include/gtest/internal/custom/gtest-printers.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-internal.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-type-util.h.pump
-- Up-to-date: /usr/local/include/gtest/internal/gtest-port-arch.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-death-test-internal.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-string.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-filepath.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-type-util.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-port.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-linked_ptr.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-param-util.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-tuple.h
-- Up-to-date: /usr/local/include/gtest/internal/gtest-tuple.h.pump
-- Up-to-date: /usr/local/include/gtest/internal/gtest-param-util-generated.h.pump
-- Up-to-date: /usr/local/include/gtest/internal/gtest-param-util-generated.h
-- Up-to-date: /usr/local/include/gtest/gtest.h
-- Up-to-date: /usr/local/include/gtest/gtest-typed-test.h
-- Up-to-date: /usr/local/include/gtest/gtest-death-test.h
-- Up-to-date: /usr/local/include/gtest/gtest-printers.h
-- Up-to-date: /usr/local/include/gtest/gtest-param-test.h.pump
-- Up-to-date: /usr/local/include/gtest/gtest-spi.h
-- Up-to-date: /usr/local/include/gtest/gtest_pred_impl.h
-- Up-to-date: /usr/local/include/gtest/gtest_prod.h
-- Up-to-date: /usr/local/lib/libdmlc.a
-- Up-to-date: /usr/local/./include
-- Installing: /usr/local/./doc
-- Installing: /usr/local/./doc/Doxyfile
-- Installing: /usr/local/./doc/README
-- Installing: /usr/local/./doc/sphinx_util.py
-- Installing: /usr/local/./doc/Makefile
-- Installing: /usr/local/./doc/parameter.md
-- Installing: /usr/local/./doc/.gitignore
-- Installing: /usr/local/./doc/conf.py
-- Installing: /usr/local/./doc/index.md

By the way, I don't want the header files and library files to be under my home directory because I'm likely to accidentally erase them....

@larroy
Copy link
Contributor Author

larroy commented Dec 16, 2018

Who creates this link in the first place?

@sl1pkn07
Copy link
Contributor

sl1pkn07 commented Apr 12, 2019

same problem here. seems try to install symlinks instead of real files

make -C build DESTDIR=/tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git install
make: se entra en el directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
make[1]: se entra en el directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
make[2]: se entra en el directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
make[2]: se sale del directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
[  2%] Built target dmlc
make[2]: se entra en el directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
make[2]: se sale del directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
[ 92%] Built target mxnet_static
make[2]: se entra en el directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
make[2]: se entra en el directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
make[2]: se sale del directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
make[2]: se sale del directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
[ 93%] Built target mxnet
make[2]: se entra en el directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
[ 94%] Built target im2rec
make[2]: se sale del directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
make[2]: se entra en el directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
Running: OpWrapperGenerator.py
make[2]: se entra en el directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
make[2]: se sale del directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
[100%] Built target mxnet_unit_tests
make[2]: se sale del directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
[100%] Built target cpp_package_op_h
make[1]: se sale del directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
Install the project...
-- Install configuration: "None"
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/lib/libmxnet.so.1.4
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/lib/libmxnet.so.0
-- Set runtime path of "/tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/lib/libmxnet.so.1.4" to ""
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/lib/libmxnet.so
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/lib/libmxnet.a
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/nnvm
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/tuple.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/tensor_blob.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/storage.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/rtc.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/resource.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/random_generator.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/operator_util.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/operator.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/op_attr_types.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/ndarray.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/libinfo.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/kvstore.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/io.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/imperative.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/graph_attr_types.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/executor.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/engine.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/c_predict_api.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/c_api_test.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/c_api_error.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/c_api.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mxnet/base.h
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mshadow
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/mkldnn
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/dmlc
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/dlpack
-- Up-to-date: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include
-- Installing: /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/nnvm
CMake Error at cmake_install.cmake:102 (file):
  file INSTALL cannot make directory
  "/tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/nnvm": No such
  file or directory


make: *** [Makefile:86: install] Error 1
make: se sale del directorio '/tmp/makepkg/sl1-mxnet-git/src/build'
└───╼  ls /tmp/makepkg/sl1-mxnet-git/pkg/sl1-mxnet-git/usr/include/
total 0
drwxr-xr-x 3 sl1pkn07 users 160 abr 12 22:09 .
drwxr-xr-x 4 sl1pkn07 users  80 abr 12 22:09 ..
lrwxrwxrwx 1 sl1pkn07 users  33 abr 12 22:09 dlpack -> ../3rdparty/dlpack/include/dlpack
lrwxrwxrwx 1 sl1pkn07 users  34 abr 12 22:09 dmlc -> ../3rdparty/dmlc-core/include/dmlc
lrwxrwxrwx 1 sl1pkn07 users  26 abr 12 22:09 mkldnn -> ../3rdparty/mkldnn/include
lrwxrwxrwx 1 sl1pkn07 users  27 abr 12 22:09 mshadow -> ../3rdparty/mshadow/mshadow
drwxr-xr-x 2 sl1pkn07 users 480 abr 12 22:09 mxnet
lrwxrwxrwx 1 sl1pkn07 users  33 abr 12 22:09 nnvm -> ../3rdparty/tvm/nnvm/include/nnvm

the build process is doing outside the mxnet sources

mkdir -p build
cd build
cmake ../incubator-mxnet -Dfoo

greetings

EDIT: build inside the source tree do nothing, same issue

@sl1pkn07
Copy link
Contributor

i think i found the problem

/~https://github.com/apache/incubator-mxnet/tree/master/include

all is a symlink instead of real files, and point it to relative paths instead off full path

└───╼  ls
total 0
drwxr-xr-x  3 sl1pkn07 users  160 abr 12 23:05 .
drwxr-xr-x 27 sl1pkn07 users 1020 abr 12 23:05 ..
lrwxrwxrwx  1 sl1pkn07 users   33 abr 12 23:05 dlpack -> ../3rdparty/dlpack/include/dlpack
lrwxrwxrwx  1 sl1pkn07 users   34 abr 12 23:05 dmlc -> ../3rdparty/dmlc-core/include/dmlc
lrwxrwxrwx  1 sl1pkn07 users   26 abr 12 23:05 mkldnn -> ../3rdparty/mkldnn/include
lrwxrwxrwx  1 sl1pkn07 users   27 abr 12 23:05 mshadow -> ../3rdparty/mshadow/mshadow
drwxr-xr-x  2 sl1pkn07 users  480 abr 12 23:05 mxnet
lrwxrwxrwx  1 sl1pkn07 users   33 abr 12 23:05 nnvm -> ../3rdparty/tvm/nnvm/include/nnvm

@sl1pkn07
Copy link
Contributor

sl1pkn07 commented Apr 12, 2019

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e121549b19..1bb0ab3d98 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -755,10 +759,16 @@ install(TARGETS ${MXNET_INSTALL_TARGETS}
 #       https://cmake.org/cmake/help/v3.0/variable/CMAKE_INSTALL_PREFIX.html
 #       https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html
 
-install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-install(DIRECTORY 3rdparty/tvm/nnvm/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/dlpack/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/dmlc-core/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+if(USE_MKLDNN)
+  install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/mkldnn/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+endif()
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/mshadow/mshadow/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mshadow)
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/mxnet/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mxnet)
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/tvm/nnvm/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
 if (INSTALL_EXAMPLES)
-  install(DIRECTORY example  DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
+  install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/example  DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
 endif()
 
 if (USE_SIGNAL_HANDLER)

tested in my local installation. the error is gone and the files is seems installed in the rigth path

@larroy @potetisensei you can test it?

@larroy
Copy link
Contributor Author

larroy commented Apr 13, 2019

@sl1pkn07 your patch works for me. Can you make a PR? Thanks for the fix!

@sl1pkn07
Copy link
Contributor

sl1pkn07 commented Apr 13, 2019

then its all ok?

i'm not sure if the all of ${CMAKE_CURRENT_SOURCE_DIR} is necessary

@sl1pkn07
Copy link
Contributor

@larroy all yours #14692

@larroy
Copy link
Contributor Author

larroy commented May 29, 2019

Many thanks for the fixes @sl1pkn07 this is working now.

@larroy larroy closed this as completed May 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Breaking CMake CMake related bugs/issues/improvements Installation
Projects
None yet
Development

No branches or pull requests

5 participants