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

CMake: Enable installation of cpp-package headers #13339

Merged
merged 3 commits into from
Dec 31, 2018

Conversation

MoritzMaxeiner
Copy link
Contributor

This allows installing the cpp-package via CMake's install target:

  • Installs the headers of the cpp-package
  • Installs the missing nnvm headers (on which we depend)

@stu1130
Copy link
Contributor

stu1130 commented Nov 20, 2018

@mxnet-label-bot add [pr-awaiting-review]
Thanks for your contribution @MoritzMaxeiner

@marcoabreu marcoabreu added the pr-awaiting-review PR is waiting for code review label Nov 20, 2018
@vandanavk
Copy link
Contributor

@marcoabreu @lebeg @larroy for review

Copy link
Contributor

@larroy larroy left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

Copy link
Contributor

@larroy larroy left a comment

Choose a reason for hiding this comment

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

Change looks good.

Does it work for you? I have some errors when I run install:


-- Installing: /usr/local/include/gtest/internal/gtest-string.h
-- Installing: /usr/local/include/gtest/internal/gtest-linked_ptr.h
-- Installing: /usr/local/include/gtest/internal/gtest-type-util.h.pump
-- Installing: /usr/local/include/gtest/internal/gtest-param-util.h
-- Installing: /usr/local/include/gtest/internal/gtest-death-test-internal.h
-- Installing: /usr/local/include/gtest/internal/gtest-internal.h
-- Installing: /usr/local/include/gtest/internal/gtest-type-util.h
-- Installing: /usr/local/include/gtest/internal/gtest-param-util-generated.h
-- Installing: /usr/local/include/gtest/internal/gtest-filepath.h
-- Installing: /usr/local/include/gtest/internal/gtest-param-util-generated.h.pump
-- Installing: /usr/local/include/gtest/internal/custom
-- Installing: /usr/local/include/gtest/internal/custom/gtest.h
-- Installing: /usr/local/include/gtest/internal/custom/gtest-port.h
-- Installing: /usr/local/include/gtest/internal/custom/gtest-printers.h
-- Installing: /usr/local/include/gtest/gtest-printers.h
-- Installing: /usr/local/include/gtest/gtest_pred_impl.h
-- Installing: /usr/local/include/gtest/gtest-param-test.h
-- Installing: /usr/local/include/gtest/gtest-death-test.h
-- Installing: /usr/local/include/gtest/gtest-test-part.h
-- Installing: /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)

@@ -730,6 +730,7 @@ install(TARGETS ${MXNET_INSTALL_TARGETS}
)

install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY 3rdparty/tvm/nnvm/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add comments to where are we installing things by default? it's quite hidden in CMAKE documentation where they go. ( I had to dig a bit )

Copy link
Contributor Author

@MoritzMaxeiner MoritzMaxeiner Dec 7, 2018

Choose a reason for hiding this comment

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

That's a bit out of scope for what I intended with the PR, but sure.
You can find CMake's documentation here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See a005e9c

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for that.

@@ -730,6 +730,7 @@ install(TARGETS ${MXNET_INSTALL_TARGETS}
)

install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY 3rdparty/tvm/nnvm/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't mshadow needed as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I could tell, no public headers include it. At least, my C++ project importing the full cpp-package header works without mshadow being installed.

@MoritzMaxeiner
Copy link
Contributor Author

Does it work for you? I have some errors when I run install:

Yes, I use these changes[1][2] in our vcpkg fork[3] on Windows (7, 10, Server 2016) where I build and deploy a plugin (shared library) using the CPP package, linked against mxnet's shared library.
Since it seems you're using Linux, are you installing with root permissions? If not, you'd best try to use something like -DCMAKE_INSTALL_PREFIX=~/.local

[1] https://git.imp.fu-berlin.de/bioroboticslab/robofish/vcpkg/blob/master/ports/mxnet/0003-install-cpp-package.patch
[2] https://git.imp.fu-berlin.de/bioroboticslab/robofish/vcpkg/blob/master/ports/mxnet/0004-install-nnvm.patch
[3] https://git.imp.fu-berlin.de/bioroboticslab/robofish/vcpkg/tree/master/ports/mxnet

@larroy
Copy link
Contributor

larroy commented Dec 7, 2018

It doesn't #13578

Copy link
Contributor

@larroy larroy left a comment

Choose a reason for hiding this comment

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

LGTM
install fails in Linux but I think this is out of the scope for this PR.
We should test install in CI

@Roshrini
Copy link
Member

@MoritzMaxeiner Can you retrigger the build for this PR? It seems to be approved

@MoritzMaxeiner
Copy link
Contributor Author

@Roshrini Sure, didn't realize that was needed in this case.

@MoritzMaxeiner
Copy link
Contributor Author

@Roshrini All checks seem to have passed, now.

@Roshrini
Copy link
Member

@marcoabreu @KellenSunderland to review/merge this PR?
@mxnet-label-bot Update [pr-awaiting-merge]

@marcoabreu marcoabreu added pr-awaiting-merge Review and CI is complete. Ready to Merge and removed pr-awaiting-review PR is waiting for code review labels Dec 19, 2018
@KellenSunderland KellenSunderland merged commit bff0fdc into apache:master Dec 31, 2018
@larroy
Copy link
Contributor

larroy commented Jan 9, 2019

#13801

rondogency pushed a commit to rondogency/incubator-mxnet that referenced this pull request Jan 9, 2019
* Allow CMake based installation of cpp-package

* Add installation of missing nnvm headers

* Add documentation as to where public headers will be installed
@ChaiBapchya
Copy link
Contributor

@larroy Since this PR is merged, does this fix the cpp build package issue #13801 that you mentioned? If it is fixed, we can update that issue and close it in that case.

haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
* Allow CMake based installation of cpp-package

* Add installation of missing nnvm headers

* Add documentation as to where public headers will be installed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-merge Review and CI is complete. Ready to Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants