[mpich-discuss] Building with Clang

Dave Goodell goodell at mcs.anl.gov
Mon Aug 22 14:06:43 CDT 2011


On Aug 22, 2011, at 1:19 PM CDT, Dave Goodell wrote:

> The immediate cause of the configure failure can be seen in the config.log.  For some reason the configure test is generating a C program that looks like this:
> 
> ----8<----
> void main(){ return 0; }
> ----8<----
> 
> Which clang reasonably complains about:
[...]
> I'll do a bit more testing here with actual MPICH2 to see if I can reproduce what you're seeing.    MPICH2 is definitely using AC_LINK_IFELSE here in an unconventional way, so it would not be surprising to see that autoconf-2.68 somehow breaks the shared library support.
> 
> In the meantime can you send me your actual raw configure script as well?  That might shed some light on what's happening here.

Nevermind this.  I just didn't dig far enough.  The problem is that the configure test for whether the compiler accepts a particular switch compiles one valid program and then another semi-valid program that is expected to only emit a warning:

http://trac.mcs.anl.gov/projects/mpich2/browser/mpich2/trunk/confdb/aclocal_cc.m4#L60

----8<----
# gcc 4.2.4 on 32-bit does not complain about the -Wno-type-limits option 
# even though it doesn't support it.  However, when another warning is 
# triggered, it gives an error that the option is not recognized.  So we 
# need to test with a conftest file that will generate warnings.
# 
# add an extra switch, pac_c_check_compiler_option_invalidprototest, to
# disable this test just in case some new compiler does not like it.
#
# Linking with a program with an invalid prototype to ensure a compiler warning.
----8<----

So you can probably get your configure working again by setting "pac_c_check_compiler_option_prototest=no" in your environment before running configure.  Note that this correct variable name is *different* from the one mentioned in the comment, which is probably just a typo.  Also, like many other parts of the current MPICH2 autoconfigury, it will not be respected properly if a config.status reconfigure is triggered, since it's not marked precious with AC_ARG_VAR.

-Dave



More information about the mpich-discuss mailing list