On 2/8/2012 8:58 AM, Jeff Squyres wrote:
* Detect when a compiler such as xlc may not report compile errors
properly, causing some configure checks to be wrong. Thanks to
Paul H. Hargrove for reporting the problem and providing a patch.
Looks like I botched this one!
I have added two Linux/ppc64 machines the xlc-7.0, xlc-8.0 and xlc-9.0
to my testing.
These are NOT running on the odd virtual node that caused assertion
failures when testing xlc-11.1.
With these new xlc versions AND the original xlc-11.1 compiler (4
compilers on 3 different nodes) I am STILL seeing the following
INCORRECT result:
checking for old prototype of sched_setaffinity... yes
Where gcc on the same machines correctly gives a "no" result.
Looking in config.log, I do NOT see the -qhalt=E that was discussed as
the solution to this problem:
configure:9065: checking for old prototype of sched_setaffinity
configure:9083: xlc -c conftest.c >&5
And, of course, I didn't see the fatal error that should have occurred
at configure time.
So, I poked around some more in config.log and found:
configure:8338: xlc -c -q32 conftest.c >&5
"conftest.c", line 62.43: 1506-099 (S) Unexpected argument.
"conftest.c", line 62.55: 1506-098 (E) Missing argument(s).
So, what this means is that the probe I wrote for "xlc needs -qhalt=E"
is WRONG.
The following tests too many and too few as distinct cases, and appears
to resolve the problem for me:
--- config/hwloc.m4~ 2012-02-08 20:55:03.188903698 +0000
+++ config/hwloc.m4 2012-02-08 20:57:29.987668761 +0000
@@ -269,11 +269,16 @@
# make sure the compiler returns an error code when function arg
count is wrong,
# otherwise sched_setaffinity checks may fail
+ hwloc_args_check_ok=yes
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
extern int one_arg(int x);
+ int foo(void) { return one_arg(1, 2); }
+ ]])], [ hwloc_args_check_ok=no ])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
extern int two_arg(int x, int y);
- int foo(void) { return one_arg(1, 2) + two_arg(3); }
- ]])], [
+ int foo(void) { return two_arg(3); }
+ ]])], [ hwloc_args_check_ok=no ])
+ AS_IF([test "$hwloc_args_check_ok" != "yes"],[
AC_MSG_WARN([Your C compiler does not consider incorrect
argument counts to be a fatal error.])
if test "$hwloc_check_compiler_vendor_result" = "ibm"; then
AC_MSG_WARN([For XLC you may try appending '-qhalt=-e' to
the value of CFLAGS.])
With that change in place, configure stops as desired:
configure: WARNING: Your C compiler does not consider incorrect
argument counts to be a fatal error.
configure: WARNING: Please report this failure, and configure using a
different C compiler if possible.
configure: error: Cannot continue.
EXCEPT, that I am not seeing the "set CFLAGS..." message.
Is it possible that this check is running before
hwloc_check_compiler_vendor_result has been set?
ALSO, the text of the (missing) message is incorrect:
284c284
< AC_MSG_WARN([For XLC you may try appending '-qhalt=-e' to
the value of CFLAGS.])
---
> AC_MSG_WARN([For XLC you may try appending '-qhalt=e' to
the value of CFLAGS.])
That is probably my fault, too.
-Paul
--
Paul H. Hargrove phhargr...@lbl.gov
Future Technologies Group
HPC Research Department Tel: +1-510-495-2352
Lawrence Berkeley National Laboratory Fax: +1-510-486-6900