tensorflow_cc
tensorflow_cc copied to clipboard
CPack support
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 https://github.com/tensorflow/tensorflow/issues/2412#issuecomment-304433971
I recently packaged this for xenial, debian packaging available here:
https://github.com/MarbleInc/tensorflow_cc/tree/xenial
@phil-marble Cool, thank you! When you are ready, you can make a PR out of it.
I managed get CPack worked for this project.
-
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.
-
add
CPackinto the end ofCMakeList.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)
- 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
@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?
@FloopCZ Hey, I used the instructions in the post by @sunfic and it seems to have built a working package :)
@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.
@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.