Hi Jeff,
Jeff Squyres wrote:
On Nov 10, 2008, at 6:41 AM, Jed Brown wrote:
With #define's and compiler flags, I think that can be easily done --
was wondering if this is something that developers using MPI do and
whether AC/AM supports it.
AC will allow you to #define whatever you want -- look at the
documentation for AC_DEFINE and AC_DEFINE_UNQUOTED. You can also tell
your configure script to accept various --with-<foo> and
--enable-<foo> arguments; see the docs for AC_ARG_WITH and AC_ARG_ENABLE.
Thanks for this! I know "it's in the document", but I've been going
through it with much difficulty. Definitely complete, but hard to get
into and know what it is I need. So, some keywords to search for will
definitely help!
If --with-mpi is not specified, the following will happen:
1. You don't set CC (and friends), so AC_PROG_CC will find the default
compilers. Hence, your app will not be compiled and linked against
the MPI libraries.
2. #define BUILDING_WITH_MPI to 0, so the code above will compile out
the call to MPI_Send().
Both of these are valid techniques -- use whichever suits your app the
best.
I see; thank you for giving me this second option. I guess I'm more
attracted to this since it allows me to continue working with Open MPI.
As I am writing the system [now], I'll have to keep in mind to make it
modular so that parts can be #define'd in and out easily.
Thank you for your careful explanation!
Ray