Section: devel
Priority: optional
Maintainer: Sangjung Woo <sangjung.woo@samsung.com>
-Build-Depends: debhelper (>=9), sed, zlib1g-dev, cmake (>=3.9), python, git, python-numpy, swig, python-dev, libc6-dev, unzip, libicu-dev, pkg-config, libssl-dev, libprotobuf-dev, protobuf-compiler, protobuf-c-compiler, libprotobuf-c-dev, libgrpc-dev, libc-ares-dev
+Build-Depends: debhelper (>=9), sed, zlib1g-dev, cmake (>=3.9), python, git, python-numpy, swig, python-dev, libc6-dev, unzip, libicu-dev, pkg-config, libssl-dev, libprotobuf-dev, protobuf-compiler, protobuf-c-compiler, libprotobuf-c-dev, libc-ares-dev,
+ libgrpc-dev [bionic], libgrpc++-dev [bionic]
Standards-Version: 3.9.6
Homepage: https://github.sec.samsung.net/RS7-STAR/Tensorflow
#!/usr/bin/make -f
+VENDOR ?= $(shell dpkg-vendor --query Vendor | tr [A-Z] [a-z])
+UBUNTU := $(shell cat /etc/os-release | grep "UBUNTU_CODENAME=" | sed "s|UBUNTU_CODENAME=||")
+
+
ARCH := $(shell arch)
CXXFLAGS = -Wno-sign-compare -Wno-unused-but-set-variable -Wno-format-security -Wno-format -fPIC
sed -i "s|ExternalProject_Add(\\(.*\\)$$|ExternalProject_add(\\1\\n\\tDOWNLOAD_COMMAND echo\\n\\tUPDATE_DISCONNECTED 1\\n|" tensorflow/contrib/cmake/external/*.cmake
- cd ${topdir}/build && cmake ../tensorflow/contrib/cmake -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=/usr/lib -DINCLUDE_INSTALL_DIR=/usr/include -Dtensorflow_ENABLE_SSL_SUPPORT=OFF -Dsystemlib_ZLIB=ON -Dsystemlib_GRPC=ON -Dsystemlib_PROTOBUF=ON
+ # GRPC > 1.12 supported from bionic. Disable it in xenial or lower.
+ # Controlled by tensorflow_ENABLE_GRPC_SUPPORT=ON/OFF
+ ifeq (${VENDOR},ubuntu)
+ ifeq (${UBUNTU},bionic)
+ cd ${topdir}/build && cmake ../tensorflow/contrib/cmake -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=/usr/lib -DINCLUDE_INSTALL_DIR=/usr/include -Dtensorflow_ENABLE_SSL_SUPPORT=OFF -Dsystemlib_ZLIB=ON -Dsystemlib_GRPC=ON -Dsystemlib_PROTOBUF=ON
+ else
+ cd ${topdir}/build && cmake ../tensorflow/contrib/cmake -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=/usr/lib -DINCLUDE_INSTALL_DIR=/usr/include -Dtensorflow_ENABLE_SSL_SUPPORT=OFF -Dsystemlib_ZLIB=ON -Dsystemlib_GRPC=ON -Dsystemlib_PROTOBUF=ON -Dtensorflow_ENABLE_GRPC_SUPPORT=OFF
+ endif
+ else
+ $(error This supports Ubuntu xenial/bionic only: ${VENDOR}/${UBUNTU})
+ endif
printf 'PWD=`pwd`\n' > temp.sh
printf 'for F in *.cmake ; do\n' >> temp.sh
install -d ${buildroot}
install -d ${buildroot}${_libdir}
+ mkdir -p ${buildroot}${_libdir}/python2.7
+ cp -R -p ${topdir}/build/tf_python* ${buildroot}${_libdir}/python2.7
+ touch ${buildroot}${_libdir}/python2.7/tf_python/__init__.py
+ install -p -m 0755 ${topdir}/build/*.so ${buildroot}${_libdir}
+
+ find tensorflow -name "*.h" -exec dirname {} \; | uniq | xargs -I {} mkdir ${buildroot}${_includedir}/${name}/{} -p
+ find tensorflow -name "*.h" -exec cp {} ${buildroot}${_includedir}/${name}/{} -aPv \;
+
+ find third_party/eigen3/ -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec dirname {} \; | uniq | xargs -I {} mkdir ${buildroot}${_includedir}/${name}/{} -p
+ find third_party/eigen3/ -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec cp {} ${buildroot}${_includedir}/${name}/{} -aPv \;
+
+ cd ${topdir}/build && find tensorflow -name "*.h" -exec dirname {} \; | uniq | xargs -I {} bash -c 'if [ ! -d ${buildroot}${_includedir}/${name}/{} ] ; then mkdir ${buildroot}${_includedir}/${name}/{} -p ; fi'
+ cd ${topdir}/build && find tensorflow -name "*.h" -exec cp {} ${buildroot}${_includedir}/${name}/{} -aPv \;
+
+ cd ${topdir}/build/ && cp -R -p eigen/src/eigen/Eigen ${buildroot}${_includedir}/${name}/
+ cd ${topdir}/build/ && cp -R -p eigen/src/eigen ${buildroot}${_includedir}/${name}/
+
+ cd ${topdir}/build/eigen/src/eigen && find . -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec dirname {} \; | uniq | xargs -I {} bash -c 'if [ ! -d ${buildroot}${_includedir}/${name}/third_party/eigen3/{} ] ; then mkdir ${buildroot}${_includedir}/${name}/third_party/eigen3/{} -p ; fi'
+ cd ${topdir}/build/eigen/src/eigen && find . -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec cp {} ${buildroot}${_includedir}/${name}/third_party/eigen3/{} -aPv \;
+
+ cd ${topdir}/build && cp -p nsync/install/include/*.h ${buildroot}${_includedir}/${name}/
+
+
install -d ${buildroot}${_libdir}/pkgconfig
install -d ${buildroot}${_includedir}/tensorflow/lite
install -d ${buildroot}${_includedir}/tensorflow/lite/kernels
install -m 0644 ${packagingdir}/${SOURCE4001} ${buildroot}${_libdir}/pkgconfig/tensorflow.pc
install -m 0644 ${packagingdir}/${SOURCE4002} ${buildroot}${_libdir}/pkgconfig/tensorflow-lite.pc
sed -i -e "s:@libdir@:${_libdir}:g" -e "s:@includedir@:${_includedir}:g" ${buildroot}${_libdir}/pkgconfig/tensorflow-lite.pc
- sed -i -e "s:@libdir@:${_libdir}:g" -e "s:@includedir@:${_includedir}:g" ${buildroot}${_libdir}/pkgconfig/tensorflow.pc
-
- mkdir -p ${buildroot}${_libdir}/python2.7
- cp -R -p ${topdir}/build/tf_python* ${buildroot}${_libdir}/python2.7
- touch ${buildroot}${_libdir}/python2.7/tf_python/__init__.py
- install -p -m 0755 ${topdir}/build/*.so ${buildroot}${_libdir}
- find tensorflow -name "*.h" -exec dirname {} \; | uniq | xargs -I {} mkdir ${buildroot}${_includedir}/${name}/{} -p
- find tensorflow -name "*.h" -exec cp {} ${buildroot}${_includedir}/${name}/{} -aPv \;
- find third_party/eigen3/ -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec dirname {} \; | uniq | xargs -I {} mkdir ${buildroot}${_includedir}/${name}/{} -p
- find third_party/eigen3/ -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec cp {} ${buildroot}${_includedir}/${name}/{} -aPv \;
-
- cd ${topdir}/build && find tensorflow -name "*.h" -exec dirname {} \; | uniq | xargs -I {} bash -c 'if [ ! -d ${buildroot}${_includedir}/${name}/{} ] ; then mkdir ${buildroot}${_includedir}/${name}/{} -p ; fi'
- cd ${topdir}/build && find tensorflow -name "*.h" -exec cp {} ${buildroot}${_includedir}/${name}/{} -aPv \;
-
- cd ${topdir}/build/protobuf/src/protobuf/src/ && find google -name "*.h" -exec dirname {} \; | uniq | xargs -I {} mkdir ${buildroot}${_includedir}/${name}/{} -p
- cd ${topdir}/build/protobuf/src/protobuf/src/ && find google -name "*.h" -exec cp {} ${buildroot}${_includedir}/${name}/{} -aPv \;
-
- cd ${topdir}/build/ && cp -R -p eigen/src/eigen/Eigen ${buildroot}${_includedir}/${name}/
- cd ${topdir}/build/ && cp -R -p eigen/src/eigen ${buildroot}${_includedir}/${name}/
-
- cd ${topdir}/build/protobuf/src/protobuf/src/ && find google -name "*.h" -exec dirname {} \; | uniq | xargs -I {} mkdir ${buildroot}${_includedir}/${name}/{} -p
- cd ${topdir}/build/protobuf/src/protobuf/src/ && find google -name "*.h" -exec cp {} ${buildroot}${_includedir}/${name}/{} -aPv \;
-
- cd ${topdir}/build/eigen/src/eigen && find . -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec dirname {} \; | uniq | xargs -I {} bash -c 'if [ ! -d ${buildroot}${_includedir}/${name}/third_party/eigen3/{} ] ; then mkdir ${buildroot}${_includedir}/${name}/third_party/eigen3/{} -p ; fi'
- cd ${topdir}/build/eigen/src/eigen && find . -type f ! -name '*.cc' ! -name '*.cpp' ! -name '*.c' -exec cp {} ${buildroot}${_includedir}/${name}/third_party/eigen3/{} -aPv \;
-
- cd ${topdir}/build && cp -p nsync/install/include/*.h ${buildroot}${_includedir}/${name}/
+ sed -i -e "s:@libdir@:${_libdir}:g" -e "s:@includedir@:${_includedir}/tensorflow:g" ${buildroot}${_libdir}/pkgconfig/tensorflow.pc
binary: build install