On Nov 20, 2007, at 1:46 PM, Brad Penoff wrote:
More specifically: can you have your configure.m4 script check to see
if the current system a) supports SCTP,
Yes, the current configure.m4 does this by making use of
OMPI_CHECK_PACKAGE.
Good.
and b) if yes, if it supports 1-to-many? This kind of checking
would theoretically
allow running on Solaris
This is a little more tricky.
[snip]
Hmm, I suppose you're right. We could just make Solaris set the MCA
variable btl_sctp_if_11 to 1 in order to use the 1-to-1 mode to avoid
this mess. How would one change the default of an MCA variable in an
autoconf rule? I really hope there's a way to keep one-to-many the
default as often as possible (if not always).
Basically, if you can make a short C program that tests the behavior,
then AC can do it. Specifically, AC can compile/link/run a program
and you can look at the result. The only hitch in this scheme is for
cross-compiling environments (because you can compile/link, but you
can't run) -- but in those situations, AC "knows" that it's cross-
compiling and therefore you can set some default value.
As for setting an MCA param based on the result of an AC test, we
typically use AC_DEFINE to #define some value based on the result of
the test. Then in the C code, set the default value of that MCA param
to be the #define macro.
Note one philosophy in the OMPI code base: we *always* AC_DEFINE
macros, even for logical values. See the last point on (I just added
it):
https://svn.open-mpi.org/trac/ompi/wiki/CodingStyle
The SCTP API is typically within it's own library called libsctp.
However, in FreeBSD 7, the API is within libc. So say we're looking
for something like sctp_recvmsg (as we do now)... what is the best way
to structure an autoconf rule to look for this in either libsctp or
libc, and to not complain if libsctp doesn't exist? Should I just
call OMPI_CHECK_PACKAGE once with libsctp and if that fails then call
OMPI_CHECK_PACKAGE again with libc?
Ick. OMPI_CHECK_PACKAGE is currently not well setup a) to check
multiple libraries or b) be called more than once for the same
component. This will take some thought, but I cannot do it until
after the US holiday. :-\
--
Jeff Squyres
Cisco Systems