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, libc6-dev-i386, unzip
-Standards-Version: 1.9.0_rc1
+Build-Depends: debhelper (>=9), sed, zlib1g-dev, cmake (>=3.9), python, git, python-numpy, swig, python-dev, libc6-dev, unzip
+Standards-Version: 1.9.0_rc2
Homepage: https://github.sec.samsung.net/RS7-STAR/Tensorflow
Package: tensorflow-dev
-Architecture: any
+Architecture: arm64 amd64
Depends: ${shlibs:Depends}
Description: Tensorflow development headers and object file
This package contains the Tensorflow development header and
#!/usr/bin/make -f
-ARCH := $(shell arch)
-
-CXXFLAGS = -Wno-sign-compare -Wno-unused-but-set-variable -Wno-format-security -Wno-format -fPIC
-CFLAGS = -Wno-sign-compare -Wno-unused-but-set-variable -Wno-format-security -Wno-format -fPIC
+DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
+
+ifeq ($(DEB_HOST_ARCH), arm64)
+ TENSORFLOW_BUILD := yes
+else ifeq ($(DEB_HOST_ARCH), amd64)
+ TENSORFLOW_BUILD := yes
+else
+ TENSORFLOW_BUILD := no
+endif
+
+CXXFLAGS = -Wno-sign-compare -Wno-unused-but-set-variable -Wno-format-security -Wno-format -fPIC --std=c++11
+CFLAGS = -Wno-sign-compare -Wno-unused-but-set-variable -Wno-format-security -Wno-format -fPIC --std=c++11
+
+ifeq ($(DEB_HOST_ARCH), arm64)
+ CXXFLAGS += -DARM_NON_MOBILE -ftree-vectorize
+ CFLAGS += -DARM_NON_MOBILE -ftree-vectorize
+else ifeq ($(DEB_HOST_ARCH), armhf)
+ CXXFLAGS += -DARM_NON_MOBILE -mfpu=neon-vfpv4 -std=gnu11 -ftree-vectorize -fomit-frame-pointer
+ CFLAGS += -DARM_NON_MOBILE -mfpu=neon-vfpv4 -std=gnu11 -ftree-vectorize -fomit-frame-pointer
+endif
name=tensorflow
topdir=$(shell pwd)
build:
dh_testdir
+ifeq ($(TENSORFLOW_BUILD), yes)
patch -p0 < ${packagingdir}/${SOURCE5001}
cp ${packagingdir}/${SOURCE4001} ${topdir}/tensorflow/contrib/cmake/
mkdir -p ${topdir}/build
cd ${topdir}/build/CMakeFiles/pywrap_tensorflow_internal.dir && ${topdir}/temp.sh
cd ${topdir}/build && make
+endif
+ifeq ($(DEB_HOST_ARCH), arm64)
+ make -f tensorflow/contrib/lite/Makefile TARGET=TIZEN OS=LINUX TIZEN_CXXFLAGS="${CXXFLAGS} -D__ARM_NEON" TIZEN_CFLAGS="${CFLAGS} -D__ARM_NEON"
+else ifeq ($(DEB_HOST_ARCH), armhf)
+ make -f tensorflow/contrib/lite/Makefile TARGET=TIZEN OS=LINUX TIZEN_CXXFLAGS="${CXXFLAGS} -D__ARM_NEON" TIZEN_CFLAGS="${CFLAGS} -D__ARM_NEON"
+else
make -f tensorflow/contrib/lite/Makefile TARGET=TIZEN OS=LINUX TIZEN_CXXFLAGS="${CXXFLAGS}" TIZEN_CFLAGS="${CFLAGS}"
+endif
install: build
dh_testdir
install -m 0644 tensorflow/contrib/lite/downloads/flatbuffers/include/flatbuffers/*.h ${buildroot}${_includedir}/flatbuffers
install -m 0644 tensorflow/contrib/lite/tensorflow-lite.pc.in ${buildroot}${_libdir}/pkgconfig/tensorflow-lite.pc
+ifeq ($(TENSORFLOW_BUILD), yes)
# Make pkgconfig file
sed -i -e "s:@libdir@:${_libdir}:g" -e "s:@includedir@:${_includedir}:g" ${buildroot}${_libdir}/pkgconfig/tensorflow-lite.pc
cd ${topdir}/build && cp -p nsync/install/include/*.h ${buildroot}${_includedir}/${name}/
cd ${topdir}/build && cp -p tensorflow.pc ${buildroot}${_libdir}/pkgconfig/
+endif
+
+binary-indep: build install
+ # nothing to do by default
-binary: build install
+binary-arch: build install
dh_testdir
dh_testroot
dh_installdocs
dh_md5sums
dh_builddeb
+binary: binary-arch binary-indep
+
clean:
dh_testdir
dh_testroot