On Wed, 2008-07-16 at 13:42 -0400, Adam C Powell IV wrote:
> Package: blacs-mpi
> Version: 1.1-28
> Severity: wishlist
> 
> Greetings,
> 
> Please add OpenMPI to the existing LAM and MPICH builds for blacs-mpi.
> As you may know, LAM is deprecated in favor of OpenMPI, so this will be
> a prominent MPI implementation moving forward.
> 
> I would be happy to provide a patch if needed.

Okay, so, I got impatient, and went ahead and made a patch, which is
attached.  The "if [ -e ... ]" in the openmpi target is to make sure it
skips those parts on arches which don't have openmpi.

The one problem is: the openmpi test package depends on liblam4.
Perhaps the MPI=openmpi bit doesn't quite work in the TESTING dir?

The packages install fine, and have about the same contents as the -lam
and -mpich packages.  I haven't run the tests yet.

Cheers,
-Adam
-- 
GPG fingerprint: D54D 1AEE B11C CE9B A02B  C5DD 526F 01E8 564E E4B6

Engineering consulting with open source tools
http://www.opennovation.com/
diff -urN blacs-mpi-1.1-28/debian/blacs1gf-openmpi.dirs blacs-mpi-1.1/debian/blacs1gf-openmpi.dirs
--- blacs-mpi-1.1-28/debian/blacs1gf-openmpi.dirs	1969-12-31 19:00:00.000000000 -0500
+++ blacs-mpi-1.1/debian/blacs1gf-openmpi.dirs	2008-07-16 15:39:52.000000000 -0400
@@ -0,0 +1 @@
+usr/lib
diff -urN blacs-mpi-1.1-28/debian/blacs1gf-openmpi.links blacs-mpi-1.1/debian/blacs1gf-openmpi.links
--- blacs-mpi-1.1-28/debian/blacs1gf-openmpi.links	1969-12-31 19:00:00.000000000 -0500
+++ blacs-mpi-1.1/debian/blacs1gf-openmpi.links	2008-07-16 15:39:52.000000000 -0400
@@ -0,0 +1,3 @@
+usr/lib/libblacs-openmpi.so.1.1		usr/lib/libblacs-openmpi.so.1
+usr/lib/libblacsF77init-openmpi.so.1.1	usr/lib/libblacsF77init-openmpi.so.1
+usr/lib/libblacsCinit-openmpi.so.1.1	usr/lib/libblacsCinit-openmpi.so.1
diff -urN blacs-mpi-1.1-28/debian/blacs1gf-openmpi.postinst blacs-mpi-1.1/debian/blacs1gf-openmpi.postinst
--- blacs-mpi-1.1-28/debian/blacs1gf-openmpi.postinst	1969-12-31 19:00:00.000000000 -0500
+++ blacs-mpi-1.1/debian/blacs1gf-openmpi.postinst	2008-07-16 15:39:52.000000000 -0400
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = "configure" ]; then
+        ldconfig
+fi
+
+#DEBHELPER#
diff -urN blacs-mpi-1.1-28/debian/blacs1gf-openmpi.shlibs blacs-mpi-1.1/debian/blacs1gf-openmpi.shlibs
--- blacs-mpi-1.1-28/debian/blacs1gf-openmpi.shlibs	1969-12-31 19:00:00.000000000 -0500
+++ blacs-mpi-1.1/debian/blacs1gf-openmpi.shlibs	2008-07-16 15:39:52.000000000 -0400
@@ -0,0 +1,3 @@
+libblacs-openmpi 1 blacs1gf-openmpi (>= 1.1-28)
+libblacsF77init-openmpi 1 blacs1gf-openmpi (>= 1.1-28)
+libblacsCinit-openmpi 1 blacs1gf-openmpi (>= 1.1-28)
diff -urN blacs-mpi-1.1-28/debian/blacsgf-openmpi-dev.dirs blacs-mpi-1.1/debian/blacsgf-openmpi-dev.dirs
--- blacs-mpi-1.1-28/debian/blacsgf-openmpi-dev.dirs	1969-12-31 19:00:00.000000000 -0500
+++ blacs-mpi-1.1/debian/blacsgf-openmpi-dev.dirs	2008-07-16 15:39:52.000000000 -0400
@@ -0,0 +1 @@
+usr/lib
diff -urN blacs-mpi-1.1-28/debian/blacsgf-openmpi-dev.links blacs-mpi-1.1/debian/blacsgf-openmpi-dev.links
--- blacs-mpi-1.1-28/debian/blacsgf-openmpi-dev.links	1969-12-31 19:00:00.000000000 -0500
+++ blacs-mpi-1.1/debian/blacsgf-openmpi-dev.links	2008-07-16 15:39:52.000000000 -0400
@@ -0,0 +1,3 @@
+usr/lib/libblacs-openmpi.so.1		usr/lib/libblacs-openmpi.so
+usr/lib/libblacsF77init-openmpi.so.1	usr/lib/libblacsF77init-openmpi.so
+usr/lib/libblacsCinit-openmpi.so.1	usr/lib/libblacsCinit-openmpi.so
diff -urN blacs-mpi-1.1-28/debian/blacsgf-openmpi-test.dirs blacs-mpi-1.1/debian/blacsgf-openmpi-test.dirs
--- blacs-mpi-1.1-28/debian/blacsgf-openmpi-test.dirs	1969-12-31 19:00:00.000000000 -0500
+++ blacs-mpi-1.1/debian/blacsgf-openmpi-test.dirs	2008-07-16 15:39:52.000000000 -0400
@@ -0,0 +1 @@
+usr/lib/blacs
diff -urN blacs-mpi-1.1-28/debian/blacsgf-openmpi-test.README.Debian blacs-mpi-1.1/debian/blacsgf-openmpi-test.README.Debian
--- blacs-mpi-1.1-28/debian/blacsgf-openmpi-test.README.Debian	1969-12-31 19:00:00.000000000 -0500
+++ blacs-mpi-1.1/debian/blacsgf-openmpi-test.README.Debian	2008-07-16 15:39:52.000000000 -0400
@@ -0,0 +1,6 @@
+You can run the tester applications from /usr/lib/blacs:
+
+$ cd /usr/lib/blacs
+$ mpirun -np 4 cblacs_test_shared-openmpi
+
+etc.
diff -urN blacs-mpi-1.1-28/debian/changelog blacs-mpi-1.1/debian/changelog
--- blacs-mpi-1.1-28/debian/changelog	2008-07-16 15:39:29.000000000 -0400
+++ blacs-mpi-1.1/debian/changelog	2008-07-16 15:40:27.000000000 -0400
@@ -1,3 +1,9 @@
+blacs-mpi (1.1-29) unstable; urgency=low
+
+  * Added OpenMPI build (closes: #491105).  Thanks to Adam Powell
+
+ -- 
+
 blacs-mpi (1.1-28) unstable; urgency=low
 
   * The package now Build-Depends on Gfortran.
diff -urN blacs-mpi-1.1-28/debian/control blacs-mpi-1.1/debian/control
--- blacs-mpi-1.1-28/debian/control	2008-07-16 15:39:29.000000000 -0400
+++ blacs-mpi-1.1/debian/control	2008-07-16 15:39:52.000000000 -0400
@@ -3,7 +3,7 @@
 Priority: extra
 Maintainer: Muammar El Khatib <[EMAIL PROTECTED]>
 Standards-Version: 3.7.3
-Build-Depends: debhelper (>= 4), lam4-dev (>= 7.1.2-1.2), libmpich1.0-dev (>= 1.2.7-7), gfortran
+Build-Depends: debhelper (>= 4), libopenmpi-dev (>= 1.2.4-5) [i386 amd64 alpha ia64 powerpc sparc], lam4-dev (>= 7.1.2-1.2), libmpich1.0-dev (>= 1.2.7-7), gfortran
 Homepage: http://www.netlib.org/blacs/
 
 Package: blacs1gf-mpich
@@ -148,6 +148,71 @@
  communications library for ScaLAPACK. ScaLAPACK is a parallel version of
  LAPACK and is used on Beowulf type clusters.
 
+Package: blacs1gf-openmpi
+Section: libs
+Architecture: i386 amd64 alpha ia64 powerpc sparc
+Depends: libopenmpi1, ${shlibs:Depends}
+Description: Basic Linear Algebra Comm. Subprograms - Shared libs. for OpenMPI
+ The BLACS project is an ongoing investigation whose purpose is to
+ create a linear algebra oriented message passing interface that may be
+ implemented efficiently and uniformly across a large range of
+ distributed memory platforms.
+ .
+ You can choose between an implementation based on MPI or PVM. This
+ package uses MPI.
+ .
+ The package is available for LAM and MPICH. This package uses OpenMPI. There
+ are packages for the shared libraries (this one), for the static
+ libraries and the development files and for test programs.
+ .
+ Most users do not need to install this package directly because it is
+ used as a high level driver for the communication in the ScaLAPACK packages.
+ Therefore, it is installed when installing ScaLAPACK. ScaLAPACK is a
+ parallel version of LAPACK and is used on Beowulf type clusters.
+
+Package: blacsgf-openmpi-dev
+Architecture: i386 amd64 alpha ia64 powerpc sparc
+Depends: blacs1gf-openmpi (= ${binary:Version}), libopenmpi-dev, ${shlibs:Depends}
+Description: Basic Linear Algebra Comm. Subprograms - Dev. files for OpenMPI
+ The BLACS project is an ongoing investigation whose purpose is to
+ create a linear algebra oriented message passing interface that may be
+ implemented efficiently and uniformly across a large range of
+ distributed memory platforms.
+ .
+ You can choose between an implementation based on MPI or PVM. This
+ package uses MPI.
+ .
+ The package is available for LAM and MPICH. This package uses OpenMPI. There
+ are packages for the shared libraries, for the static libraries and the
+ development files (this one) and for test programs.
+ .
+ Most users do not need to install this package directly because it is
+ used as a high level driver for the communication in the ScaLAPACK packages.
+ Therefore, it is installed when installing ScaLAPACK. ScaLAPACK is a
+ parallel version of LAPACK and is used on Beowulf type clusters.
+
+Package: blacsgf-openmpi-test
+Architecture: i386 amd64 alpha ia64 powerpc sparc
+Depends: openmpi-bin, blacsgf-test-common, ${shlibs:Depends}
+Description: Basic Linear Algebra Comm. Subprograms - Test files for OpenMPI
+ The BLACS project is an ongoing investigation whose purpose is to
+ create a linear algebra oriented message passing interface that may be
+ implemented efficiently and uniformly across a large range of
+ distributed memory platforms.
+ .
+ You can choose between an implementation based on MPI or PVM. This
+ package uses MPI.
+ .
+ The package is available for LAM and MPICH. This package uses OpenMPI. There
+ are packages for the shared libraries, for the static libraries and the
+ development files and for test programs (this one).
+ .
+ Most users do not need to install this package directly because it contains
+ test programs for the BLACS libraries. You only need these if you experience
+ problems with ScaLAPACK. The BLACS libraries are used as a high level
+ communications library for ScaLAPACK. ScaLAPACK is a parallel version of
+ LAPACK and is used on Beowulf type clusters.
+
 Package: blacsgf-test-common
 Architecture: all
 Replaces: blacs-test-common
@@ -159,7 +224,8 @@
  distributed memory platforms.
  .
  You can choose between an implementation based on MPI or PVM. This packages
- provides test data for all BLACS packages (MPICH, LAM and PVM versions).
+ provides test data for all BLACS packages (MPICH, LAM, OpenMPI and PVM
+ versions).
  .
  Most users do not need to install this package directly because it is
  installed when installing the test programs for any BLACS package.
diff -urN blacs-mpi-1.1-28/debian/rules blacs-mpi-1.1/debian/rules
--- blacs-mpi-1.1-28/debian/rules	2008-07-16 15:39:29.000000000 -0400
+++ blacs-mpi-1.1/debian/rules	2008-07-16 15:39:52.000000000 -0400
@@ -5,15 +5,54 @@
 
 topdir=$(shell pwd)
 
+export openmpiPACKAGES=-pblacs1gf-openmpi -pblacsgf-openmpi-dev -pblacsgf-openmpi-test
 export lamPACKAGES=-pblacs1gf-lam -pblacsgf-lam-dev -pblacsgf-lam-test
 export mpichPACKAGES=-pblacs1gf-mpich -pblacsgf-mpich-dev -pblacsgf-mpich-test
 
-build: build-lam build-mpich
+build: build-openmpi build-lam build-mpich
+
+build-openmpi: build-stamp-openmpi
 
 build-lam: build-stamp-lam
 
 build-mpich: build-stamp-mpich
 
+build-stamp-openmpi:
+	dh_testdir
+	if [ -e /usr/lib/openmpi/include/mpi.h ]; then \
+	[ -d TESTING/EXE ] || mkdir TESTING/EXE; \
+	BASEDIR=$(topdir) MPI=openmpi make mpi; \
+	cd TESTING && BASEDIR=$(topdir) \
+	  BTLIBS='$$(BLACSFINIT) $$(BLACSLIB) $$(BLACSFINIT) $$(MPILIB)' \
+	  BUILD=static MPI=openmpi make; \
+	cd $(topdir); \
+	BASEDIR=$(topdir) make cleanall; \
+	cd TESTING && BASEDIR=$(topdir) make clean; \
+	cd $(topdir); \
+	BASEDIR=$(topdir) FPIC=-fPIC MPI=openmpi make mpi; \
+	mkdir -p tmp; \
+	set -e ;\
+	for i in blacs blacsF77init blacsCinit ; do \
+	  cd tmp ;\
+	  ar x ../LIB/$${i}_MPI-LINUX-0.a ;\
+	  mkdir -p tmp ;\
+	  for j in $$(find -name "*.C") ;\
+	    do mv $$j tmp/$$(echo $$j | sed 's,C$$,o,g') ;\
+	  done;\
+	  cd .. ;\
+	  gcc -shared -Wl,-soname=lib$$i-openmpi.so.1 -o lib$$i-openmpi.so.1.1 \
+	    $$(find tmp -name "*.o");\
+	  ln -fs lib$$i-openmpi.so.1.1 lib$$i-openmpi.so.1 ;\
+	  ln -fs lib$$i-openmpi.so.1 lib$$i-openmpi.so ;\
+	  rm -f tmp/tmp/* ; rmdir tmp/tmp ; rm tmp/* ;\
+	done; \
+	rmdir tmp; \
+	cd TESTING && BASEDIR=$(topdir) \
+	  BTLIBS='-L.. -lblacsF77init-openmpi -lblacs-openmpi -lblacsF77init-openmpi $$(MPILIB)' \
+	  BUILD=shared MPI=openmpi make; \
+	fi
+	touch build-stamp-openmpi
+
 build-stamp-lam:
 	dh_testdir
 	[ -d TESTING/EXE ] || mkdir TESTING/EXE
@@ -104,12 +143,42 @@
 	rm -rf TESTING/EXE
 	dh_clean
 
-install: install-mpich install-lam
+install: install-openmpi install-lam install-mpich
+
+install-openmpi: install-stamp-openmpi
 
 install-lam: install-stamp-lam
 
 install-mpich: install-stamp-mpich
 
+install-stamp-openmpi: build-stamp-openmpi
+	dh_testdir 
+	if [ -e /usr/lib/openmpi/include/mpi.h ]; then \
+	dh_testroot; \
+	dh_clean -k; \
+	dh_installdirs -v $(openmpiPACKAGES); \
+	set -e ;\
+	for i in blacs blacsF77init blacsCinit ; do \
+	  install lib$$i-openmpi.so.1.1 \
+	    `pwd`/debian/blacs1gf-openmpi/usr/lib/lib$$i-openmpi.so.1.1 ;\
+	done; \
+	set -e ;\
+	for i in shared static ; do \
+	  install TESTING/EXE/xCbtest_MPI-LINUX-0-$$i-openmpi \
+	  `pwd`/debian/blacsgf-openmpi-test/usr/lib/blacs/cblacs_test_$$i-openmpi ;\
+	  install TESTING/EXE/xFbtest_MPI-LINUX-0-$$i-openmpi \
+	  `pwd`/debian/blacsgf-openmpi-test/usr/lib/blacs/fblacs_test_$$i-openmpi ;\
+	done; \
+	set -e ;\
+	install LIB/blacsCinit_MPI-LINUX-0.a \
+	  `pwd`/debian/blacsgf-openmpi-dev/usr/lib/libblacsCinit-openmpi.a; \
+	install LIB/blacsF77init_MPI-LINUX-0.a \
+	  `pwd`/debian/blacsgf-openmpi-dev/usr/lib/libblacsF77init-openmpi.a; \
+	install LIB/blacs_MPI-LINUX-0.a \
+	  `pwd`/debian/blacsgf-openmpi-dev/usr/lib/libblacs-openmpi.a; \
+	fi
+	touch install-stamp-openmpi
+
 install-stamp-lam: build-stamp-lam
 	dh_testdir 
 	dh_testroot
@@ -170,6 +239,26 @@
 
 	touch install-stamp-mpich
 
+binary-arch-openmpi: build-openmpi install-openmpi
+	if [ -e /usr/lib/openmpi/include/mpi.h ]; then \
+	dh_testdir $(openmpiPACKAGES); \
+	dh_testroot $(openmpiPACKAGES); \
+	dh_installdocs $(openmpiPACKAGES) README ; \
+	dh_installexamples $(openmpiPACKAGES); \
+	dh_installmanpages $(openmpiPACKAGES); \
+	dh_installchangelogs $(openmpiPACKAGES); \
+	dh_link $(openmpiPACKAGES); \
+	dh_compress $(openmpiPACKAGES); \
+	dh_fixperms $(openmpiPACKAGES); \
+	dh_strip $(openmpiPACKAGES); \
+	dh_makeshlibs $(openmpiPACKAGES); \
+	dh_installdeb $(openmpiPACKAGES); \
+	dh_shlibdeps $(openmpiPACKAGES) -l$(topdir); \
+	dh_gencontrol $(openmpiPACKAGES); \
+	dh_md5sums $(openmpiPACKAGES); \
+	dh_builddeb $(openmpiPACKAGES); \
+	fi
+
 binary-arch-lam: build-lam install-lam
 	dh_testdir $(lamPACKAGES)
 	dh_testroot $(lamPACKAGES)
@@ -230,7 +319,7 @@
 source diff:
 	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
 
-binary-arch: binary-arch-lam binary-arch-mpich
+binary-arch: binary-arch-openmpi binary-arch-lam binary-arch-mpich
 
 binary: binary-indep binary-arch
 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to