Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPack support #8

Open
FloopCZ opened this issue Jul 17, 2017 · 7 comments
Open

CPack support #8

FloopCZ opened this issue Jul 17, 2017 · 7 comments

Comments

@FloopCZ
Copy link
Owner

FloopCZ commented Jul 17, 2017

It would be great to add CPack functionality in order to be able to distribute this as an already built installer and a standard package for Debian, Ubuntu, etc. See tensorflow/tensorflow#2412 (comment)

@phil-marble
Copy link

I recently packaged this for xenial, debian packaging available here:

https://github.com/MarbleInc/tensorflow_cc/tree/xenial

@FloopCZ
Copy link
Owner Author

FloopCZ commented Jan 19, 2018

@phil-marble Cool, thank you! When you are ready, you can make a PR out of it.

@sunfic
Copy link

sunfic commented Feb 1, 2018

I managed get CPack worked for this project.

  1. you have to use higher version of cmake (>3.7.0) in order to get over cmake bug #14332. Ubuntu 16.04 Xenial official apt only has cmake version 3.5.1. you have to upgrade it manually. I tested with cmake 3.10.

  2. add CPack into the end of CMakeList.txt

SET(CPACK_GENERATOR "DEB;TGZ")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Tensorflow_cc Maintainer")
SET(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar") # for cmake bug #14332
SET(CPACK_SET_DESTDIR true)
SET(CPACK_INSTALL_PREFIX "/usr/local")

INCLUDE(CPack)
  1. some symlink will not be replaced in Bazel output directories and they will cause errors when deb installation. I found not all the Bazel output directories are necessary thus I changed header installation part into
install(
  DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/tensorflow/"
  DESTINATION include/tensorflow
  FILES_MATCHING
  PATTERN "*.h"
  PATTERN "bazel-tensorflow*" EXCLUDE
)

maybe more filters can be added to get rid of empty directories as well.
full CMakeLists.txt:
CMakeLists.txt

@FloopCZ
Copy link
Owner Author

FloopCZ commented Feb 8, 2018

@sunfic This is great, thank you!

I fixed the script that gets rid of symlinks by copying the original files. Can you try to build a .deb file out of the most recent master branch?

@sjdrc
Copy link

sjdrc commented Feb 21, 2018

@FloopCZ Hey, I used the instructions in the post by @sunfic and it seems to have built a working package :)

@sunfic
Copy link

sunfic commented Mar 2, 2018

@FloopCZ I tried to test the new code but right now the Bazel, Tensorflow and CUDA updates make more errors pop up. I will wait until the tool chains stable than redo the tests.

@sunfic
Copy link

sunfic commented Mar 5, 2018

@FloopCZ I can comfirm that for current version tensorflow_cc for tensorflow 1.6.0 can be successfully built on X86-64 with latest CUDA 9.1 and on aarch64 (NVIDIA TX1) with CUDA 8.0 with bazel 0.11.0.
I did with "--config=monolithic" option on and used GCC5.
Since both GCC versions (5 and 6) worked, I suggest by default using system gcc version without adding additional tool chain for current Ubuntu 16.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants