tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: boost-mpi package



On Thu, 23 Feb 2012 08:55:50 +0100
Thomas Klausner <wiz%NetBSD.org@localhost> wrote:
> The usual solutions is to modify the Makefiles of the package so that
> boost-mpi links against Boost.Serialization from ${PREFIX} instead of
> building it (again).

Of course, boost uses bjam so this is a little tricky.

However, I think the correct solution is to add an option to the boost
packages specifying whether or not to include MPI support.  In this
way, the boost-libs package can be customized either way depending on
the option setting.  I have included a patch below that illustrates how
this would work and will commit this after a bit if there are no
further comments or better ideas.

Note that although adding MPI support to boost also brings in the
parallel graph library, I think calling the option 'mpi' rather than
'parallel-graph' makes sense as it is more general (Boost.MPI may be
used without the graph code) and anyone working with the parallel graph
library will understand that MPI is necessary.  Thoughts?

Cheers,
Brook

Index: meta-pkgs/boost/options.mk
===================================================================
RCS file: /cvsroot/pkgsrc/meta-pkgs/boost/options.mk,v
retrieving revision 1.1
diff -u -r1.1 options.mk
--- meta-pkgs/boost/options.mk  3 Mar 2009 08:57:58 -0000       1.1
+++ meta-pkgs/boost/options.mk  23 Feb 2012 16:22:51 -0000
@@ -1,7 +1,7 @@
 # $NetBSD: options.mk,v 1.1 2009/03/03 08:57:58 jmmv Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.boost
-PKG_SUPPORTED_OPTIONS= debug expat icu
+PKG_SUPPORTED_OPTIONS= debug expat icu mpi 
 
 .include "../../mk/bsd.options.mk"
 
@@ -18,4 +18,15 @@
 .  include "../../textproc/icu/buildlink3.mk"
 .endif
 
+.if !empty(PKG_OPTIONS:Mmpi)
+BJAM_ARGS+=            --user-config=${WRKSRC}/user-config.jam
+PLIST_MPI=             ${PKGDIR}/PLIST.mpi
+mpi-user-config:
+       ${ECHO} 'using mpi : ;' > ${WRKSRC}/user-config.jam
+.include "../../mk/mpi.buildlink3.mk"
+.else
+PLIST_MPI=
+mpi-user-config:
+.endif
+
 .endif # ${BOOST_PACKAGE} == "libs"
Index: devel/boost-libs/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/boost-libs/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- devel/boost-libs/Makefile   26 Nov 2010 20:47:00 -0000      1.16
+++ devel/boost-libs/Makefile   23 Feb 2012 16:22:51 -0000
@@ -13,6 +13,8 @@
 
 .include "../../devel/boost-jam/bjam.mk"
 
+post-configure: mpi-user-config
+
 do-build: bjam-build
 
 do-install: boost-install-libs
@@ -21,3 +23,6 @@
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../mk/pthread.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
+
+# XXX - must follow bsd.pkg.mk because this is added to the end of the list
+PLIST_SRC+=    ${PLIST_MPI}


Home | Main Index | Thread Index | Old Index