[caffe] 02/04: rules+install: build and install octave-caffe-cpu

Zhou Mo cdluminate-guest at moszumanska.debian.org
Thu Jun 30 16:14:29 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.

commit 8c4aa1271d4a6b24781068955e44172f8e5b2327
Author: Zhou Mo <cdluminate at gmail.com>
Date:   Thu Jun 30 16:13:35 2016 +0000

    rules+install: build and install octave-caffe-cpu
---
 debian/octave-caffe-cpu.install.in |  4 ++++
 debian/rules                       | 17 ++++++++++++-----
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/debian/octave-caffe-cpu.install.in b/debian/octave-caffe-cpu.install.in
new file mode 100644
index 0000000..826362d
--- /dev/null
+++ b/debian/octave-caffe-cpu.install.in
@@ -0,0 +1,4 @@
+matlab/+caffe/*.m           #MDIR#/caffe/
+matlab/+caffe/+test/*.m     #MDIR#/caffe/test/
+matlab/+caffe/private/*.m   #MDIR#/caffe/private/
+usr/matlab/caffe_.mex       #OCTDIR#/caffe/
diff --git a/debian/rules b/debian/rules
index ee97a84..4c821a2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -12,14 +12,13 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 RULES         := debian/rules
 ORIG_SOURCE   := "https://github.com/BVLC/caffe/archive/rc3.tar.gz"
 CAFFE_SOVER   := 1.0.0-rc3
-
 BUILDDIR      := "caffe_cpu_build"
-SUITE         := caffe-cpu libcaffe-cpu1 libcaffe-cpu-dev python3-caffe-cpu
-SUITE_P       := $(foreach PKG, $(SUITE), --package=$(PKG))
 
 TEMPLATES     := $(wildcard debian/*.in)
 AUTOGEN       := $(patsubst %.in,%,$(TEMPLATES))
 
+include /usr/share/octave/debian/defs.make
+
 ## CMake Configuration Template.
 ## * PLEASE sync this common template with caffe-contrib source.
 CMAKE_CONFIGURE_TEMPLATE = \
@@ -27,7 +26,7 @@ CMAKE_CONFIGURE_TEMPLATE = \
 	-DBLAS="Generic" \
 	-DBUILD_SHARED_LIBS=ON \
 	-DBUILD_docs=OFF \
-	-DBUILD_matlab=OFF \
+	-DBUILD_matlab=ON \
 	-DBUILD_python=ON \
 	-DBUILD_python_layer=ON \
 	-Dpython_version="3" \
@@ -42,6 +41,7 @@ CMAKE_CONFIGURE_TEMPLATE = \
 	-DUSE_OPENCV=ON \
 	-DCPU_ONLY=$(FILL_THIS_BLANK) \
 	-DCMAKE_INSTALL_PREFIX="/usr"
+# These flags are for cuda version but please keep them
 #	-DCUDA_ARCH_NAME="All"
 #	-DCMAKE_CXX_COMPILER=g++-5
 #	-DCMAKE_C_COMPILER=gcc-5
@@ -55,6 +55,8 @@ CONFFLAG_CPU = \
 	-e 's{#CAFFE_CONFIGURE#}{caffe_cpu}g;' \
 	-e 's{#CAFFE_SOVER#}{$(CAFFE_SOVER)}g;' \
 	-e 's{#DEB_HOST_MULTIARCH#}{$(DEB_HOST_MULTIARCH)}g;' \
+	-e 's{#MDIR#}{$(MDIR)}g;' \
+	-e 's{#OCTDIR#}{$(OCTDIR)};g' \
 	< $< > $@
 
 %:
@@ -89,7 +91,12 @@ override_dh_auto_build-indep:
 
 override_dh_auto_build-arch:
 	dh_auto_build --builddirectory=$(BUILDDIR) \
-		-- all caffe pycaffe test.testbin
+		-- caffe pycaffe
+	# remove -fPIE flag or mkoctfile will fail.
+	dh_auto_build --builddirectory=$(BUILDDIR) \
+		-- octave CXXFLAGS="$(filter-out -fPIE,$(CXXFLAGS))"
+	dh_auto_build --builddirectory=$(BUILDDIR) \
+		-- test.testbin all
 
 # In the test phase, we need to set LD_LIBRARY_PATH properly
 # for those test ELFs linked with libcaffe.so.X

-- 
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