deb: Update rules file for launchpad.net build 16/203516/1
authorSangjung Woo <sangjung.woo@samsung.com>
Mon, 15 Oct 2018 01:32:58 +0000 (10:32 +0900)
committerSangjung Woo <sangjung.woo@samsung.com>
Mon, 15 Apr 2019 11:03:04 +0000 (20:03 +0900)
* Update rules file for launchpad.net build (armv7l, aarch64)
* Remove unnecessary arch dependency in control file

Change-Id: Ib3567ba6f2013591e69068ddd9b81158ba74a909
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
debian/control
debian/rules

index 33b35bfd1f4c6c6cedcb747eda54229e44871596..40fc95b081a485c69d8c669ec0409839fae39cf3 100644 (file)
@@ -2,12 +2,12 @@ Source: tensorflow
 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
index ad93098c24bd350983c590eba23df5f253b0c9ff..2ff364189f85d279406965ab4f71c08148243024 100755 (executable)
@@ -1,9 +1,25 @@
 #!/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)
@@ -36,6 +52,7 @@ SOURCE5001=tf_core_framework_patch.txt
 
 build:
        dh_testdir
+ifeq ($(TENSORFLOW_BUILD), yes)
        patch -p0 < ${packagingdir}/${SOURCE5001}
        cp ${packagingdir}/${SOURCE4001} ${topdir}/tensorflow/contrib/cmake/
        mkdir -p ${topdir}/build
@@ -131,8 +148,15 @@ 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
@@ -157,6 +181,7 @@ install: build
        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
 
@@ -187,8 +212,12 @@ install: build
        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
@@ -198,6 +227,8 @@ binary: build install
        dh_md5sums
        dh_builddeb
 
+binary: binary-arch binary-indep
+
 clean:
        dh_testdir
        dh_testroot