[caffe] 62/249: rules, cmake: change cmake and use cmake

Zhou Mo cdluminate-guest at moszumanska.debian.org
Tue Mar 8 14:51:19 UTC 2016


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

cdluminate-guest pushed a commit to branch debian/experimental
in repository caffe.

commit 815e791d9e4a073d85ec3e29e30dfe16c7a37f09
Author: Zhou Mo <cdluminate at gmail.com>
Date:   Fri Aug 7 11:58:52 2015 +0000

    rules, cmake: change cmake and use cmake
---
 ...ake-add-target-property-version-soversion.patch | 14 ++++
 debian/patches/series                              |  1 +
 debian/rules                                       | 78 +++++++++++++---------
 3 files changed, 62 insertions(+), 31 deletions(-)

diff --git a/debian/patches/fix-cmake-add-target-property-version-soversion.patch b/debian/patches/fix-cmake-add-target-property-version-soversion.patch
new file mode 100644
index 0000000..f3d3f95
--- /dev/null
+++ b/debian/patches/fix-cmake-add-target-property-version-soversion.patch
@@ -0,0 +1,14 @@
+--- a/cmake/Targets.cmake
++++ b/cmake/Targets.cmake
+@@ -109,7 +109,10 @@
+     DEBUG_POSTFIX ${Caffe_DEBUG_POSTFIX}
+     ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
+     LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib"
+-    RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
++    RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin"
++    VERSION "${DEBIAN_TARGET_VERSION}"
++    SOVERSION "${DEBIAN_TARGET_SOVERSION}"
++	)
+   # make sure we build all external depepdencies first
+   if (DEFINED external_project_dependencies)
+     add_dependencies(${target} ${external_project_dependencies})
diff --git a/debian/patches/series b/debian/patches/series
index 03ae041..6e24dd4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+fix-cmake-add-target-property-version-soversion.patch
 00-fix-include-path-for-debian.patch
 01-fix-makefile-rpath-and-soname.patch
 02-empty-the-gitignore
diff --git a/debian/rules b/debian/rules
index 6f125a5..e95087e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,50 +5,66 @@ export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 
 RULES  := debian/rules
-CONFIG := debian/config/Makefile.config
+#CONFIG := debian/config/Makefile.config
+export DEBIAN_TARGET_VERSION="0" \
+export DEBIAN_TARGET_SOVERSION="0" 
+
 
 # TODO: bump build system from Make to Cmake
 
 %:
-	dh $@ --parallel
+	dh $@ --parallel \
+	      --buildsystem=cmake
 
-# this part if for the Make build system.   
+override_dh_auto_configure:
+	# This configure is for CPU only caffe
+	dh_auto_configure -- \
+		-DCPU_ONLY=ON \
+		-DUSE_CUDNN=OFF \
+		-DBUILD_SHARED_LIBS=ON \
+		-DBUILD_python=ON \
+		-Dpython_version="2" \
+		-DBUILD_matlab=OFF \
+		-DBUILD_docs=ON \
+		-DBUILD_python_layer=ON \
+	# this part if for the Make build system.   
 # The Makefile of upstream checks the file  
 # Makefile.config before every action,      
 # even the 'clean'                          
-.PHONY: config rmconfig                     
-config:                                     
-	cp $(CONFIG) ./                         
-rmconfig:                                   
-	-rm Makefile.config                     
-
-override_dh_auto_clean: config
-	# we need a config file before `make clean`
-	dh_auto_clean
-	# debhelper will complain if there is a Makefile.config which
-	# is considered "dirty", so delete it
-	$(RULES) rmconfig
-
-override_dh_auto_build: config
-	dh_auto_build -- all pycaffe distribute
-	$(RULES) rmconfig
+#.PHONY: config rmconfig                     
+#config:                                     
+#	cp $(CONFIG) ./                         
+#rmconfig:                                   
+#	-rm Makefile.config                     
+
+#override_dh_auto_clean: config
+#	# we need a config file before `make clean`
+#	dh_auto_clean
+#	# debhelper will complain if there is a Makefile.config which
+#	# is considered "dirty", so delete it
+#	$(RULES) rmconfig
+
+#override_dh_auto_build: config
+#	dh_auto_build -- all pycaffe distribute
+#	$(RULES) rmconfig
 
 # In the test phase, we need to set LD_LIBRARY_PATH properly
 # for those test ELFs linked with libcaffe.so.X
-override_dh_auto_test: config
+#override_dh_auto_test: config
+override_dh_auto_test: 
 	dh_auto_test -- test # compile test excutables 
-	dh_auto_test -- runtest LD_LIBRARY_PATH=.build_release/lib/ 
+	dh_auto_test -- runtest LD_LIBRARY_PATH=obj-x86_64-linux-gnu/lib/ 
 
 # 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 local performance-optimized packages.
-# TODO: let the custom target use CMake?
-.PHONY: custom
-custom:
-	# this custom target is inspired by openblas's rules.
-	if [ ! -e debian/custom/Makefile.config ]; then \
-	printf "E: please put your Makefile.config into debian/custom/\n"; false; \
-	fi
-	cp debian/custom/Makefile.config ./
-	dch --local='+custom' "Custom build on `uname -a`"
-	LANG=C $(RULES) TARGET=custom build binary
+# TODO: fix this custom target with CMake
+#.PHONY: custom
+#custom:
+#	# this custom target is inspired by openblas's rules.
+#	if [ ! -e debian/custom/Makefile.config ]; then \
+#	printf "E: please put your Makefile.config into debian/custom/\n"; false; \
+#	fi
+#	cp debian/custom/Makefile.config ./
+#	dch --local='+custom' "Custom build on `uname -a`"
+#	LANG=C $(RULES) TARGET=custom build binary

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



More information about the debian-science-commits mailing list