[caffe-contrib] 293/362: rules: refresh custom target

Zhou Mo cdluminate-guest at moszumanska.debian.org
Tue May 3 09:24:46 UTC 2016


This is an automated email from the git hooks/post-receive script.

cdluminate-guest pushed a commit to branch master
in repository caffe-contrib.

commit fd6589396cbbbf4ccb0f69d9caca0c8cef2a4e3d
Author: Zhou Mo <cdluminate at gmail.com>
Date:   Wed Mar 9 08:32:11 2016 +0000

    rules: refresh custom target
---
 debian/rules | 72 +++++++++++++++++++++---------------------------------------
 1 file changed, 25 insertions(+), 47 deletions(-)

diff --git a/debian/rules b/debian/rules
index dc72dcc..513eb13 100755
--- a/debian/rules
+++ b/debian/rules
@@ -162,52 +162,29 @@ get-orig-source:
 	wget -c $(ORIG_SOURCE) -O caffe_1.0.0~rc3.orig.tar.gz
 
 #### BEGIN: CUSTOM TARGETS ############################################
-#
-# NOTICE: FOLLOWING IS ABSOLUTELY UNRELATED TO THE STANDARD
-#         DPKG-BUILDPACKAGE PROCESS.
-#
-# Since the Distributed Binary Caffe can not play the best performance
-# of user's machines, it's good to provide a custom build target,
-# allowing users to build their locally performance-optimized packages.
-
+##
+## NOTICE: THIS PART IS UNRELATED TO OFFICIAL PACKAGE BUILD PROCESS
+##
+## The program performance of Caffe may be boosted up a bit, after
+## building the packages locally, but not sure how much it would be.
+## 
+## For the custom build instruction please see README.Debian
+##
 CUSTOM_JOBS   := "-j5" # number of cores plus 1
-CONFFLAG_CPU_CUSTOM = \
-	-DBLAS="Open" \
-	-DCMAKE_SKIP_RPATH=TRUE \
+CONFFLAG_CPU_CUSTOM = $(CMAKE_CONFIGURE_TEMPLATE) \
+	-DCMAKE_CXX_COMPILER=g++ \
+	-DCMAKE_C_COMPILER=gcc \
+	-DCMAKE_INSTALL_PREFIX="/caffe_cpu" \
 	-DCPU_ONLY=ON \
-	-DUSE_CUDNN=OFF \
-	-DBUILD_SHARED_LIBS=ON \
-	-DBUILD_python=ON \
-	-Dpython_version="2" \
-	-DBUILD_matlab=OFF \
-	-DBUILD_docs=OFF \
-	-DBUILD_python_layer=ON \
-	-DCMAKE_VERBOSE_MAKEFILE=OFF \
-	-DCMAKE_BUILD_TYPE="Release" \
-	-DCMAKE_CXX_FLAGS+="-mtune=native" \
-	-DCMAKE_INSTALL_PREFIX="/caffe_cpu"
-CONFFLAG_CUDA_CUSTOM = \
-	-DBLAS="Open" \
-	-DCMAKE_SKIP_RPATH=TRUE \
-	-DCPU_ONLY=OFF \
-	-DUSE_CUDNN=OFF \
-	-DBUILD_SHARED_LIBS=ON \
-	-DBUILD_python=ON \
-	-Dpython_version="2" \
-	-DBUILD_matlab=OFF \
-	-DBUILD_docs=OFF \
-	-DBUILD_python_layer=ON \
-	-DCMAKE_VERBOSE_MAKEFILE=OFF \
-	-DCUDA_ARCH_NAME="All" \
+CONFFLAG_CUDA_CUSTOM = $(CMAKE_CONFIGURE_TEMPLATE) \
 	-DCMAKE_CXX_COMPILER=g++-5 \
 	-DCMAKE_C_COMPILER=gcc-5 \
-	-DCMAKE_BUILD_TYPE="Release" \
-	-DCMAKE_CXX_FLAGS+="-mtune=native" \
-	-DCMAKE_INSTALL_PREFIX="/caffe_cuda"
-
+	-DCMAKE_INSTALL_PREFIX="/caffe_cuda" \
+	-DCPU_ONLY=OFF
+#
 .PHONY: custom-cpu custom-cuda
 custom-cpu:
-	dch --local='+custom' "Custom build for caffe-cpu packages, `uname -a`"
+	dch --local='+custom' "Local custom build of caffe-cpu packages. `uname -a`"
 	dpkg-source --after-build ./
 	dpkg-source --before-build ./
 	dh_auto_clean --builddirectory=${CAFFE_CPU_BUILDDIR}
@@ -216,16 +193,16 @@ custom-cpu:
 			-DCMAKE_INSTALL_PREFIX="$(shell pwd)/debian/tmp/caffe_cpu" ..
 	dh_auto_build --builddirectory=${CAFFE_CPU_BUILDDIR} -- $(CUSTOM_JOBS) \
 			all caffe pycaffe test.testbin
+	# For Caffe's CPU-ONLY version it should not fail.
 	dh_auto_test --builddirectory=${CAFFE_CPU_BUILDDIR} \
 		-- runtest LD_LIBRARY_PATH=${CAFFE_CPU_BUILDDIR}/lib/ 
-	#dh_auto_install --builddirectory=${CAFFE_CPU_BUILDDIR} \
-	#		-- install
+	dh_auto_install --builddirectory=${CAFFE_CPU_BUILDDIR} -- install
 	cd ${CAFFE_CPU_BUILDDIR}; cmake -DCMAKE_INSTALL_CONFIG_NAME="Release" \
 		-P cmake_install.cmake
-	$(RM) debian/*.symbols
+	-$(RM) debian/*.symbols
 	fakeroot dh binary $(SUITE_CPU_P)
 custom-cuda:
-	dch --local='+custom' "Custom build for caffe-cuda packages, `uname -a`"
+	dch --local='+custom' "Local custom build of caffe-cuda packages. `uname -a`"
 	dpkg-source --after-build ./
 	dpkg-source --before-build ./
 	dh_auto_clean --builddirectory=${CAFFE_CUDA_BUILDDIR}
@@ -234,12 +211,13 @@ custom-cuda:
 			-DCMAKE_INSTALL_PREFIX="$(shell pwd)/debian/tmp/caffe_cuda" ..
 	dh_auto_build --builddirectory=${CAFFE_CUDA_BUILDDIR} -- $(CUSTOM_JOBS) \
 			all caffe pycaffe test.testbin
+	# note the '-' sign, some amd64 build machines have no GPU,
+	# so this test is allowed to fail.
 	-dh_auto_test --builddirectory=${CAFFE_CUDA_BUILDDIR} \
 		-- runtest LD_LIBRARY_PATH=${CAFFE_CUDA_BUILDDIR}/lib/ 
-	dh_auto_install --builddirectory=${CAFFE_CUDA_BUILDDIR} \
-		-- install
+	dh_auto_install --builddirectory=${CAFFE_CUDA_BUILDDIR} -- install
 	cd ${CAFFE_CUDA_BUILDDIR}; cmake -DCMAKE_INSTALL_CONFIG_NAME="Release" \
 		-P cmake_install.cmake
-	$(RM) debian/*.symbols
+	-$(RM) debian/*.symbols
 	fakeroot dh binary $(SUITE_CUDA_P)
 #### END: CUSTOM TARGETS ##############################################

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/caffe-contrib.git



More information about the debian-science-commits mailing list