Version 4 (modified by jazz, 16 years ago) (diff) |
---|
Rebuild mpich2 Debain package
There are Debian package provided by Zach Lowry for MPICH2 version 1.0.3. We want to build 1.0.7 package with 1.0.3 package rules. Here is the procedures:
Extract 1.0.3 debian package rules
- Donwload 1.0.3 debian package source files
root@r-mpi:~# wget http://www.cs.mtsu.edu/~zach/debian/current/mpich2_1.0.3-2.dsc root@r-mpi:~# wget http://www.cs.mtsu.edu/~zach/debian/current/mpich2_1.0.3-2.diff.gz root@r-mpi:~# wget http://www.cs.mtsu.edu/~zach/debian/current/mpich2_1.0.3.orig.tar.gz
- We will need dpkg-source command, so first check if you had installed dpkg-dev
root@r-mpi:~# apt-get install dpkg-dev
- Extract 1.0.3 debian package source
root@r-mpi:~# dpkg-source -x mpich2_1.0.3-2.dsc gpg: Signature made Mon 28 Nov 2005 07:49:49 PM PST using DSA key ID 1CE6894E gpg: Can't check signature: public key not found dpkg-source: extracting mpich2 in mpich2-1.0.3 dpkg-source: unpacking mpich2_1.0.3.orig.tar.gz dpkg-source: applying ./mpich2_1.0.3-2.diff.gz
Configure 1.0.7 source tar ball
- Download 1.0.7 source tar ball from office website
root@r-mpi:~# wget http://www.mcs.anl.gov/research/projects/mpich2/downloads/tarballs/mpich2-1.0.7.tar.gz root@r-mpi:~# tar zxvf mpich2-1.0.7.tar.gz
- Copy debian folder from 1.0.3
root@r-mpi:~# cd mpich2-1.0.7 root@r-mpi:~/mpich2-1.0.7# cp -aRp ../mpich2-1.0.3/debian/ .
- We will need dch command, so first check if you had installed devscripts
root@r-mpi:~/mpich2-1.0.7# apt-get install devscripts
- modified debian/control
root@r-mpi:~/mpich2-1.0.7# vi debian/control
-
debian/control
old new 24 24 Architecture: any 25 25 Section: devel 26 26 Priority: extra 27 Depends: ${shlibs:Depends}, python 2.3, python2.3-xml27 Depends: ${shlibs:Depends}, python, python-xml 28 28 Conflicts: mpd 29 29 Recommends: mpich2-doc (= ${Source-Version}), ssh 30 30 Description: Process control for MPICH2
-
- update debian/changelog
root@r-mpi:~/mpich2-1.0.7# export DEBFULLNAME="Jazz Yao-Tsung Wang" root@r-mpi:~/mpich2-1.0.7# export DEBEMAIL="XXX@NCHC.ORG.TW" root@r-mpi:~/mpich2-1.0.7# dch -i
-
debian/changelog
old new 1 1 2 mpich2 (1.0.3-3) unstable; urgency=low 2 mpich2 (1.0.7-1) unstable; urgency=low 3 4 * New upstream release 5 6 -- Jazz Yao-Tsung Wang <XXX@NCHC.ORG.TW> Thu, 12 Jun 2008 13:11:50 -0700 3 7 4 8 mpich2 (1.0.3-2) unstable; urgency=low
-
- remove old patches
root@r-mpi:~/mpich2-1.0.7# rm -rf debian/patches/
- use dpkg-checkbuilddeps to know which packages is not yet installed for building new packages.
root@r-mpi:~/mpich2-1.0.7# dpkg-checkbuilddeps
- If there are errors after dpkg-checkbuilddeps, you can install packages which is needed for build mpich2 packages
root@r-mpi:~/mpich2-1.0.7# apt-get install gcc g++ debhelper cdbs libg2c0 linux-kernel-headers python g77 txt2man libxt6 libxt-dev x-dev
- use cdbs-edit-patches to create new patches
root@r-mpi:~/mpich2-1.0.7# cdbs-edit-patch 01_Makefile.in
- cdbs-edit-patches will create a temperate folder for you to edit patches. You will need to patch following files.
- Makefile.in
root@r-mpi:/tmp/cdbs-new-patch.aj3114/mpich2-1.0.7.new# vi Makefile.in
-
Makefile.in
old new 185 185 if [ ! -d ${DESTDIR}${exec_prefix} ] ; then $(MKDIR_P) ${DESTDIR}${exec_prefix} ; fi 186 186 if [ ! -d ${DESTDIR}${libdir} ] ; then $(MKDIR_P) ${DESTDIR}${libdir} ; fi 187 187 ${MAKE} install-local 188 ${MAKE} install-examples 188 189 $(INSTALL_DATA) src/include/mpi.h ${DESTDIR}${includedir}/mpi.h 189 190 $(INSTALL_DATA) lib/lib${MPILIBNAME}.a ${DESTDIR}${libdir}/lib${MPILIBNAME}.a 190 191 if [ ! -d ${DESTDIR}${docdir} ] ; then $(MKDIR_P) ${DESTDIR}${docdir} ; fi
-
- Fixed $(PREFIX) problem: replace $(PREFIX) with $(prefix)
root@r-mpi:/tmp/cdbs-new-patch.aj3114/mpich2-1.0.7.new# for i in $(grep "(PREFIX)" `find . -name "Makefile.in"` | awk '{ print $1 }' | uniq | sed 's#:##'); do mv $i $i.org; cat $i.org | sed 's#(PREFIX)#(prefix)#g' > $i ; rm $i.org; done
-
./src/mpe2/src/slog2sdk/trace_sample/Makefile.in
old new 7 7 cd src && $(MAKE) 8 8 9 9 install: 10 @if [ -n "$( PREFIX)" ] ; then \11 ./sbin/install-package -prefix=$( PREFIX) ; \10 @if [ -n "$(prefix)" ] ; then \ 11 ./sbin/install-package -prefix=$(prefix) ; \ 12 12 else \ 13 13 ./sbin/install-package ; \ 14 14 fi -
./src/mpe2/src/slog2sdk/trace_rlog/Makefile.in
old new 7 7 cd src && $(MAKE) 8 8 9 9 install: 10 @if [ -n "$( PREFIX)" ] ; then \11 ./sbin/install-package -prefix=$( PREFIX) ; \10 @if [ -n "$(prefix)" ] ; then \ 11 ./sbin/install-package -prefix=$(prefix) ; \ 12 12 else \ 13 13 ./sbin/install-package ; \ 14 14 fi -
./src/mpe2/src/slog2sdk/Makefile.in
old new 15 15 done 16 16 17 17 install: 18 @if [ -n "$( PREFIX)" ] ; then \19 ./sbin/install-package -prefix=$( PREFIX) ; \18 @if [ -n "$(prefix)" ] ; then \ 19 ./sbin/install-package -prefix=$(prefix) ; \ 20 20 else \ 21 21 ./sbin/install-package ; \ 22 22 fi -
./src/mpe2/Makefile.in
old new 70 70 71 71 ######## Installing 72 72 install: FORCE_TARGET 73 @if [ -n "$( PREFIX)" ] ; then \74 ./sbin/mpeinstall -prefix=$( PREFIX) -dmode="" ; \73 @if [ -n "$(prefix)" ] ; then \ 74 ./sbin/mpeinstall -prefix=$(prefix) -dmode="" ; \ 75 75 else \ 76 76 ./sbin/mpeinstall -dmode="" ; \ 77 77 fi 78 78 79 79 installcheck: 80 @if [ -n "$( PREFIX)" ] ; then \81 ./sbin/mpecheckinstall -prefix=$( PREFIX) ; \80 @if [ -n "$(prefix)" ] ; then \ 81 ./sbin/mpecheckinstall -prefix=$(prefix) ; \ 82 82 else \ 83 83 ./sbin/mpecheckinstall ; \ 84 84 fi 85 85 86 86 installcheck-all: 87 @if [ -n "$( PREFIX)" ] ; then \87 @if [ -n "$(prefix)" ] ; then \ 88 88 if [ -n "$(MPERUN)" ] ; then \ 89 ./sbin/mpecheckinstall -prefix=$( PREFIX) -run="$(MPERUN)" ; \89 ./sbin/mpecheckinstall -prefix=$(prefix) -run="$(MPERUN)" ; \ 90 90 else \ 91 ./sbin/mpecheckinstall -prefix=$( PREFIX) -run ; \91 ./sbin/mpecheckinstall -prefix=$(prefix) -run ; \ 92 92 fi ; \ 93 93 else \ 94 94 if [ -n "$(MPERUN)" ] ; then \ -
./src/mpi/romio/Makefile.in
old new 134 134 135 135 install: 136 136 $(MAKE) clean 137 @./util/romioinstall -prefix=$( PREFIX)137 @./util/romioinstall -prefix=$(prefix) 138 138 139 139 # LAM added uninstall target 140 140 uninstall: 141 @./util/romioinstall -prefix=$( PREFIX) -uninstall141 @./util/romioinstall -prefix=$(prefix) -uninstall 142 142 143 143 # FIXME: To avoid problems with noisy make programs, these should be accessed 144 144 # through entries in localdefs .
-
- Makefile.in
- type exit to finish cdbs-edit-patch. You can use exit 1 to skip creating patches if there is something wrong. Use dpkg-buildpackage command to build your new packages.
root@r-mpi:/tmp/cdbs-new-patch.aj3114/mpich2-1.0.7.new# exit root@r-mpi:~/mpich2-1.0.7# dpkg-buildpackage