diff options
author | John Mainzer <mainzer@hdfgroup.org> | 2012-03-08 03:56:35 (GMT) |
---|---|---|
committer | John Mainzer <mainzer@hdfgroup.org> | 2012-03-08 03:56:35 (GMT) |
commit | e7d8baf0c317fb606e036157d2f83a40d7a9d4a2 (patch) | |
tree | dae66fcd5516278755033df8427b809d338d2995 | |
parent | cca4beb3a99d56b9574e9c94b523c497dce2e910 (diff) | |
download | hdf5-e7d8baf0c317fb606e036157d2f83a40d7a9d4a2.zip hdf5-e7d8baf0c317fb606e036157d2f83a40d7a9d4a2.tar.gz hdf5-e7d8baf0c317fb606e036157d2f83a40d7a9d4a2.tar.bz2 |
[svn-r22035] Added configure link test to see if we can really link with the real
time library.
This change is necessary, as aio calls result in link failures when we
link with the -static flag. The new test in configure.in checks to see
if we think we have POSIX AIO, and if we do, it does a AC_TRY_LINK with
one of the aio calls. Note that to do this, the test must make temporary
changes to LIBS and (if the STATIC_EXEC flag is set) to LDFLAGS.
For now, if the link test fails, we kill AIO completely. We will have
to revist this if we ever support anything other than POSIX AIO.
Tested on jam (serial, with and without the --enable-static-exec configure
flag, and also parallel), and Phoenix (64 bit linux, serial only).
In testing, I noticed one un-related issue that I didn't have time to
chase. It seems that "-lrt" is showing up twice in the list of extra
libraries list in the configure results summary. This doesn't seem to
be causing problems, but it should be looked into.
-rwxr-xr-x | configure | 51 | ||||
-rw-r--r-- | configure.in | 30 |
2 files changed, 80 insertions, 1 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 20797 2011-05-11 22:55:17Z mainzer . +# From configure.in Id: configure.in 21945 2012-02-16 01:06:58Z mainzer . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for HDF5 1.9.109. # @@ -30042,6 +30042,55 @@ case $host_os in ;; esac + +saved_libs="$LIBS" +saved_ldflags="$LDFLAGS" + +case "X-$POSIX_AIO_SUPPORTED" in + X-yes) + LIBS="$LIBS -lrt" + if test "X$STATIC_EXEC" = "Xyes"; then + LDFLAGS="$LDFLAGS -static" + fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <aio.h> +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +struct aiocb cb; aio_fsync(O_SYNC, &cb) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +else + AIO_SUPPORTED=no + POSIX_AIO_SUPPORTED=no + REQUIRE_64_BIT_POSIX_AIO=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ;; + X-no|*) + ;; +esac + +LIBS="$saved_libs" +LDFLAGS="$saved_ldflags" + + + if (${CC-cc} -V 2>&1 | grep '^pgcc') > /dev/null ; then AIO_SUPPORTED=no fi diff --git a/configure.in b/configure.in index 7040fd4..26c9527 100644 --- a/configure.in +++ b/configure.in @@ -4417,6 +4417,36 @@ case $host_os in ;; esac +dnl If we think posix aio is supported, verify that we can link with it. + +saved_libs="$LIBS" +saved_ldflags="$LDFLAGS" + +case "X-$POSIX_AIO_SUPPORTED" in + X-yes) + LIBS="$LIBS -lrt" + if test "X$STATIC_EXEC" = "Xyes"; then + LDFLAGS="$LDFLAGS -static" + fi + AC_TRY_LINK([#include <aio.h>], + [struct aiocb cb; aio_fsync(O_SYNC, &cb)], + , + AIO_SUPPORTED=no + POSIX_AIO_SUPPORTED=no + REQUIRE_64_BIT_POSIX_AIO=no + ) + ;; + X-no|*) + ;; +esac + +LIBS="$saved_libs" +LDFLAGS="$saved_ldflags" + + +dnl As of last check, aio didn't get along with portland group compilers. +dnl Disable aio if we are using same. + if (${CC-cc} -V 2>&1 | grep '^pgcc') > /dev/null ; then AIO_SUPPORTED=no fi |