# -*- shell-script -*- # Process this file with autoconf to produce a configure script. # This file is part of the University of Notre Dame implementation of # LAM/MPI. See the LICENSE file in the top-level directory for # license and copyright details. # Disable caching. define([AC_CACHE_LOAD], )# define([AC_CACHE_SAVE], )# # Init autoconf AC_INIT(./share/mpi/init.c) AC_CONFIG_AUX_DIR(./config) # Init automake # Get the version of LAM that we are installing get_version="sh $srcdir/config/get_lam_version $srcdir" LAM_VERSION="`eval $get_version --full`" LAM_MAJOR_VERSION="`eval $get_version --major`" LAM_MINOR_VERSION="`eval $get_version --minor`" LAM_RELEASE_VERSION="`eval $get_version --release`" LAM_ALPHA_VERSION="`eval $get_version --alpha`" LAM_BETA_VERSION="`eval $get_version --beta`" AC_DEFINE_UNQUOTED(LAM_MAJOR_VERSION, $LAM_MAJOR_VERSION) AC_DEFINE_UNQUOTED(LAM_MINOR_VERSION, $LAM_MINOR_VERSION) AC_DEFINE_UNQUOTED(LAM_RELEASE_VERSION, $LAM_RELEASE_VERSION) AC_DEFINE_UNQUOTED(LAM_ALPHA_VERSION, $LAM_ALPHA_VERSION) AC_DEFINE_UNQUOTED(LAM_BETA_VERSION, $LAM_BETA_VERSION) AC_DEFINE_UNQUOTED(LAM_VERSION, "$LAM_VERSION") # Need to also AC_SUBST these for share/include/patchlevel.h and # share/include/mpif.h AC_SUBST(LAM_MAJOR_VERSION) AC_SUBST(LAM_MINOR_VERSION) AC_SUBST(LAM_RELEASE_VERSION) AC_SUBST(LAM_ALPHA_VERSION) AC_SUBST(LAM_BETA_VERSION) AC_SUBST(LAM_VERSION) echo "Configuring LAM version $LAM_VERSION" # The third argument to AM_INIT_AUTOMAKE surpresses the PACKAGE and # VERSION macors AM_INIT_AUTOMAKE(lam, $LAM_VERSION, 'no') AM_CONFIG_HEADER(share/include/lam_config.h) # Make automake clean emacs ~ files for "make clean" CLEANFILES="*~" AC_SUBST(CLEANFILES) # For debugging AC_ARG_ENABLE(echo, [ --enable-echo echo configure script commands], [set -x]) # This is useful later AC_CANONICAL_HOST AC_DEFINE_UNQUOTED(LAM_ARCH,"$host") # See if we can find an old installation of LAM to overwrite AC_PREFIX_PROGRAM(lamclean) # Basic sanity checking; we can't install to a relative path case "$prefix" in /*) echo installing to directory \"$prefix\" ;; NONE) echo installing to directory \"$ac_default_prefix\" ;; *) AC_MSG_ERROR(prefix \"$prefix\" must be an absolute directory path) ;; esac # check for specification of C compiler AC_ARG_WITH(cc, [ --with-cc=CC use C compiler CC]) if test -n "$with_cc"; then if test $with_cc = yes; then AC_MSG_ERROR(the --with-cc option requires the compiler name) fi CC=$with_cc; fi # check for specification of C compiler flags AC_ARG_WITH(cflags, [ --with-cflags=CFLAGS use C compiler flags CFLAGS]) if test -n "$with_cflags"; then CFLAGS=$with_cflags; fi lam_cflags_save="$CFLAGS" # # Part one of libtool magic # Check all the way up here so that we can complain if shared was # selected with mpi2c++ or ROMIO # AM_DISABLE_SHARED # # ROMIO is now enabled by default # AC_MSG_CHECKING([if want ROMIO support]) ROMIO_BUILD_TARGET= ROMIO_INSTALL_TARGET= ROMIO_EXAMPLES= ROMIO_EXTRALIBS= WANT_ROMIO=yes AC_ARG_WITH(romio, [ --without-romio disable ROMIO support in LAM/MPI], [WANT_ROMIO=$withval]) AC_MSG_RESULT([$WANT_ROMIO]) if test "$WANT_ROMIO" = "yes"; then ROMIO_BUILD_TARGET=romio-all ROMIO_INSTALL_TARGET=romio-install ROMIO_EXAMPLES=romio AC_DEFINE(LAM_WANT_ROMIO, 1) libs_SAVE="$LIBS" AC_CHECK_LIB(aio, main, ROMIO_EXTRALIBS="-laio") LIBS="$libs_SAVE" else AC_DEFINE(LAM_WANT_ROMIO, 0) AC_DEFINE(HAVE_LIBAIO, 0) fi AC_SUBST(ROMIO_BUILD_TARGET) AC_SUBST(ROMIO_INSTALL_TARGET) AC_SUBST(ROMIO_EXAMPLES) # If we want ROMIO, see if there are any flags to pass through to its # configure script ROMIO_USER_FLAGS= AC_ARG_WITH(romio-flags, [ --with-romio-flags=FLAGS pass FLAGS to ROMIO's configure script], [ROMIO_USER_FLAGS=$withval]) # Stoopid emacs mode: ' if test "$WANT_ROMIO" = "yes"; then AC_MSG_CHECKING([for user ROMIO flags]) if test "$ROMIO_USER_FLAGS" = ""; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([$ROMIO_USER_FLAGS]) fi fi AC_SUBST(ROMIO_USER_FLAGS) # See if we want the C++ bindings # If we do not want the C++ bindings, skip all other C++ tests # (compiler, flags, etc.) AC_MSG_CHECKING([if want MPI 2 C++ support]) MPI2CPP_BUILD_TARGET= MPI2CPP_INSTALL_TARGET= MPI2CPP_EXAMPLES= WANT_MPI2CPP=yes WANT_CPP_EXCEPTIONS=no MPI2CPP_CONFIGURE_EXFLAGS="--without-exflags" AC_ARG_WITH(mpi2cpp, [ --without-mpi2cpp build LAM without MPI 2 C++ bindings support], [WANT_MPI2CPP=$withval]) AC_MSG_RESULT([$WANT_MPI2CPP]) # check for specification of C++ compiler and C++ compiler flags # Have to do things a little out of order here; may seem a little strange AC_ARG_WITH(cxx, [ --with-cxx=CXX use C++ compiler CXX]) AC_ARG_WITH(cxxflags, [ --with-cxxflags=CXXFLAGS use C++ compiler flags CXXFLAGS]) AC_ARG_WITH(exceptions, [ --with-exceptions enable support for C++ exceptions]) if test "$with_mpi2cpp" = "" -o "$with_mpi2cpp" = "yes"; then AC_DEFINE(LAM_WANT_MPI2CPP, 1) else AC_DEFINE(LAM_WANT_MPI2CPP, 0) fi # # Now that we know if we want MPI2C++ and/or ROMIO, check if the user # asked for shared libraries. # if test "$WANT_ROMIO" = "yes" -o "$WANT_MPI2CPP" = "yes"; then # Ick -- we had to dive into AC_DISABLE_SHARED to figure this out :-( if test "$enable_shared" = "yes"; then AC_MSG_WARN([*** Unfortunately, the MPI 2 C++ bindings and ROMIO cannot]) AC_MSG_WARN([*** cannot be built with shared memory support. :-(]) AC_MSG_WARN([*** You must select to only build static libraries,]) AC_MSG_WARN([*** or disable ROMIO and the MPI 2 C++ bindings.]) AC_MSG_WARN([*** See the INSTALL file for details.]) AC_MSG_ERROR([*** Cannot continue.]) fi fi # Check if we want IMPI support AC_MSG_CHECKING([if want IMPI support]) if test -f "$srcdir/otb/sys/impid/impid.c"; then WANT_IMPI=yes else WANT_IMPI=no fi AC_ARG_WITH(impi, [ --with-impi compile with IMPI support (6.4.x only)], [WANT_IMPI=$withval]) AM_CONDITIONAL(WANT_IMPI_BUILD, test "$WANT_IMPI" = "yes") if test "$WANT_IMPI" = "yes"; then # If this is not a 6.4 tarball, bail immediately if test ! -f "$srcdir/otb/sys/impid/impid.c"; then AC_MSG_RESULT([yes]) AC_MSG_WARN([*** You do not have a version of LAM/MPI that contains]) AC_MSG_WARN([*** the IMPI extensions.]) AC_MSG_ERROR([*** Cannot continue; you must configure without --with-impi.]) fi IMPI_LIB="impi/liblamimpi.la" IMPI_DIR="impi" IMPID_DIR="impid" AC_DEFINE(LAM_WANT_IMPI, 1) else IMPI_LIB="" IMPI_DIR="" IMPID_DIR="" AC_DEFINE(LAM_WANT_IMPI, 0) fi AC_SUBST(IMPI_LIB) AC_SUBST(IMPI_DIR) AC_SUBST(IMPID_DIR) AC_SUBST(IMPI_OBJS) AC_MSG_RESULT([$WANT_IMPI]) # Now that we have established whether we want IMPI and/or MPI 2 # C++, we can decide if we want to check for the C++ compiler or not if test "$WANT_MPI2CPP" = "yes" -o "$WANT_IMPI" = "yes"; then if test -n "$with_cxx"; then if test $with_cxx = yes; then AC_MSG_ERROR(the --with-cxx option requires the compiler name) fi CXX="$with_cxx" fi if test -n "$with_cxxflags"; then CXXFLAGS="$with_cxxflags" fi fi lam_cxxflags_save="$CXXFLAGS" # Check for compilers # #$%@#%@# autoconf!!! lam_cflags_save="$CFLAGS" AC_PROG_CC BASECC="`basename $CC`" # Still check for a C++ compiler even if we aren't building the C++ # bindings or IMPI, 'cause we want something to put in hcp. if test "$CXX" = no; then WANT_MPI2CPP=no WANT_IMPI=no AC_MSG_WARN([*** C++ compiler is disabled. Automatically disabling]) AC_MSG_WARN([*** IMPI and the MPI 2 C++ bindings.]) else AC_PROG_CXX fi BASECXX="`basename $CXX`" AC_PROG_GCC_TRADITIONAL CFLAGS="$lam_cflags_save" CXXFLAGS="$lam_cxxflags_save" # Check for C++ things EXTRA_MPICC_FLAGS= EXTRA_MPIF77_FLAGS= EXTRA_MPICPP_FLAGS= if test "$WANT_MPI2CPP" = "yes" -o "$WANT_IMPI" = "yes"; then if test "$CXX" = "no"; then AC_MSG_ERROR([Cannot install MPI 2 C++ bindings without a C++ compiler]) else if test "$WANT_MPI2CPP" = "yes"; then MPI2CPP_BUILD_TARGET=mpi2c++-all MPI2CPP_INSTALL_TARGET=mpi2c++-install MPI2CPP_EXAMPLES=mpi2c++ fi fi if test "$WANT_IMPI" = "yes"; then LSC_CXX_HAVE_NOTHROW_NEW(LAM) fi # Both IMPI and the C++ bindings require proper exception handling if test "$with_exceptions" = "yes"; then WANT_CPPEXCEPTIONS=1 else WANT_CPPEXCEPTIONS=0 fi if test "$WANT_CPPEXCEPTIONS" = "1"; then LSC_CXX_HAVE_EXCEPTIONS(LAM) if test "$LAM_CXX_HAS_EXCEPTIONS" = "1"; then LSC_CXX_FIND_EXCEPTION_FLAGS(LAM) CFLAGS="$CFLAGS $LAM_CXX_EXCEPTION_CXXFLAGS" FFLAGS="$FFLAGS $LAM_CXX_EXCEPTION_CFLAGS" CXXFLAGS="$CXXFLAGS $LAM_CXX_EXCEPTION_CXXFLAGS" MPI2CPP_CONFIGURE_EXFLAGS="--with-exflags=\"$LAM_CXX_EXCEPTION_CXXFLAGS\"" LDFLAGS="$LDFLAGS $LAM_CXX_EXCEPTION_LDFLAGS" EXTRA_MPICC_FLAGS="$LAM_CXX_EXCEPTION_CXXFLAGS" EXTRA_MPIF77_FLAGS="$LAM_CXX_EXCEPTION_CXXFLAGS" EXTRA_MPICPP_FLAGS="$LAM_CXX_EXCEPTION_CXXFLAGS" fi fi AC_PROG_CXXCPP if test "$WANT_IMPI" = "yes"; then LSC_CXX_HAVE_STL(LAM) if test "$LAM_CXX_STL" = "0"; then AC_MSG_WARN([*** Your C++ compiler does not seem to support the STL.]) AC_MSG_WARN([*** STL support is necessary to compile the IMPI extensions]) AC_MSG_WARN([*** to LAM/MPI. Either choose a C++ compiler that supports]) AC_MSG_WARN([*** STL, or configure --without-impi.]) AC_MSG_ERROR([cannot continue]) fi LSC_CXX_FIND_TEMPLATE_REPOSITORY(LAM) LSC_CXX_HAVE_BOOL(LAM) LSC_CXX_HAVE_TRUE_FALSE(LAM) fi case "$host" in *hpux*) if test "$BASECXX" = "CC"; then AC_MSG_WARN([*** You will probably have problems compiling the MPI 2]) AC_MSG_WARN([*** C++ bindings with the CC compiler. You should probably]) AC_MSG_WARN([*** be using the aCC compiler. Set the CXX environment]) AC_MSG_WARN([*** variable to "aCC" and run ./configure again.]) fi ;; esac fi AC_SUBST(CXX) AC_SUBST(CXXCPP) AC_SUBST(MPI2CPP_BUILD_TARGET) AC_SUBST(MPI2CPP_INSTALL_TARGET) AC_SUBST(MPI2CPP_EXAMPLES) AC_SUBST(MPI2CPP_CONFIGURE_EXFLAGS) AC_SUBST(EXTRA_MPICC_FLAGS) AC_SUBST(EXTRA_MPIF77_FLAGS) AC_SUBST(EXTRA_MPICPP_FLAGS) AC_SUBST(LAM_CXX_TEMPLATE_REPOSITORY) AC_DEFINE_UNQUOTED(LAM_CC, "$CC") # # If we are building IMPI, look for "impi-server" in the path so that # we can build it into mpirun # if test "$WANT_IMPI" = "yes"; then AC_CHECK_PROG(IMPI_SERVER, impi-server, impi-server, not found) if test "$IMPI_SERVER" = "not found"; then AC_MSG_WARN([*** Not able to find the executable 'impi-server' in]) AC_MSG_WARN([*** your path. The '-server' option will be disabled]) AC_MSG_WARN([*** in mpirun. To run IMPI jobs, you will need to run]) AC_MSG_WARN([*** the IMPI server independantly of LAM's mpirun.]) # Stoopid emacs mode: ' AC_DEFINE(LAM_WANT_IMPI_SERVER, 0) AC_DEFINE(LAM_IMPI_SERVER, "") else AC_DEFINE(LAM_WANT_IMPI_SERVER, 1) AC_DEFINE_UNQUOTED(LAM_IMPI_SERVER, "$IMPI_SERVER") fi fi # # Do we want the profiling interface? The default is now yes. Woof! # WANT_PROFILE=yes AC_ARG_WITH(profiling, [ --without-profiling disable the MPI profiling interface]) if test -n "$with_profiling"; then WANT_PROFILE="$with_profiling" fi AC_MSG_CHECKING([if want profiling interface]) AM_CONDITIONAL(WANT_PROFILE_BUILD, test "$WANT_PROFILE" = "yes") AC_MSG_RESULT([$WANT_PROFILE]) if test "$WANT_ROMIO" = "yes" -a "$WANT_PROFILE" = "no"; then AC_MSG_WARN([*** You have selected to build ROMIO and not use the]) AC_MSG_WARN([*** MPI profiling interface. This is not currently]) AC_MSG_WARN([*** supported. You can either select --without-romio,]) AC_MSG_WARN([*** or build the profiling interface. Sorry.]) AC_MSG_ERROR([Cannot continue]) fi if test "$WANT_PROFILE" = "yes"; then AC_DEFINE(LAM_WANT_PROFILE, 1) else AC_DEFINE(LAM_WANT_PROFILE, 0) fi # check if we want all the trillium header files and man pages installed WANT_TRILLIUM=no AC_ARG_WITH(trillium, [ --with-trillium enable installation of Trillium header/man/binary files (not required for MPI)]) if test -n "$with_trillium"; then WANT_TRILLIUM="$with_trillium" fi AC_MSG_CHECKING([if want full installation of Trillium files]) AM_CONDITIONAL(WANT_TRILLIUM_INSTALL, test "$WANT_TRILLIUM" = "yes") AC_MSG_RESULT([$WANT_TRILLIUM]) # check for specification of LD linker flags AC_ARG_WITH(ldflags, [ --with-ldflags=LDFLAGS use LD linker flags LDFLAGS]) if test -n "$with_ldflags"; then USER_LDFLAGS="$with_ldflags" else USER_LDFLAGS="$CFLAGS" fi # check for specification of C++ LD linker flags AC_ARG_WITH(ldflags, [ --with-cxxldflags=CXXLDFLAGS use C++ LD linker flags CXXLDFLAGS]) if test -n "$with_cxxldflags"; then USER_CXXLDFLAGS="$with_cxxldflags" else USER_CXXLDFLAGS="$CXXFLAGS" fi # check for specification of fortran compiler AC_ARG_WITH(fc, [ --with-fc=FC use Fortran compiler FC, specify no to disable Fortran support]) if test -n "$with_fc"; then if test "$with_fc" != no; then FC="$with_fc" fi fi # check for specification of Fortran compiler flags AC_ARG_WITH(fflags, [ --with-fflags=FFLAGS use Fortran compiler flags FFLAGS]) if test -n "$with_fflags"; then FFLAGS="$with_fflags" fi # # Check for "makedepend". Not everyone has this. # AC_CHECK_PROGS(MAKEDEPEND, makedepend, no) # # If they have makedepend, find some additional dependency directories # LAM_DEPDIRS= if test "$MAKEDEPEND" != "no"; then if test "$WANT_IMPI" = "yes"; then LSC_CXX_FIND_DEPDIRS(LAM) fi # Because linux tends to put stddef.h in weird places STDDEF= AC_CHECK_HEADERS(stddef.h, STDDEF=stddef.h) AC_MSG_CHECKING([for non-standard include directories]) # Ensure that we have what we need for the normals, just in case... LSC_OS_FIND_DEPDIRS(stdio.h stdlib.h $STDDEF, LAM) AC_MSG_RESULT([$LAM_OS_DEPDIRS]) LAM_DEPDIRS="$LAM_CXX_DEPDIRS $LAM_OS_DEPDIRS" fi AC_SUBST(LAM_DEPDIRS) # determine RPI to use AC_ARG_WITH(rpi, [ --with-rpi=RPI build with RPI comm layer RPI (where RPI=tcp|sysv|usysv|myri|via -- default is tcp)]) SYSLIBS="$ROMIO_EXTRALIBS" # Check for -lsocket -lnsl libs_SAVE="$LIBS" AC_CHECK_LIB(socket, socket, SYSLIBS="$SYSLIBS -lsocket") AC_CHECK_LIB(nsl, gethostbyname, SYSLIBS="$SYSLIBS -lnsl") LIBS="$libs_SAVE" # OS particular things case $host in *irix*) if test "$ac_cv_prog_gcc" = no; then LIBBIND="$USER_LDFLAGS -Wl,-woff,84" HBIND="$USER_LDFLAGS -Wl,-woff,84" fi ;; *sco-sysv*) # This seems to be necessary on SCO unix to get sendmsg and others # to compile/link/run properly. There's a note in # /usr/include/socket.h on SCO about this. Weird. CFLAGS="-DSVR4 $CFLAGS" esac AC_SUBST(SYSLIBS) AC_DEFINE_UNQUOTED(LAM_SYSLIBS, "$SYSLIBS") AC_DEFINE_UNQUOTED(LAM_HBIND, "$HBIND") # Determine the RPI to use LAM_RPI_REAL_CFLAGS="\"\"" LAM_RPI_REAL_LDFLAGS="\"\"" LAM_RPI_FAKE_CFLAGS= LAM_RPI_FAKE_LDFLAGS= AC_MSG_CHECKING([which RPI to use]) if test -z "$with_rpi"; then AC_MSG_RESULT([tcp (default)]) rpi=tcp else if test "$with_rpi" = yes; then AC_MSG_RESULT([tcp (default)]) rpi=tcp else rpi=$with_rpi if test "$rpi" = "sysv" -o "$rpi" = "usysv" -o "$rpi" = "tcp"; then AC_MSG_RESULT([$rpi]) # Put some cleverness here so that we can work on the myri and VIA # RPIs in the development tree, but make it unavailable in the # distribution 'till we're ready. # BE SURE TO UPDATE THE distscript.csh WHEN THESE RPI's ARE READY!! elif test "$rpi" = "myri"; then if test -f $srcdir/share/rpi/myri/Makefile.am; then AC_MSG_RESULT([$rpi]) else AC_MSG_RESULT([Doh!]) AC_MSG_ERROR([Sorry, the $rpi RPI is Not Yet Ready for Prime Time.]) fi elif test "$rpi" = "via"; then if test -f $srcdir/share/rpi/via/Makefile.am; then AC_MSG_RESULT([$rpi]) else AC_MSG_RESULT([Doh!]) AC_MSG_ERROR([Sorry, the $rpi RPI is Not Yet Ready for Prime Time.]) fi else AC_MSG_RESULT([RPI $rpi does not exist.]) AC_MSG_ERROR([See the INSTALL and RELEASE_NOTES files for details.]) fi fi fi AC_SUBST(rpi) # Check that the RPI is valid and set RPI type definition. RPI_HAS_MPI_MALLOC=no WANT_MYRINET= WANT_VIA= case $rpi in tcp) RPI_SUBDIRS="tcp" RPI_LIBS="tcp/liblamrpitcp.la" RPILIB="liblamrpitcp.la" RPILIBMASK="liblamrpitcp.*" AC_DEFINE(LAM_RPI_TCP, 1) ;; sysv) RPI_SUBDIRS="shmem sysv tcp" # Note: the rpitcp.la lib will have the same RPI API in it as the # rpisysv.la -- so it is important to list the sysv library # *first* to take advantage of unix linker semantics RPI_LIBS="shmem/liblamrpishmem.la sysv/liblamrpisysv.la tcp/liblamrpitcp.la" RPILIB="liblamrpisysv.la" RPILIBMASK="liblamrpisysv.*" AC_DEFINE(LAM_RPI_SHM_SYSV, 1) ;; usysv) RPI_SUBDIRS="shmem usysv tcp" # Note: the rpitcp.la lib will have the same RPI API in it as the # rpiusysv.la -- so it is important to list the usysv library # *first* to take advantage of unix linker semantics RPI_LIBS="shmem/liblamrpishmem.la usysv/liblamrpiusysv.la tcp/liblamrpitcp.la" RPILIB="liblamrpiusysv.la" RPILIBMASK="liblamrpiusysv.*" AC_DEFINE(LAM_RPI_SHM_USYSV, 1) ;; myri) RPI_SUBDIRS="myri" RPI_LIBS="myri/liblamrpimyri.la" RPILIB="liblamrpimyri.la libfakegm.la" RPILIBMASK="liblamrpimyri.* libfakegm.*" RPI_HAS_MPI_MALLOC=yes WANT_MYRINET=yes AC_DEFINE(LAM_RPI_MYRI, 1) ;; via) RPI_SUBDIRS="via" RPI_LIBS="via/liblamrpivia.la" RPILIB="liblamrpivia.la" RPILIBMASK="liblamrpivia.*" RPI_HAS_MPI_MALLOC=yes WANT_VIA=yes AC_DEFINE(LAM_RPI_VIA, 1) ;; *) AC_MSG_ERROR(unknown RPI \"$rpi\") ;; esac AC_DEFINE_UNQUOTED(LAM_RPI,"$rpi") AM_CONDITIONAL(WANT_DEFAULT_MPI_MALLOC, test "$RPI_HAS_MPI_MALLOC" = "no") AC_SUBST(RPI_SUBDIRS) AC_SUBST(RPI_LIBS) AC_SUBST(RPILIB) AC_SUBST(RPILIBMASK) RPIFLAGS= # check if not shortcircuiting AC_ARG_WITH(shortcircuit, [ --without-shortcircuit do not short circuit send/receives],[],[ case "$rpi" in tcp|sysv|usysv) AC_DEFINE(SHORTCIRCUIT, 1) ;; myri|via) AC_DEFINE(SHORTCIRCUIT, 1) ;; *) AC_DEFINE(SHORTCIRCUIT, 0) ;; esac]) AC_SUBST(RPIFLAGS) #AFR: add myrinet flags and such AC_ARG_WITH(gm, [ --with-gm=DIR directory where the gm myrinet was installed]) if test -n "$with_gm"; then GMDIR=$with_gm; fi #AFR: and VIA flags as well AC_ARG_WITH(vialib, [ --with-vialib=LIB name of the VIPL library to use]) if test -n "$with_vialib"; then VIALIB=$with_vialib; fi AC_ARG_WITH(vialibdir, [ --with-vialibdir=DIR directory of the VIPL library]) if test -n "$with_vialibdir"; then VIALIBDIR=$with_vialibdir; fi AC_ARG_WITH(viahdir, [ --with-viahdir=DIR directory of the vipl.h headerfile]) if test -n "$with_viahdir"; then VIAHDIR=$with_viahdir; fi AC_ARG_WITH(viadev, [ --with-viadev=DEV device for VIA to use (eg: /dev/clanvi0)]) if test -n "$with_viadev"; then VIA_DEVICE=$with_viadev; AC_SUBST(VIA_DEVICE) fi #test Myrinet libraries and such if test -n "$WANT_MYRINET"; then if test -n "$GMDIR"; then OLDLDFLAGS="$LDFLAGS" OLDLIBS="$LIBS" LDFLAGS="$LDFLAGS -L$GMDIR/binary/lib" CPPFLAGS="$CPPFLAGS -I$GMDIR/include" CFLAGS="$CFLAGS -I$GMDIR/include" found=no AC_CHECK_LIB(gm,main,found=yes) if test "$found" = "no"; then LDFLAGS="$OLDLDFLAGS -L$GMDIR/lib" # Force it to look again unset ac_cv_lib_gm_main AC_CHECK_LIB(gm,main,,AC_MSG_ERROR(*** Cannot find working libgm.)) LAM_RPI_REAL_LDFLAGS="\"-L$GMDIR/lib -lgm\"" else LAM_RPI_REAL_LDFLAGS="\"-L$GMDIR/binary/lib -lgm\"" fi AC_CHECK_HEADERS(gm.h,,AC_MSG_ERROR(*** Cannot find working gm.h.)) LAM_RPI_REAL_CFLAGS="\"-I$GMDIR/include\"" LAM_RPI_FAKE_CFLAGS="-I$GMDIR/include" LAM_RPI_FAKE_LDFLAGS="-L\$(top_srcdir)/share/rpi/myri/fakegm/.libs -lfakegm" LDFLAGS="$OLDLDFLAGS" LIBS="$OLDLIBS" else AC_CHECK_LIB(gm,main,,AC_MSG_ERROR(*** Cannot find working libgm.)) AC_CHECK_HEADERS(gm.h,,AC_MSG_ERROR(*** Cannot find working gm.h)) LAM_RPI_REAL_CFLAGS="\"\"" LAM_RPI_REAL_LDFLAGS="\"-lgm\"" LAM_RPI_FAKE_CFLAGS= LAM_RPI_FAKE_LDFLAGS="-lfakegm" fi # Check for which API constant to use: # GM_API_VERSION_1_2 # GM_API_VERSION_1_1 # GM_API_VERSION_1_0 check_gm_api_version() { gmver="$1" AC_TRY_COMPILE([#include ], [int foo = GM_API_VERSION_1_$gmver;], GM_API_VER="$gmver", GM_API_VER="") unset gmver } AC_MSG_CHECKING(GM API version) check_gm_api_version 2 if test "$GM_API_VER" = ""; then check_gm_api_version 1 if test "$GM_API_VER" = ""; then check_gm_api_version 0 if test "$GM_API_VER" = ""; then AC_MSG_RESULT([not found!]) AC_MSG_WARN([*** Could not determine the version of your GM library.]) AC_MSG_ERROR([*** Cannot continue]) fi fi fi GM_API_VERSION="-DLAM_GM_API_VERSION=GM_API_VERSION_1_$GM_API_VER" AC_SUBST(GM_API_VERSION) AC_MSG_RESULT([GM_API_VERSION_1_$GM_API_VER]) AC_DEFINE_UNQUOTED(LAM_RPI_REAL_CFLAGS,$LAM_RPI_REAL_CFLAGS) AC_DEFINE_UNQUOTED(LAM_RPI_REAL_LDFLAGS,$LAM_RPI_REAL_LDFLAGS) AC_DEFINE_UNQUOTED(LAM_RPI_FAKE_CFLAGS,$LAM_RPI_FAKE_CFLAGS) AC_DEFINE_UNQUOTED(LAM_RPI_FAKE_LDFLAGS,$LAM_RPI_FAKE_LDFLAGS) fi # # Test VIA libraries # if test -n "$WANT_VIA"; then AC_CHECK_LIB(pthread,main,,AC_MSG_ERROR(*** pthread library which is needed for vipl not found.)) CFLAGS="$CFLAGS -D_REENTRANT " CPPFLAGS="$CPPFLAGS -D_REENTRANT " #check headers (vipl.h) if test -n "$VIAHDIR"; then #if special header dir CPPFLAGS="$CPPFLAGS -I$VIAHDIR" CFLAGS="$CFLAGS -I$VIAHDIR/include" LAM_RPI_REAL_CFLAGS="\"-I$VIAHDIR\"" fi AC_CHECK_HEADERS(vipl.h,,AC_MSG_ERROR(*** Cannot find working vipl.h.)) if test -n "$VIALIB"; then #special libname (not libvipl) if test -n "$VIALIBDIR"; then #special directory OLDLDFLAGS="$LDFLAGS" OLDLIBS="$LIBS" LDFLAGS="$LDFLAGS -L$VIALIBDIR" AC_CHECK_LIB($VIALIB,main,,AC_MSG_ERROR(*** Cannot find working vipl library.)) LAM_RPI_REAL_LDFLAGS="\"-L$VIALIBDIR -lvipl\"" LDFLAGS="$OLDLDFLAGS" LIBS="$OLDLIBS" else #special libname, standard direcories OLDLDFLAGS="$LDFLAGS" OLDLIBS="$LIBS" AC_CHECK_LIB($VIALIB,main,,AC_MSG_ERROR(*** Cannot find working vipl library.)) LAM_RPI_REAL_LDFLAGS="\"-l$VIALIB\"" LDFLAGS="$OLDLDFLAGS" LIBS="$OLDLIBS" fi else #standard name (libvipl) if test -n "$VIALIBDIR"; then #special directory OLDLDFLAGS="$LDFLAGS" OLDLIBS="$LIBS" LDFLAGS="$LDFLAGS -L$VIALIBDIR" AC_CHECK_LIB(vipl,main,,AC_MSG_ERROR(*** Cannot find working libvipl.)) LAM_RPI_REAL_LDFLAGS="\"-L$VIALIBDIR -lvipl\"" LDFLAGS="$OLDLDFLAGS" LIBS="$OLDLIBS" else #std name, std dir OLDLDFLAGS="$LDFLAGS" OLDLIBS="$LIBS" AC_CHECK_LIB(vipl,main,,AC_MSG_ERROR(*** Cannot find working libvipl.)) LAM_RPI_REAL_LDFLAGS="\"-lvipl\"" LDFLAGS="$OLDLDFLAGS" LIBS="$OLDLIBS" fi fi AC_SUBST(LAM_RPI_REAL_CFLAGS) AC_SUBST(LAM_RPI_REAL_LDFLAGS) AC_DEFINE_UNQUOTED(LAM_RPI_REAL_CFLAGS, "$LAM_RPI_REAL_CFLAGS") AC_DEFINE_UNQUOTED(LAM_RPI_REAL_LDFLAGS, "$LAM_RPI_REAL_LDFLAGS") fi # use select to deschedule even when yield is available AC_ARG_WITH(select_yield, [ --with-select-yield use select to yield]) if test "$with_select_yield" = yes; then AC_DEFINE(LAM_USE_SELECT_YIELD) fi # change internal signal AC_ARG_WITH(signal, [ --with-signal=SIGNAL use internal signal SIGNAL]) if test -n "$with_signal"; then case "$with_signal" in SIG*) AC_DEFINE_UNQUOTED(LAM_SIGUSR,$with_signal);; yes) ;; *) AC_MSG_ERROR(invalid signal $with_signal);; esac fi # See where we can plug the opt flags in check_opt() { arg="$1" bad=0 for word in $arg; do case $word in -g) bad=1 ;; +K0) bad=1 ;; +K1) bad=1 ;; +K2) bad=1 ;; +K3) bad=1 ;; +K4) bad=1 ;; +K5) bad=1 ;; -O) bad=1 ;; -O0) bad=1 ;; -O1) bad=1 ;; -O2) bad=1 ;; -O3) bad=1 ;; -O4) bad=1 ;; -O5) bad=1 ;; -O6) bad=1 ;; -O7) bad=1 ;; -O8) bad=1 ;; -O9) bad=1 ;; -xO) bad=1 ;; -xO0) bad=1 ;; -xO1) bad=1 ;; -xO2) bad=1 ;; -xO3) bad=1 ;; -xO4) bad=1 ;; -xO5) bad=1 ;; -xO6) bad=1 ;; -xO7) bad=1 ;; -xO8) bad=1 ;; -xO9) bad=1 ;; -fast) bad=1 ;; esac done if test "$bad" = "0"; then result="$OPTFLAGS $arg" else result="$arg" fi } OPTFLAGS="-O" check_opt "$CFLAGS" CFLAGS="$result" check_opt "$CXXFLAGS" CXXFLAGS="$result" check_opt "$FFLAGS" FFLAGS="$result" # Since we're not doing -fast for Solaris anymore, we don't need to # add -O to the LDFLAGS (checked the man pages on a couple of # architectures, and this seems to be true). So we'll just leave # those alone. #check_opt "$USER_LDFLAGS" #USER_LDFLAGS=$result #check_opt "$USER_CXXLDFLAGS" #USER_CXXLDFLAGS=$result # Take care of some specific compiler options. # Force use of ANSI C under HP-UX. ROMIO_FLAGS= if test "$ac_cv_prog_gcc" = no; then us=`(uname -s) 2>/dev/null` || us=unknown case "$us" in HP-UX) CPPFLAGS="$CPPFLAGS -Ae" ROMIO_FLAGS="+U77" if test "$lam_cflags_save" = set; then CFLAGS="-Ae" else CFLAGS="$CFLAGS -Ae" fi ;; *) ;; esac fi # Delay the substitution of CFLAGS and CXXFLAGS until later, mainly # for aesthetic reasons (so that the ugly '-I$(top_srcdir)' doesn't # show up in the configure tests. AC_SUBST(FFLAGS) AC_SUBST(ROMIO_FLAGS) AC_SUBST(USER_LDFLAGS) AC_SUBST(USER_CXXLDFLAGS) LAM_ANSI_PROTOS if test "$lam_ac_ansi_protos" = no; then AC_MSG_ERROR(LAM requires a compiler which understands ANSI C prototypes) fi # Is this even used anymore? # How to specify a directory for the library archive search path. us=`(uname -s) 2>/dev/null` || us=unknown case "$us" in HP-UX) FLIBPATH="\"-Wl,-L\"" ;; *) FLIBPATH="\"-L\"" ;; esac AC_DEFINE_UNQUOTED(LAM_FLIBPATH, $FLIBPATH) # check for specification of FORTRAN compiler # define WAVE1D_EXAMPLE (a FORTRAN example) to be "wave1d" if were # building FORTRAN support, or empty if not F77= F77_BUILD_DIR= F77_LTPLIB= ROMIO_NOF77= FPI_EXAMPLE= WAVE1D_EXAMPLE= TRIVIALF_EXAMPLE= AC_MSG_CHECKING([if want FORTRAN support]) if test "$with_fc" = no; then F77=false LAM_F77="false" ROMIO_NOF77="-nof77" AC_MSG_RESULT([no]) AC_DEFINE(LAM_WANT_FORTRAN, 0) else AC_MSG_RESULT([yes]) if test -n "$FC"; then # AC_CHECK_PROG* only checks for the user specified compiler in the # users $PATH. Arrgh! # It does not address the case where the user specifies an absolute # filename that is *not* in their $PATH. FC0="`echo $FC | awk '{ print $1 }'`" ISABS=`echo $FC0 | cut -c1` if test "$ISABS" = "/" -a -x "$FC0"; then F77="$FC" AC_MSG_CHECKING([for FORTRAN compiler $FC0]) AC_MSG_RESULT([found]) else AC_CHECK_PROGS(F77, $FC0) fi if test -z "$F77"; then AC_DEFINE(LAM_WANT_FORTRAN, 0) AC_MSG_ERROR(could not find FORTRAN compiler $FC0) else AC_DEFINE(LAM_WANT_FORTRAN, 1) fi else # If the user did not specify one, look for all the common names AC_CHECK_PROGS(F77, [f77 fort77 g77 f90], no) if test -z "$F77" -o "$F77" = "no"; then AC_DEFINE(LAM_WANT_FORTRAN, 0) AC_MSG_WARN([*** Could not find FORTRAN compiler. Either use]) AC_MSG_WARN([*** --with-fc to specify the FORTRAN compiler, or]) AC_MSG_WARN([*** --without-fc to specify no FORTRAN support]) AC_MSG_ERROR([cannot continue current configuration without FORTRAN compiler]) else AC_DEFINE(LAM_WANT_FORTRAN, 1) fi fi LAM_F77="$F77" F77_BUILD_DIR=f77 F77_LTPLIB=f77/liblamf77pmpi.la FPI_EXAMPLE=fpi WAVE1D_EXAMPLE=wave1d TRIVIALF_EXAMPLE=trivialf fi AC_DEFINE_UNQUOTED(LAM_F77, "$LAM_F77") AC_SUBST(F77_BUILD_DIR) AC_SUBST(F77_LTPLIB) AC_SUBST(ROMIO_NOF77) AC_SUBST(FPI_EXAMPLE) AC_SUBST(WAVE1D_EXAMPLE) AC_SUBST(TRIVIALF_EXAMPLE) # check for threads THREADCFLAGS= THREADLDFLAGS= THREADCXXFLAGS= THREADCXXLDFLAGS= WANT_MT=no AC_MSG_CHECKING([if want multithreaded support]); AC_ARG_WITH(threads, [ --with-thread enable thread support in LAM (still experimental)],[WANT_MT=$withval]) AC_MSG_RESULT([$WANT_MT]) if test "$WANT_MT" = "yes"; then # If were in solaris, check for Solaris threads case "$host" in *solaris*) libs_SAVE="$LIBS" AC_CHECK_LIB(thread, thr_create, HAVE_SOL_THREADS=1, HAVE_SOL_THREADS=0) LIBS="$libs_SAVE" ;; esac if test "$HAVE_SOL_THREADS" = "1"; then if test "$BASECC" = "cc"; then THREADCFLAGS="-mt" THREADCXXFLAGS="$THREADCFLAGS" THREADLDFLAGS="-mt" THREADCXXLDFLAGS="$THREADLDFLAGS" else THREADCFLAGS="-D_REENTRANT" THREADCXXFLAGS="$THREADCFLAGS" THREADLDFLAGS="-lthread" THREADCXXLDFLAGS="$THREADLDFLAGS" fi if test "$BASECXX" = "CC"; then THREADCFLAGS="-mt" THREADCXXFLAGS="$THREADCFLAGS" THREADLDFLAGS="-mt" THREADCXXLDFLAGS="$THREADLDFLAGS" elif test "$BASECXX" = "KCC"; then THREADCFLAGS="--backend -mt" THREADCXXFLAGS="$THREADCFLAGS" THREADLDFLAGS="--backend -mt" THREADCXXLDFLAGS="$THREADLDFLAGS" else THREADCFLAGS="-D_REENTRANT" THREADCXXFLAGS="$THREADCFLAGS" THREADLDFLAGS="-lthread" THREADCXXLDFLAGS="$THREADLDFLAGS" fi AC_DEFINE(LAM_HAVE_SOL_THREADS, 1) AC_DEFINE(LAM_HAVE_PTHREADS, 0) else AC_DEFINE(LAM_HAVE_SOL_THREADS, 0) libs_SAVE="$LIBS" AC_CHECK_LIB(pthread, pthread_create, HAVE_PTHREADS=1, HAVE_PTHREADS=0) LIBS="$libs_SAVE" if test "$HAVE_PTHREADS" = "1"; then AC_DEFINE(LAM_HAVE_PTHREADS, 1) THREADCFLAGS="-D_REENTRANT" THREADLDFLAGS="-lpthread" THREADCXXCFLAGS="$THREADCFLAGS" THREADCXXLDFLAGS="$THREADCXXLDFLAGS" else AC_DEFINE(LAM_HAVE_PTHREADS, 0) fi fi else # No thread support AC_DEFINE(LAM_HAVE_PTHREADS, 0) AC_DEFINE(LAM_HAVE_SOL_THREADS, 0) fi AC_SUBST(THREADCFLAGS) AC_SUBST(THREADLDFLAGS) AC_SUBST(THREADCXXFLAGS) AC_SUBST(THREADCXXLDFLAGS) # we have waited until all the compiler checking is done before checking this RPISYSLIBS= # check if using pthread lock AC_ARG_WITH(pthread_lock, [ --with-pthread-lock use pthread mutex lock for shared memory pool]) if test "$with_pthread_lock" = yes; then case "$rpi" in usysv) LAM_MUTEX_PSHARED if test "$lam_ac_mutex_pshared" = no; then echo 'ignoring --with-pthread-lock' else RPIFLAGS="$RPIFLAGS -DPTHREAD_FREELOCK" RPISYSLIBS="$RPISYSLIBS -lpthread" fi ;; *) AC_MSG_WARN(use of pthread mutex lock not supported in RPI $rpi) ;; esac fi AC_SUBST(RPISYSLIBS) # # This is in share/boot/inetexec.c -- looks like a remnant of some old # flavors of rsh, but we'll keep the code anyway, just in case... # AC_DEFINE(LAM_RSH_NEED_MINUSMINUS, 0) # Check for programs. # Abort if we cannot find one of them AC_PROG_CPP if test "$CPP" = ""; then AC_MSG_ERROR([Could not find C preprocessor. Cannot continue.]) fi AC_PROG_LN_S if test "$LN_S" = ""; then AC_MSG_ERROR([Could not find command for symbolic links (ln). Cannot continue.]) fi AC_PATH_PROG(CP,cp) if test "$CP" = ""; then AC_MSG_ERROR([Could not find cp. Cannot continue.]) fi AC_PATH_PROG(RM,rm) if test "$RM" = ""; then AC_MSG_ERROR([Could not find rm. Cannot continue.]) fi AC_DEFINE_UNQUOTED(LAM_RM, "$RM -f") AC_PATH_PROG(SED,sed) if test "$SED" = ""; then AC_MSG_ERROR([Could not find sed. Cannot continue.]) fi AC_PATH_PROG(SHELL_CMD,sh) if test "$SHELL_CMD" = ""; then AC_MSG_ERROR([Could not find Bourne shell. Cannot continue.]) fi # figure out the remote shell command # if not explicitly specified by the user then # remsh as remote shell on HP-UX and rsh on all others RSH0= RSH= AC_ARG_WITH(rsh, [ --with-rsh=RSH use RSH for the remote shell command], [ case "$withval" in /*) RSH0=$withval ;; # We can do this set stuff here because we're long past command line # parsing *) set $withval RSH0="$1" shift RSH="$*" AC_PATH_PROG(RSH0, $withval) ;; esac], [ us=`(uname -s) 2>/dev/null` || us=unknown case "$us" in HP-UX) AC_PATH_PROG(RSH0, remsh) ;; *) AC_PATH_PROG(RSH0, rsh) ;; esac]) # make sure we have a remote shell command AC_MSG_CHECKING([for remote shell command]) if test -z "$RSH0"; then AC_MSG_ERROR(could not find remote shell command) fi AC_MSG_RESULT([$RSH0 $RSH]) RSH="\"$RSH0 $RSH\"" AC_DEFINE_UNQUOTED(LAM_RSH, $RSH) # do we have a broken compiler that does not defined __STDC__ even # though it really is? Hard coded for the moment for Solaris cc. # can extend the hard coding or make a real test # Does not hurt here to AC_DEFINE LAM_CONFIG_FORCE_PROTOS to 0, because # LAM_CONFIG_FORCE_PROTOS is only one of multiple constants checked to see if # we want prototypes. if test "`echo $host | grep solaris2`" != "" -a "$BASECC" = "cc"; then AC_DEFINE(LAM_CONFIG_FORCE_PROTOS, 1) elif test "$ac_cv_prog_gcc" = "yes"; then AC_DEFINE(LAM_CONFIG_FORCE_PROTOS, 1) else # At least some compilers don't want to be forced -- e.g., HP-UX 10.20 # which is not ANSI by default AC_DEFINE(LAM_CONFIG_FORCE_PROTOS, 0) LAM_CHECK_STDC fi # If we want things to be purify/bcheck/general-memory-checking-debugger # clean, set this flag so that LAM will always zero memory in known # trouble spots. May cause slight overhead in sending/receiving, since # buffers are zeroed before using, hence, it is an option AC_MSG_CHECKING([if want purify clean]) WANT_PURIFY=no AC_ARG_WITH(purify, [ --with-purify ensure to zero memory before using (see docs)], [WANT_PURIFY=$withval]) if test "$WANT_PURIFY" = "yes"; then AC_DEFINE(LAM_DISINFECT, 1) else AC_DEFINE(LAM_DISINFECT, 0) fi AC_MSG_RESULT([$WANT_PURIFY]) # transport tunable defaults TCPSHORT=65536 SHMSHORT=8192 SHMPOOL=0 SHMALLOC=0 # transport AC_ARG_WITH(tcpshort, [ --with-tcp-short=BYTES use BYTES as the size of the longest TCP short message]) if test -n "$with_tcp_short"; then TCPSHORT=$with_tcp_short fi AC_MSG_CHECKING([for TCP short message length]) AC_MSG_RESULT([$TCPSHORT bytes]) case "$rpi" in *sysv) AC_ARG_WITH(shmshort, [ --with-shm-short=BYTES use BYTES as the size of the longest shared memory short message]) if test -n "$with_shm_short"; then SHMSHORT=$with_shm_short fi echo using shared memory short message length of $SHMSHORT bytes AC_ARG_WITH(shm-poolsize, [ --with-shm-poolsize=BYTES make the shared memory pool BYTES in size]) if test -n "$with_shm_poolsize"; then SHMPOOL=$with_shm_poolsize echo using shared memory pool of $SHMPOOL bytes fi AC_ARG_WITH(shm-maxalloc, [ --with-shm-maxalloc=BYTES make BYTES the maximum allocation from the shared pool]) if test -n "$with_shm_maxalloc"; then SHMALLOC=$with_shm_maxalloc echo using maximum shared memory allocation of $SHMALLOC bytes fi if test -z "$with_shm_poolsize"; then if test -z "$with_shm_maxalloc"; then AC_MSG_CHECKING(["shared memory poolsize"]) LAM_GET_SHMMAX($SHMSHORT,SHMPOOL,SHMALLOC) AC_MSG_RESULT([$SHMPOOL bytes]) AC_MSG_CHECKING(["shared memory maxalloc"]) AC_MSG_RESULT([$SHMALLOC bytes]) else AC_MSG_CHECKING(["shared memory poolsize"]) LAM_GET_SHMMAX($SHMSHORT,SHMPOOL,SHMALLOC) AC_MSG_RESULT([$SHMPOOL bytes]) fi else if test -z "$with_shm_maxalloc"; then AC_MSG_CHECKING(["shared memory maxalloc"]) LAM_GET_SHMMAX($SHMSHORT,SHMPOOL,SHMALLOC) AC_MSG_RESULT([$SHMALLOC bytes]) fi fi if test \( $SHMPOOL -eq 0 \) -o \( $SHMALLOC -eq 0 \); then AC_MSG_ERROR([determining shared memory parameters Please check that your system supports SYSV shared memory segments of 1MB or more. You can also try explicitly setting both the poolsize and maxalloc parameters.]) fi ;; esac AC_DEFINE_UNQUOTED(TCPSHORTMSGLEN, $TCPSHORT) AC_DEFINE_UNQUOTED(SHMSHORTMSGLEN, $SHMSHORT) AC_DEFINE_UNQUOTED(LAM_MPI_SHMPOOLSIZE, $SHMPOOL) AC_DEFINE_UNQUOTED(LAM_MPI_SHMMAXALLOC, $SHMALLOC) # lamd defaults # used to be in config.mk (Makefile include), but now have to be here # since we switched to automake TO_BOOT=60 TO_DLO_ACK=1 TO_DLO_IDLE=120 AC_ARG_WITH(lamd-boot, [ --with-lamd-boot=SEC timeout (seconds) for booted node], TO_BOOT=$withval) AC_ARG_WITH(lamd-ack, [ --with-lamd-ack=SEC seconds until a packet is resent], TO_DLO_ACK=$withval) AC_ARG_WITH(lamd-hb, [ --with-lamd-hb=SEC seconds until heartbeat send to remote lamd], TO_DLO_IDLE=$withval) # Just for cosmetics AC_MSG_CHECKING(["for desired boot timeout"]) AC_MSG_RESULT(["$TO_BOOT seconds"]) AC_MSG_CHECKING(["for desired lamd packet resend time"]) AC_MSG_RESULT(["$TO_DLO_ACK seconds"]) AC_MSG_CHECKING(["for desired lamd heartbeat time"]) AC_MSG_RESULT(["$TO_DLO_IDLE seconds"]) AC_DEFINE_UNQUOTED(LAM_TO_BOOT, $TO_BOOT) AC_DEFINE_UNQUOTED(LAM_TO_DLO_ACK, $TO_DLO_ACK) AC_DEFINE_UNQUOTED(LAM_TO_DLO_IDLE, $TO_DLO_IDLE) # Checks for typedefs, structures, and compiler characteristics. AC_C_BIGENDIAN # AC_C_CHAR_UNSIGNED # AC_C_CONST # AC_C_LONG_DOUBLE # AC_TYPE_OFF_T # AC_TYPE_PID_T # AC_TYPE_SIZE_T # AC_HEADER_TIME # Check for library functions. AC_CHECK_FUNCS(atexit getcwd yield snprintf atoll strtoll) # Really crude checks for prototypes LAM_CHECK_PROTOTYPE(snprintf) LAM_CHECK_PROTOTYPE(gethostname) # JMS Take out the solaris one right now in favor of normal "yield" # (checked for above), because until minutes ago, this test was broken # and sched_yield was not found on Solaris. However, I don't want to # investigate the possibility of including -lposix4 on Solaris right # now -- the next release of LAM is immanent. Perhaps later... case $host in # *solaris*) LAM_CHECK_FUNC(sched_yield, HAVE_SCHED_YIELD, -lposix4) # ;; *) AC_CHECK_FUNCS(sched_yield) ;; esac # #$%^#$%^$#%^ IRIX 7.3 MIPSpro compilers... have_sys_types=1 if test "`grep sys/types.h confdefs.h`" = ""; then echo "#include " >> confdefs.h have_sys_types=0 fi AC_CHECK_HEADERS([stropts.h grp.h netinet/tcp.h rpc/types.h rpc/xdr.h pty.h]) if test "$have_sys_types" = "0"; then rm -f confdefs.h.new grep -v sys/types.h confdefs.h > confdefs.h.new mv confdefs.h.new confdefs.h fi AC_CACHE_CHECK([if SA_RESTART defined in signal.h], lam_cv_def_sa_restart, [AC_EGREP_CPP(yes, [ #include #ifdef SA_RESTART yes #endif ],lam_cv_def_sa_restart=yes,lam_cv_def_sa_restart=no) ]) if test $lam_cv_def_sa_restart = yes; then AC_DEFINE(LAM_HAVE_SA_RESTART, 1) else AC_DEFINE(LAM_HAVE_SA_RESTART, 0) fi AC_CACHE_CHECK([for sa_len in struct sockaddr], lam_cv_struct_sa_len, [AC_TRY_COMPILE([#include #include ], [struct sockaddr s; s.sa_len;], lam_cv_struct_sa_len=yes, lam_cv_struct_sa_len=no)]) if test $lam_cv_struct_sa_len = yes; then AC_DEFINE(LAM_HAVE_SA_LEN, 1) else AC_DEFINE(LAM_HAVE_SA_LEN, 0) fi AC_CACHE_CHECK([for union semun in sys/sem.h], lam_cv_union_semun, [AC_TRY_COMPILE([#include #include ], [union semun s; s.val;], lam_cv_union_semun=yes, lam_cv_union_semun=no)]) if test $lam_cv_union_semun = yes; then AC_DEFINE(LAM_HAVE_UNION_SEMUN) fi # This is complicated enough to warrant a long explanation. # # So apparently, in 64 bit mode on AIX 4.3.3, fcntl(F_SETFL, # O_NONBLOCK) (you get the idea) is broken. Sometimes. i.e., # sometimes, setting a socket to go into blocking mode just doesn't # work. When it doesn't work, read() will return -1 and set errno to # EAGAIN, which is nonblocking behavior. But when the socket is # supposed to be in blocking mode, LAM doesn't look at errno -- it # just sees the -1 and decides that "a process in the local group is # dead". # # So we originally put in a test to check for FIONBIO and to use # ioctl(FIONBIO) instead of fcntl() wherever FIONBIO exists. However, # at least on one system (HP-UX 10.20), FIONBIO is broken, and fcntl() # works. The argument was made that we *know* that fcntl() works # everywhere except AIX 4.3.3 (since LAM has always only had fcntl(), # not ioctl()). Plus, Stevens (the networking book) says that POSIX # says use fcntl(). # # Hence, we are now special-casing AIX 4.3.3 -- if we are on AIX, look # for FIONBIO. If it's there, use ioctl. Otherwise, always use # fcntl(). Yet another reason that AIX absolutely sucks. case "$host" in *aix*) AC_CACHE_CHECK([if FIONBIO defined in sys/ioctl.h], lam_cv_def_fionbio, [AC_EGREP_CPP(yes, [ #include #ifdef FIONBIO yes #endif ],lam_cv_def_fionbio=yes,lam_cv_def_fionbio=no)]) if test $lam_cv_def_fionbio = yes; then AC_DEFINE(LAM_HAVE_FIONBIO, 1) else AC_DEFINE(LAM_HAVE_FIONBIO, 0) fi ;; *) # If we're not on AIX, just use fcntl AC_MSG_CHECKING([if FIONBIO defined in sys/ioctl.h]) AC_DEFINE(LAM_HAVE_FIONBIO, 0) AC_MSG_RESULT([not on AIX 4.3.3, so who cares?]) ;; esac AC_CACHE_CHECK([if need to include sys/select.h], lam_cv_need_sys_select_h, [AC_TRY_COMPILE([#include #include ], [fd_set s; FD_ZERO(&s);], lam_cv_need_sys_select_h=no, lam_cv_need_sys_select_h=yes)]) if test $lam_cv_need_sys_select_h = yes; then AC_DEFINE(LAM_NEED_SYS_SELECT_H) fi AC_CACHE_CHECK([for BSD43 style file descriptor passing], lam_cv_have_bsd43_fd_passing, [AC_TRY_COMPILE([#include #include ], [struct msghdr m; m.msg_accrights = 0;], lam_cv_have_bsd43_fd_passing=yes, lam_cv_have_bsd43_fd_passing=no)]) if test $lam_cv_have_bsd43_fd_passing = yes; then AC_DEFINE(LAM_HAVE_BSD43_FD_PASSING) fi AC_CACHE_CHECK([for BSD44 style file descriptor passing], lam_cv_have_bsd44_fd_passing, [AC_TRY_COMPILE([#include #include #include ], [struct cmsghdr c; c.cmsg_type = 0;], lam_cv_have_bsd44_fd_passing=yes, lam_cv_have_bsd44_fd_passing=no)]) if test $lam_cv_have_bsd44_fd_passing = yes; then AC_DEFINE(LAM_HAVE_BSD44_FD_PASSING) fi AC_CACHE_CHECK([for SYSV style file descriptor passing], lam_cv_have_sysv_fd_passing, [AC_TRY_COMPILE([#include #include #include ], [struct strrecvfd c; c.fd = 0;], lam_cv_have_sysv_fd_passing=yes, lam_cv_have_sysv_fd_passing=no)]) if test $lam_cv_have_sysv_fd_passing = yes; then AC_DEFINE(LAM_HAVE_SVR4_FD_PASSING) fi # # Do we have openpty()? # In Linux, openpty is in -lutil -- it is VERY IMPORTANT TO ADD -lutil # TO LIBS SO THAT LAM_CHECK_FUNC WORKS PROPERLY! # configure_libs_SAVE="$LIBS" AC_CHECK_LIB(util, login, SYSLIBS="$SYSLIBS -lutil" LIBS="$LIBS -lutil") LAM_CHECK_FUNC(openpty, LAM_HAVE_OPENPTY) LIBS="$configure_libs_SAVE" # # How about other PTY things? # AC_CACHE_CHECK([for BSD ptys], lam_cv_have_bsd_ptys, if test -r /dev/ptyp0 -a -w /dev/ptyp0; then lam_cv_have_bsd_ptys=yes else lam_cv_have_bsd_ptys=no fi) if test $lam_cv_have_bsd_ptys = yes; then AC_DEFINE(LAM_HAVE_BSD_PTYS) fi AC_CACHE_CHECK([for SYSV ptys], lam_cv_have_sysv_ptys, if test -r /dev/ptmx -a -w /dev/ptmx; then lam_cv_have_sysv_ptys=yes else lam_cv_have_sysv_ptys=no fi) if test $lam_cv_have_sysv_ptys = yes; then AC_DEFINE(LAM_HAVE_SYSV_PTYS) fi if test $lam_cv_have_sysv_ptys = no -a $lam_cv_have_bsd_ptys = no; then AC_MSG_WARN(neither BSD or SYSV ptys are available) fi # check for AC_CHECK_HEADERS(sched.h) # check for AC_CHECK_HEADERS(strings.h) # At least AIX 4.3 has things like int8 already defined LAM_CHECK_TYPE(int2) LAM_CHECK_TYPE(uint2) LAM_CHECK_TYPE(int4) LAM_CHECK_TYPE(uint4) LAM_CHECK_TYPE(int8) LAM_CHECK_TYPE(uint8) LAM_CHECK_TYPE(float4) LAM_CHECK_TYPE(float8) # Type sizes LAM_GET_SIZEOF(short, LAM_SIZEOF_SHORT) LAM_GET_SIZEOF(wchar_t, LAM_SIZEOF_WCHAR) LAM_GET_SIZEOF(int, LAM_SIZEOF_INT) LAM_GET_SIZEOF(long, LAM_SIZEOF_LONG) LAM_GET_SIZEOF(long long, LAM_SIZEOF_LONG_LONG) LAM_GET_SIZEOF(float, LAM_SIZEOF_FLOAT) LAM_GET_SIZEOF(double, LAM_SIZEOF_DOUBLE) LAM_GET_SIZEOF(long double, LAM_SIZEOF_LONG_DOUBLE) LAM_GET_SIZEOF(void *, LAM_SIZEOF_VOID_P) LAM_CHECK_SIZEOF_STRUCT_STAT_MEMBERS LAM_CHECK_TYPEOF_GETSOCKOPT_OPTLEN LAM_CHECK_TYPEOF_RECVFROM_LEN LAM_GET_ALIGNMENT_CACHE(short,lam_cv_align_short,LAM_ALIGNMENT_SHORT) LAM_GET_ALIGNMENT_CACHE(wchar_t,lam_cv_align_wchar,LAM_ALIGNMENT_WCHAR) LAM_GET_ALIGNMENT_CACHE(int,lam_cv_align_int,LAM_ALIGNMENT_INT) LAM_GET_ALIGNMENT_CACHE(long,lam_cv_align_long,LAM_ALIGNMENT_LONG) LAM_GET_ALIGNMENT_CACHE(long long,lam_cv_align_longlong,LAM_ALIGNMENT_LONG_LONG) LAM_GET_ALIGNMENT_CACHE(float,lam_cv_align_float,LAM_ALIGNMENT_FLOAT) LAM_GET_ALIGNMENT_CACHE(double,lam_cv_align_double,LAM_ALIGNMENT_DOUBLE) LAM_GET_ALIGNMENT_CACHE(long double,lam_cv_align_longdbl,LAM_ALIGNMENT_LONG_DOUBLE) LAM_GET_ALIGNMENT_CACHE(void *,lam_cv_align_voidp,LAM_ALIGNMENT_VOID_P) if test "$with_fc" != no; then LAM_GET_FORTRAN_EXT_NAME_CONVENTION($F77) LAM_GET_SIZEOF_FORTRAN_TYPE_CACHE(INTEGER,lam_cv_size_fint, LAM_SIZEOF_FORTRAN_INT) LAM_GET_SIZEOF_FORTRAN_TYPE_CACHE(REAL,lam_cv_size_freal, LAM_SIZEOF_FORTRAN_REAL) LAM_GET_SIZEOF_FORTRAN_TYPE_CACHE(DOUBLE PRECISION,lam_cv_size_fdprec, LAM_SIZEOF_FORTRAN_DBLPREC) LAM_GET_SIZEOF_FORTRAN_TYPE_CACHE(COMPLEX,lam_cv_size_fcomplex, LAM_SIZEOF_FORTRAN_COMPLEX) LAM_GET_SIZEOF_FORTRAN_TYPE_CACHE(DOUBLE COMPLEX,lam_cv_size_fdcomplex, LAM_SIZEOF_FORTRAN_DBLCOMPLEX) LAM_GET_FORTRAN_ALIGNMENT_CACHE(INTEGER,lam_cv_align_fint, LAM_ALIGNMENT_FORTRAN_INT) LAM_GET_FORTRAN_ALIGNMENT_CACHE(REAL,lam_cv_align_freal, LAM_ALIGNMENT_FORTRAN_REAL) LAM_GET_FORTRAN_ALIGNMENT_CACHE(DOUBLE PRECISION,lam_cv_align_fdprec, LAM_ALIGNMENT_FORTRAN_COMPLEX) LAM_GET_FORTRAN_ALIGNMENT_CACHE(COMPLEX,lam_cv_align_fcomplex, LAM_ALIGNMENT_FORTRAN_DBLPREC) LAM_GET_FORTRAN_ALIGNMENT_CACHE(DOUBLE COMPLEX,lam_cv_align_fdcomplex, LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX) # check that alignment of double precsion and corresponding C type are same if test "$lam_cv_size_fdprec" = "$ac_cv_sizeof_double"; then if test "$lam_cv_align_fdprec" != "$lam_cv_align_double"; then AC_MSG_WARN([alignment of Fortran double precsion and C double are not the same]) fi elif test "$lam_cv_size_fdprec" = "$ac_cv_sizeof_long_double"; then if test "$lam_cv_align_fdprec" != "$lam_cv_align_longdbl"; then AC_MSG_WARN([alignment of Fortran double precsion and C long double are not the same]) fi fi fi # Finally, make an "INSTALL_HOME" available for the example proc schemas INSTALL_HOME=`pwd` AC_SUBST(INSTALL_HOME) # This is needed for VPATH builds, so that it will -I the appropriate # include directory (don't know why automake doesn't do this # automatically). We delayed doing it until now just so that # '-I$(top_srcdir)' doesn't show up in any of the configure output -- # purely aesthetic. dir="$srcdir"; if test "$srcdir" = "."; then dir="`pwd`" fi CFLAGS='-I$(top_srcdir)/share/include'" $CFLAGS" CXXFLAGS='-I$(top_srcdir)/share/include'" $CXXFLAGS" AC_SUBST(CXXFLAGS) AC_SUBST(CFLAGS) # # libtool magic # AM_PROG_LIBTOOL # # Party on # AC_OUTPUT([ Makefile etc/Makefile examples/Makefile examples/alltoall/Makefile examples/fault/Makefile examples/mandelbrot/Makefile examples/mandelbrot/myapp examples/mpi2c++/Makefile examples/pi/Makefile examples/ring/Makefile examples/romio/Makefile examples/trivial/Makefile examples/trivial/myapp examples/wave1d/Makefile examples/wave1d/myapp man/Makefile man/man1/Makefile man/man2/Makefile man/man3/Makefile man/man5/Makefile man/man7/Makefile man/mans/Makefile otb/Makefile otb/bfctl/Makefile otb/bfstate/Makefile otb/doom/Makefile otb/fctl/Makefile otb/filedr/Makefile otb/fstate/Makefile otb/ipcdr/Makefile otb/kdump/Makefile otb/lamclean/Makefile otb/lamexec/Makefile otb/lamgrow/Makefile otb/lamshrink/Makefile otb/lamtrace/Makefile otb/loadgo/Makefile otb/mpimsg/Makefile otb/mpirun/Makefile otb/mpitask/Makefile otb/state/Makefile otb/sys/Makefile otb/sys/bforward/Makefile otb/sys/bufferd/Makefile otb/sys/dli_inet/Makefile otb/sys/dlo_inet/Makefile otb/sys/echod/Makefile otb/sys/filed/Makefile otb/sys/flatd/Makefile otb/sys/iod/Makefile otb/sys/haltd/Makefile otb/sys/kenyad/Makefile otb/sys/kernel/Makefile otb/sys/loadd/Makefile otb/sys/router/Makefile otb/sys/traced/Makefile otb/sys/lamd/Makefile otb/sys/impid/Makefile otb/tping/Makefile share/Makefile share/args/Makefile share/boot/Makefile share/etc/Makefile share/freq/Makefile share/impi/Makefile share/kreq/Makefile share/include/Makefile share/include/mpif.h share/include/patchlevel.h share/mpi/Makefile share/mpi/f77/Makefile share/nreq/Makefile share/pmpi/Makefile share/pmpi/f77/Makefile share/rpi/Makefile share/rpi/c2c/Makefile share/rpi/lamd/Makefile share/rpi/myri/Makefile share/rpi/via/Makefile share/rpi/shmem/Makefile share/rpi/sysv/Makefile share/rpi/tcp/Makefile share/rpi/usysv/Makefile share/rreq/Makefile share/trillium/Makefile share/tstdio/Makefile tools/Makefile tools/hboot/Makefile tools/hcc/Makefile tools/hcc/hcp tools/hf77/Makefile tools/lamboot/Makefile tools/lamhalt/Makefile tools/lamnodes/Makefile tools/recon/Makefile tools/tkill/Makefile tools/wipe/Makefile romio/util/lam-configure-values ], [chmod a+x tools/hcc/hcp romio/util/lam-configure-values]) # ARRGGGHHH!!! #$%@#$%@#$% IRIX. It seems that their "make" either # has date analysis precision of less than 1 second, or it rules that # files of the same timestamp (according to ls -l, anyway) are out of # date w.r.t. each other. # For an example of what I mean, go to share/include and do "make". # Then do "make" again. Try it on some other operating system (e.g., # Solaris, Linux). Why does IRIX fire the same rule twice in a row? # The result of this is that config.status is run for *every* # invocation of "make" on IRIX systems, which, if the "rm" statement # below was included in the AC_OUTPUT macro (as it really should be), # would remove the sentinel files in ROMIO and the C++ bindings, # resulting in ROMIO and the C++ bindings being built *every* time. # ARRGHHH!!! # The only real solution that we can come up with (without being # overly complicated; this just isn't worth it) is to move this rm # statement out of the AC_OUTPUT macro. Hence, they'll only be # deleted via respective "*clean" targets and when configure is run. # This *shouldn't* be too much of a problem, because the "rebuilt # share/include/lam_config.h" mechanism built in to config.status will # really only be effective for those who run "make depend", which is # generally only the developers. Ugh!!! rm -f .lam_built romio/.lam_built mpi2c++/.lam_built