On 2010-03-27 Andreas Metzler <[email protected]> wrote:
> Sebastian Harl <tokkee <at> debian.org> writes:
[enblend/fuse 4.0]

>> Also, the new upstream release adds support for OpenMP, which sounds
>> kinda interesting to me. Anyway, as far as I understand the upstream
>> README, this does not seem to be optional at run-time. What do you guys
>> think about providing additional -openmp binaries?

> Sounds good. I would suggest to simply ship another binary in the
> deb instead of adding another package. For huge panos people still
> might need to use the nonmp version on multi-CPU systems because
> openmp and imagecache do not go together. 

Suggested patch attached.

This does not make huge improvement, as nona is already MP-aware, but
it is noticable. With a 5-image panorame I get

real    0m39.367s
user    0m58.640s
sys     0m1.560s

instead of

real    0m47.089s
user    1m1.008s
sys     0m1.300s

for the whole stitch process.
cu andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
>From b84e0dc6c6a3d918d85bf0689063e2f71dfbe7bc Mon Sep 17 00:00:00 2001
From: Andreas Metzler <[email protected]>
Date: Sun, 4 Apr 2010 12:54:59 +0200
Subject: [PATCH] Build with OpenMP support

Compile twice with and without OpenMP. OpenMP enabled binaries are
installed as enblend-mp/enfuse-mp.
---
 debian/changelog       |    2 ++
 debian/enblend.install |    1 +
 debian/enblend.links   |    1 +
 debian/enfuse.install  |    1 +
 debian/enfuse.links    |    1 +
 debian/rules           |   43 +++++++++++++++++++++++++++++++++----------
 6 files changed, 39 insertions(+), 10 deletions(-)
 create mode 100644 debian/enblend.links
 create mode 100644 debian/enfuse.links

diff --git a/debian/changelog b/debian/changelog
index 6ea1a9f..1b912d6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ enblend-enfuse (4.0+dfsg-1) experimental; urgency=low
   * [debian/rules] Don't try to install TODO - no longer shipped upstream.
   * focus-stacking.info is not installed as a separate file anymore.
   * Update build-depends by adding gnuplot transfig tidy ttf-freefont.
+  * Build/ship alternative binaries of enblend and enfuse binaries with OpenMP
+    support. They are installed as enblend-mp and enfuse-mp respectively.
 
   [ Sebastian Harl ]
   * debian/rules:
diff --git a/debian/enblend.install b/debian/enblend.install
index 8b18bc9..5977df9 100644
--- a/debian/enblend.install
+++ b/debian/enblend.install
@@ -1,4 +1,5 @@
 usr/bin/enblend
+usr/bin/enblend-mp
 usr/share/info/enblend.info
 usr/share/man/man1/enblend.1
 
diff --git a/debian/enblend.links b/debian/enblend.links
new file mode 100644
index 0000000..2b4f0d4
--- /dev/null
+++ b/debian/enblend.links
@@ -0,0 +1 @@
+usr/share/man/man1/enblend.1.gz usr/share/man/man1/enblend-mp.1.gz
diff --git a/debian/enfuse.install b/debian/enfuse.install
index a693dca..5d949a4 100644
--- a/debian/enfuse.install
+++ b/debian/enfuse.install
@@ -1,4 +1,5 @@
 usr/bin/enfuse
+usr/bin/enfuse-mp
 usr/share/info/enfuse.info
 usr/share/man/man1/enfuse.1
 
diff --git a/debian/enfuse.links b/debian/enfuse.links
new file mode 100644
index 0000000..e270120
--- /dev/null
+++ b/debian/enfuse.links
@@ -0,0 +1 @@
+usr/share/man/man1/enfuse.1.gz usr/share/man/man1/enfuse-mp.1.gz
diff --git a/debian/rules b/debian/rules
index 163f44d..7c382ef 100755
--- a/debian/rules
+++ b/debian/rules
@@ -19,28 +19,46 @@ else
 	CFLAGS += -O2
 endif
 
+CONFARGS=--host=$(DEB_HOST_GNU_TYPE) \
+		--build=$(DEB_BUILD_GNU_TYPE) \
+		--prefix=/usr --mandir=\$${prefix}/share/man \
+		--enable-gpu-support=yes \
+		--with-boost-filesystem=yes \
+		--with-openexr=yes
+
+#		--disable-openmp \
+#		--enable-image-cache=yes \
+
+
 get-orig-source:
 	dh_testdir
 	dh_testroot
 	chmod 755 debian/bin/uscan_repack.sh
 	uscan --verbose --force-download --rename
 
-config.status: configure
+# Hack: Since out of tree building of documentation is broken, make a out-tree
+# build for mp versions and in-tree build for the regular binaries. Out of tree
+# configure fails if in-tree configure run is detected, therefore force correct
+# ordering by making config.status depend on build-tree-mp/config.status.
+config.status: configure build-tree-mp/config.status
 	dh_testdir
-	CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
-		--build=$(DEB_BUILD_GNU_TYPE) \
-		--prefix=/usr --mandir=\$${prefix}/share/man \
-		--enable-gpu-support=yes \
+	CFLAGS="$(CFLAGS)" ./configure $(CONFARGS) \
 		--disable-openmp \
-		--enable-image-cache=yes \
-		--with-boost-filesystem=yes \
-		--with-openexr=yes
+		--enable-image-cache=yes
+
+build-tree-mp/config.status: configure
+	dh_testdir
+	if ! test -e build-tree-mp ; then mkdir build-tree-mp ; fi
+	cd build-tree-mp && CFLAGS="$(CFLAGS)" ../configure $(CONFARGS) \
+		--enable-openmp \
+		--disable-image-cache
 
 build: build-stamp
 
-build-stamp:  config.status
+build-stamp: config.status build-tree-mp/config.status
 	dh_testdir
 	
+	cd build-tree-mp && $(MAKE)
 	$(MAKE)
 	
 	touch build-stamp
@@ -52,10 +70,11 @@ clean:
 	
 	[ ! -f Makefile ] || $(MAKE) distclean
 	rm -f doc/*.info
+	rm -rf build-tree-mp
 	
 	dh_clean
 
-install: build
+install: build-stamp
 	dh_testdir
 	dh_testroot
 	dh_clean -k
@@ -63,6 +82,10 @@ install: build
 	
 	$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
 	rm -f $(CURDIR)/debian/tmp/usr/share/info/dir
+	install -m755  build-tree-mp/src/enblend \
+		$(CURDIR)/debian/tmp/usr/bin/enblend-mp
+	install -m755  build-tree-mp/src/enfuse \
+		$(CURDIR)/debian/tmp/usr/bin/enfuse-mp
 
 binary-indep:
 	# nothing to do here
-- 
1.6.5

_______________________________________________
Pkg-phototools-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-phototools-devel

Reply via email to