[mpich-discuss] Fwd: mpich2-1.4.1rc1 and DESTDIR behavior (in MacPorts)

Eric A. Borisch eborisch at ieee.org
Wed Aug 24 16:41:37 CDT 2011


I'm forwarding this to the -discuss group as I see others may be interested....

 - Eric

---------- Forwarded message ----------
From: Eric A. Borisch <eborisch at macports.org>
Date: Thu, Aug 18, 2011 at 11:18 AM
Subject: mpich2-1.4.1rc1 and DESTDIR behavior (in MacPorts)
To: Pavan Balaji <balaji at mcs.anl.gov>


Pavan,

Thanks again for your (and the rest of the team's) work on mpich2! As
you may recall I maintain the MacPorts mpich2 portfile.

I believe the 1.4.1rc1 implementation of DESTDIR is overzealous -- the
intention is not to run *in* DESTDIR, but to install a copy of the
files [1] that will eventually be placed into prefix info
${DESTDIR}/${prefix} in exactly the same state as if they were
directory (make install-ed) into prefix.

Here are the changes I've had to apply with the portfile to make this
work correctly:

(1) We still need to patch createshlib.in as before [2]

(2)  Without this set of changes, a number of the files get placed
into ${destroot}${destroot}${prefix} (as opposed to
${destroot}${prefix}) during the 'make install DESTDIR=${destroot}'
process

post-patch {
   reinplace -E "s|fix=\\\$\\\{DESTDIR\\\}|fix=|g" \
       ${worksrcpath}/Makefile.in
   reinplace -E "s|dir=\\\$\\\{DESTDIR\\\}|dir=|g" \
       ${worksrcpath}/Makefile.in
}

(3) Without these changes the DESTDIR (=$(destroot)) directory ends up
stored in these files, as well. I haven't verified that this removal
is required, but it seemed poor form to leave references to a
soon-to-be-nonexistent directory. This could probably also be fixed by
patching a Makefile.in somewhere, but this was quicker for me to
implement.

post-destroot {
   reinplace -E "s|${destroot}||g" ${destroot}/${prefix}/bin/mpicxx
   reinplace -E "s|${destroot}||g" ${destroot}/${prefix}/bin/mpicc
   reinplace -E "s|${destroot}||g" ${destroot}/${prefix}/etc/mpicxx.conf
   reinplace -E "s|${destroot}||g" ${destroot}/${prefix}/etc/mpicc.conf
}

I've attached a patchfile describing the effect of the post-patch step
(2) above.

I haven't updated the portfile in Macports yet; I'll probably wait for
the actual release.

Thanks, and let me know your thoughts
 Eric
--
Eric A. Borisch

[1] http://www.gnu.org/prep/standards/html_node/DESTDIR.html
[2] https://trac.macports.org/browser/trunk/dports/science/mpich2/files/patch-src-util-createshlib.in
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile.in.patch
Type: application/octet-stream
Size: 3087 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20110824/11bdfae7/attachment.obj>


More information about the mpich-discuss mailing list