# -*- shell-script -*- # # Copyright (c) 2001-2005 The Trustees of Indiana University. # All rights reserved. # Copyright (c) 1998-2001 University of Notre Dame. # All rights reserved. # Copyright (c) 1994-1998 The Ohio State University. # All rights reserved. # # This file is part of the LAM/MPI software package. For license # information, see the LICENSE file in the top level directory of the # LAM/MPI source distribution. # # $Id: configure.in,v 6.356 2003/12/19 03:05:05 pcharapa Exp $ # ############################################################################ # Initialization, version number, and other random setup/init stuff ############################################################################ # Init autoconf AC_INIT(./share/mpi/init.c) AC_PREREQ(2.52) AC_CONFIG_AUX_DIR(./config) # Get the version of LAM that we are installing LAM_GET_VERSION($srcdir/config, $srcdir/VERSION, LAM) AC_DEFINE_UNQUOTED(LAM_MAJOR_VERSION, $LAM_MAJOR_VERSION, [Major LAM version]) AC_DEFINE_UNQUOTED(LAM_MINOR_VERSION, $LAM_MINOR_VERSION, [Minor LAM version]) AC_DEFINE_UNQUOTED(LAM_RELEASE_VERSION, $LAM_RELEASE_VERSION, [Release LAM version]) AC_DEFINE_UNQUOTED(LAM_ALPHA_VERSION, $LAM_ALPHA_VERSION, [Alpha LAM version]) AC_DEFINE_UNQUOTED(LAM_BETA_VERSION, $LAM_BETA_VERSION, [Beta LAM version]) AC_DEFINE_UNQUOTED(LAM_SVN_VERSION, $LAM_SVN_VERSION, [SVN LAM version]) AC_DEFINE_UNQUOTED(LAM_VERSION, "$LAM_VERSION", [Overall LAM version number]) # 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_SVN_VERSION) AC_SUBST(LAM_VERSION) # # Start it up # LAM_CONFIGURE_SETUP lam_show_title "Configuring LAM version $LAM_VERSION" lam_show_subtitle "Initialization, setup" # # Init automake # The third argument to AM_INIT_AUTOMAKE surpresses the PACKAGE and # VERSION macors # AM_INIT_AUTOMAKE(lam, $LAM_VERSION, 'no') LAM_TOP_BUILDDIR="`pwd`" cd "$srcdir" LAM_TOP_SRCDIR="`pwd`" cd "$LAM_TOP_BUILDDIR" AC_MSG_NOTICE([builddir: $LAM_TOP_BUILDDIR]) AC_MSG_NOTICE([srcdir: $LAM_TOP_SRCDIR]) # Setup the top of the share/include/lam_config.h file AH_TOP([/* -*- c -*- * * Copyright (c) 2001-2002 The Trustees of Indiana University. * All rights reserved. * Copyright (c) 1998-2001 University of Notre Dame. * All rights reserved. * Copyright (c) 1994-1998 The Ohio State University. * All rights reserved. * * This file is part of the LAM/MPI software package. For license * information, see the LICENSE file in the top level directory of the * LAM/MPI source distribution. * * Function: - OS, CPU and compiler dependent configuration */ #ifndef _LAM_CONFIG_H #define _LAM_CONFIG_H ]) # There's a *lot* of hardwired values and macros that need to be in # lam_config.h. So rather than having a huge AH_BOTTOM here in # configure.in, they have all been moved to , and # we simply include it at the bottom of . AH_BOTTOM([#include #endif /* _LAM_CONFIG_H */]) # # For debugging # AC_ARG_ENABLE(echo, AC_HELP_STRING([--enable-echo], [echo configure script commands (maintainers only)]), [set -x]) # # This is useful later # LAM_BASIC_SETUP # # AC_DEFINE the some trivial things only so that it changes # lam_config.h if the user reconfigures with a new prefix or on a new # architecture. By dependency analysis, this will then force the # recompilation of just about everything (which is probably overkill), # but it's safer and much better than no re-compilation at all. Note # that we don't actually use the $prefix from lam_config.h -- the # prefix (and its derrivatives) are passed in from relevant # Makefile.am's with -D options because there are legitimate cases # where one needs to override $prefix at "make" time. # # Similar logic for the architecture (i.e., if it's a new # architecture, we want to force a recompilation of everything, e.g., # if the prefix is the same as last time but on a new architecture), # but since it doesn't need to be changed at "make" time, we use a # "real" #define for it. # AC_DEFINE_UNQUOTED(LAM_DEPENDENCY_PREFIX, "$prefix", [LAM installation prefix -- solely for dependency analysis]) AC_DEFINE_UNQUOTED(LAM_ARCH, "$host", [LAM architecture string]) # # Define some variables that are used for display purposes in # share/etc and tools/laminfo. These are defined in lam_build_info.h, not # in lam_config.h (hence the no third argument). # AC_SUBST(LAM_CONFIGURE_USER) AC_SUBST(LAM_CONFIGURE_HOST) AC_SUBST(LAM_CONFIGURE_DATE) # # Set some variables to be initially empty # LIBLAM_EXTRA_LDFLAGS= LIBLAM_EXTRA_LIBS= LIBMPI_EXTRA_LDFLAGS= LIBMPI_EXTRA_LIBS= ################################## # User-specified options for compilers ################################## # # check for specification of fortran compiler # AC_ARG_WITH(fc, AC_HELP_STRING([--with-fc=FC], [use Fortran compiler FC, use --without-fc for no fortran support]), [FC="$withval"]) AC_ARG_VAR([FC], [Fortran compiler]) # # check for specification of Fortran compiler flags # AC_ARG_WITH(fflags, AC_HELP_STRING([--with-fflags], [DEPRECATED: use the env variable FFLAGS instead]), [AC_MSG_WARN([The --with-fflags flag is deprecated. Use the FFLAGS]) AC_MSG_WARN([environment variable instead.]) AC_MSG_ERROR([Cannot continue])]) AC_ARG_VAR([FFLAGS], [Fortran compiler flags]) # # Part one of libtool magic. Enable static so that we have the --with # tests done up here and can check for OS. Save the values of # $enable_static and $enable_shared before setting the defaults, # because if the user specified --[en|dis]able-[static|shared] on the # command line, they'll already be set. In this way, we can tell if # the user requested something or if the default was set here. # lam_enable_shared="$enable_shared" lam_enable_static="$enable_static" AM_DISABLE_SHARED AM_ENABLE_STATIC if test "$enable_static" = "no" -a "$enable_shared" = "yes"; then case "$host" in *apple-darwin*) AC_MSG_WARN([*** It is not possible to build the LAM/MPI supporting]) AC_MSG_WARN([*** infrastructure on Darwin or Mac OS X without static]) AC_MSG_WARN([*** libraries. Note that you can build both shared and]) AC_MSG_WARN([*** static libraries and link your applications against]) AC_MSG_WARN([*** the shared libraries.]) AC_MSG_ERROR([Can not continue]) ;; esac fi if test "$enable_static" ; then case "$host" in *apple-darwin5*|*apple-darwin5*|*apple-darwin6*|*apple-darwin7*|*apple-darwin8*) ;; *apple-darwin*) AC_MSG_WARN([*** Added -Wl,-search_paths_first to wrapper LDFLAGS]) WRAPPER_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS -Wl,-search_paths_first" ;; esac fi ############################################################################ # Check for maintainer mode (secret sauce) ############################################################################ AC_ARG_WITH(llamas, AC_HELP_STRING([--with-llamas=OPTIONS], [options just for LAM developers])) skipssi=0 if test -n "$with_llamas"; then llamas_options="`echo $with_llamas | sed -e 's/,/ /g'`" for option in $llamas_options; do # Presently have no --with-llamas options case "$option" in skipssi) skipssi=1 ;; no) # --without-llamas -- ignore ;; *) # Unknown: ignore ;; esac done # If --with-llamas was specified, we should print out all llamas # options lam_show_subtitle "Llamas-specific options:" cat <" >> confdefs.h have_sys_types=0 fi AC_CHECK_HEADERS([stropts.h grp.h netinet/tcp.h sys/select.h sys/resource.h]) AC_CHECK_HEADERS([rpc/types.h]) AC_CHECK_HEADERS([rpc/xdr.h], [], [], [#if HAVE_RPC_TYPES_H # include # endif ]) AC_CHECK_HEADERS([pty.h util.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_CHECK_HEADERS([sched.h strings.h]) # 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. AC_MSG_CHECKING([if FIONBIO defined in sys/ioctl.h]) case "$host" in *aix*) AC_EGREP_CPP(yes, [ #include #ifdef FIONBIO yes #endif ],[MSG=yes RESULT=1], [MSG=no RESULT=0]) ;; *) MSG="not on AIX 4.3.3, so who cares?" RESULT=0 ;; esac AC_DEFINE_UNQUOTED(LAM_HAVE_FIONBIO, $RESULT, [Whether we need the stupid FIONBIO #define is in ]) AC_MSG_RESULT([$MSG]) # # Look for some constants and types # AC_MSG_CHECKING([if SA_RESTART defined in signal.h]) AC_EGREP_CPP(yes, [ #include #ifdef SA_RESTART yes #endif ], [MSG=yes VALUE=1], [MSG=no VALUE=0]) AC_DEFINE_UNQUOTED(LAM_HAVE_SA_RESTART, $VALUE, [Whether we have SA_RESTART in or not]) AC_MSG_RESULT([$MSG]) AC_MSG_CHECKING([for sa_len in struct sockaddr]) AC_TRY_COMPILE([#include #include ], [struct sockaddr s; s.sa_len;], [MSG=yes VALUE=1], [MSG=no VALUE=0]) AC_DEFINE_UNQUOTED(LAM_HAVE_SA_LEN, $VALUE, [Whether we have the sa_len struct in or not]) AC_MSG_RESULT([$MSG]) AC_MSG_CHECKING([if need to include sys/select.h]) AC_TRY_COMPILE([#include #include ], [fd_set s; FD_ZERO(&s);], [MSG=yes VALUE=1], [MSG=no VALUE=0]) AC_DEFINE_UNQUOTED(LAM_NEED_SYS_SELECT_H, $VALUE, [Whether we need or not]) AC_MSG_RESULT([$MSG]) ################################## # Libraries ################################## # # Check for -lsocket -lnsl # libs_SAVE="$LIBS" lam_need_socket=0 lam_need_nsl=0 AC_CHECK_FUNC(socket, lam_need_socket=0, lam_need_socket=1) if test "$lam_need_socket" = "1"; then AC_CHECK_LIB(socket, socket, WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS -lsocket" LIBLAM_EXTRA_LIBS="$LIBLAM_EXTRA_LIBS -lsocket") fi AC_CHECK_FUNC(gethostbyname, lam_need_nsl=0, lam_need_nsl=1) if test "$lam_need_nsl" = "1"; then AC_CHECK_LIB(nsl, gethostbyname, WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS -lnsl" LIBLAM_EXTRA_LIBS="$LIBLAM_EXTRA_LIBS -lnsl") fi unset lam_need_socket lam_need_nsl # # 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! # AC_CHECK_LIB(util, login, WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS -lutil" LIBLAM_EXTRA_LIBS="$LIBLAMEXTRALIBS -lutil" LIBS="$LIBS -lutil") # config/lam_check_func.m4 LAM_CHECK_FUNC(openpty, LAM_HAVE_OPENPTY) LIBS="$libs_SAVE" ################################## # Library functions ################################## # Check for library functions. LAM_CHECK_FUNC(atexit, LAM_HAVE_ATEXIT, "") LAM_CHECK_FUNC(getcwd, LAM_HAVE_GETCWD, "") LAM_CHECK_FUNC(yield, LAM_HAVE_YIELD, "") LAM_CHECK_FUNC(snprintf, LAM_HAVE_SNPRINTF, "") LAM_CHECK_FUNC(atoll, LAM_HAVE_ATOLL, "") LAM_CHECK_FUNC(strtoll, LAM_HAVE_STRTOLL, "") LAM_CHECK_FUNC(sched_yield, LAM_HAVE_SCHED_YIELD, "") LAM_CHECK_FUNC(sysconf, LAM_HAVE_SYSCONF, "") LAM_CHECK_FUNC(sysctl, LAM_HAVE_SYSCTL, "") # Grrr - Linux has an internal VSCANF, so LAM_CHECK_FUNC will work AC_CHECK_DECL(vscanf, LAM_HAVE_VSCANF=1, LAM_HAVE_VSCANF=0) AH_TEMPLATE(LAM_HAVE_VSCANF, [Whether we have vscanf or not]) AC_DEFINE_UNQUOTED(LAM_HAVE_VSCANF, $LAM_HAVE_VSCANF) # make sure we can copy va_lists (need check declared, not linkable) AC_CHECK_DECL(va_copy, LAM_HAVE_VA_COPY=1, LAM_HAVE_VA_COPY=0, [#include ]) AH_TEMPLATE(LAM_HAVE_VA_COPY, [Whether we have va_copy or not]) AC_DEFINE_UNQUOTED(LAM_HAVE_VA_COPY, $LAM_HAVE_VA_COPY) AC_CHECK_DECL(__va_copy, LAM_HAVE_UNDERSCORE_VA_COPY=1, LAM_HAVE_UNDERSCORE_VA_COPY=0, [#include ]) AH_TEMPLATE(LAM_HAVE_UNDERSCORE_VA_COPY, [Whether we have __va_copy or not]) AC_DEFINE_UNQUOTED(LAM_HAVE_UNDERSCORE_VA_COPY, $LAM_HAVE_UNDERSCORE_VA_COPY) ################################## # System-specific gorp ################################## # # glibc memcpy() has some weird copy issues when the size being copied # is not divisable by 4. In these cases, it appears that memcpy uses # a crappy copy algorithm instead of an optimal one. This seems to # happen on x86 hardware in all present versions of glibc (at least <= # 2.2.5). As a workaround (particularly in the shmem RIs), we can # copy a few "prefix" bytes (i.e., (size % 8)) before copying the main # message body. This makes the size divisble by 4, and memcpy then # performs well. # See LAM bug 18 for more details. # Providing this --without-glibc-memcpy-fix switch to disable the # "fixed" memcpy because we don't know yet when it will be fixed, or # if it actually happens on all architectures (older glibc's don't # show this on Alphas or G4s, but the memory bus is slower there, so # the memcpy may be just as bad, but the problem doesn't show up). # Many thanks to Dr. Dave Turner (NetPIPE rocks) for identifying this, # and suggesting fixes. LAM_CHECK_PREFIX_MEMCPY # # What's our endian? # AC_C_BIGENDIAN # # System V InterProcess Communication tests # LAM_CHECK_SYSV_SEMAPHORES LIBS="$LIBS $LAM_SYSV_SEMAPHORES_EXTRA_LIBS" LIBLAM_EXTRA_LIBS="$LIBLAM_EXTRA_LIBS $LAM_SYSV_SEMAPHORES_EXTRA_LIBS" WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $LAM_SYSV_SEMAPHORES_EXTRA_LIBS" LAM_CHECK_SYSV_SHMEM LIBS="$LIBS $LAM_SYSV_SHMEM_EXTRA_LIBS" LIBLAM_EXTRA_LIBS="$LIBLAM_EXTRA_LIBS $LAM_SYSV_SHMEM_EXTRA_LIBS" WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $LAM_SYSV_SHMEM_EXTRA_LIBS" # # Threads are good. Threads work. # LAM_CONFIG_THREADS CFLAGS="$CFLAGS $THREAD_CFLAGS" CFLAGS_nonpicky="$CFLAGS_nonpicky $THREAD_CFLAGS" FFLAGS="$FFLAGS $THREAD_FFLAGS" CXXFLAGS="$CXXFLAGS $THREAD_CXXFLAGS" CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS" CXXCPPFLAGS="$CXXCPPFLAGS $THREAD_CXXCPPLAGS" LDFLAGS="$LDFLAGS $THREAD_LDFLAGS" LIBS="$LIBS $THREAD_LIBS" WRAPPER_EXTRA_CFLAGS="$WRAPPER_EXTRA_CFLAGS $THREAD_CPPFLAGS $THREAD_CFLAGS" WRAPPER_EXTRA_CXXFLAGS="$WRAPPER_EXTRA_CXXFLAGS $THREAD_CXXCPPFLAGS $THREAD_CXXFLAGS" WRAPPER_EXTRA_FFLAGS="$WRAPPER_EXTRA_FFLAGS $THREAD_FFLAGS" WRAPPER_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS $THREAD_LDFLAGS" WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $THREAD_LIBS" LIBLAM_EXTRA_LDFLAGS="$LIBLAM_EXTRA_LDFLAGS $THREAD_LDFLAGS" LIBLAM_EXTRA_LIBS="$LIBLAM_EXTRA_LIBS $THREAD_LIBS" # now some thread-specific tests LAM_CHECK_FUNC(pthread_atfork, LAM_HAVE_PTHREAD_ATFORK, "") # # Number of available file descriptors # LAM_CHECK_FD_SETSIZE # # File-descriptor passing style (see Stevens APUE pg 479-489) # LAM_CONFIG_FD_PASSING # # pseudo-tty style # AC_MSG_CHECKING([for BSD ptys]) if test -r /dev/ptyp0 -a -w /dev/ptyp0; then BSDPTY=1 MSG=yes VALUE=1 else BSDPTY=0 MSG=no VALUE=0 fi AC_DEFINE_UNQUOTED(LAM_HAVE_BSD_PTYS, $VALUE, [Whether we have BSD pseudo-ttys or not]) AC_MSG_RESULT([$MSG]) AC_MSG_CHECKING([for SYSV ptys]) if test -r /dev/ptmx -a -w /dev/ptmx; then SYSVPYT=1 MSG=yes VALUE=1 else SYSVPTY=0 MSG=no VALUE=0 fi AC_DEFINE_UNQUOTED(LAM_HAVE_SYSV_PTYS, $VALUE, [Whether we have SYSV pseudo-ttys or not]) AC_MSG_RESULT([$MSG]) # warn if no pty support available if test "$BSDPTY" = "0" -a "$SYSVPTY" = "0" ; then AC_MSG_WARN(["*** It appears your system does not have pty support."]) AC_MSG_WARN(["*** LAM will operate just fine, but pty support will"]) AC_MSG_WARN(["*** be unavailable"]) fi # config/lam_check_sizeof_struct_stat_members.m4 LAM_CHECK_SIZEOF_STRUCT_STAT_MEMBERS # config/lam_check_typeof_getsockopt_optlen.m4 LAM_CHECK_TYPEOF_GETSOCKOPT_OPTLEN # config/lam_check_typeof_recvfrom_len.m4 LAM_CHECK_TYPEOF_RECVFROM_LEN # # File system questions. Yes, LAM now cares about your filesystem. # This is mainly a question of what to name the C++ compiler, but it # is an OS question, so I put it in the OS section. # # most of the actual logic lives in tools/wrappers/Makefile.am # LAM_CASE_SENSITIVE_FS_SETUP ############################################################################ # Optional modules ############################################################################ lam_show_subtitle "Memory management setup" LAM_MEMORY_SETUP lam_show_subtitle "Optional modules" AC_MSG_CHECKING([if want MPI C++ bindings]) if test "$WANT_MPI2CPP" = "yes"; then AC_MSG_RESULT([enabled]) # This used to be the configure script from mpi2c++; it's now been # sucked up into this configure script and makes our lives much # better. LAM_CXX_BINDINGS_SETUP else AC_MSG_RESULT([disabled]) fi AC_MSG_CHECKING([if want ROMIO]) if test "$WANT_ROMIO" = "yes"; then AC_MSG_RESULT([enabled]) else AC_MSG_RESULT([disabled]) fi # # Disable the additional -g used for compiling totalview stuff # AC_ARG_ENABLE(tv, AC_HELP_STRING([--disable-tv], [disable TotalView-specific compile options when building LAM (usually not necessary)]), [WANT_TV="$enableval"], [WANT_TV=yes]) AC_MSG_CHECKING([if want TotalView attach support]) if test "$WANT_TV" = "yes"; then AC_MSG_RESULT([enabled]) else AC_MSG_RESULT([disabled]) fi # # Disable TotalView queue support (additional DLL) # WANT_TV_QUEUE_DEFINE=0 AC_ARG_ENABLE(tv-queue, AC_HELP_STRING([--disable-tv-queue], [disable TotalView queue functioanlity]), [WANT_TV_QUEUE="$enableval"]) AC_MSG_CHECKING([if want TotalView queue debugging support]) if test "$WANT_TV" = "no"; then WANT_TV_QUEUE=no AC_MSG_RESULT([disabled (TV support disabled)]) elif test "$lam_enable_shared" = "no"; then WANT_TV_QUEUE=no AC_MSG_RESULT([disabled (shared library support explicitly disabled)]) elif test "$WANT_TV_QUEUE" = "" -a "$BASECC" = "pgcc"; then WANT_TV_QUEUE=no AC_MSG_RESULT([disabled (using Portland Group compilers)]) elif test "$WANT_TV_QUEUE" = "" -a "$BASECC" = "icc"; then WANT_TV_QUEUE=no AC_MSG_RESULT([disabled (using Intel compilers)]) elif test "$WANT_TV_QUEUE" = "no"; then AC_MSG_RESULT([disabled]) else WANT_TV_QUEUE=yes WANT_TV_QUEUE_DEFINE=1 AC_MSG_RESULT([enabled]) fi # # Allow overriding of what flags are used to compile debugging # support, because at least some compilers are buggy, and using "-g" # doesn't result in the proper symbols being added to the resulting # libraries/executables. # AC_ARG_WITH(tv-debug-flags, AC_HELP_STRING([--with-tv-debug-flags=flags], [specify flags to pass to the compiler/linker to allow proper debugging symbols to be compiled (only necessary of -g does not work)])) # # Do all the BPROC configuration work # LAM_BPROC_SETUP # # We want to phase out some of the old/deprecated LAM executable names # (e.g., hcc -> mpicc, hcp -> mpiCC, hf77 -> mpif77, wipe -> lamwipe). # The main executables are all renamed, and for now, we just make sym # links from the real (new) name to the deprecated (old) name in the # installation tree. The --disable-deprecated-executable-names option # can block this behavior and not create the sym links. Someday, # we'll change the default behavior to not create these sym links and # have --enable-deprecated-executable-names enable the behavior. WANT_DEN=yes AC_MSG_CHECKING(if want deprecated executable names) AC_ARG_ENABLE(deprecated-executable-names, AC_HELP_STRING([--disable-deprecated-executable-names], [do not make sym links to deprecated LAM executables (e.g., hcc, hcp, hf77, wipe)]), [if test "$enableval" = "yes"; then WANT_DEN=yes else WANT_DEN=no fi]) AM_CONDITIONAL(WANT_DEPRECATED_EXECUTABLE_NAMES, test "$WANT_DEN" = "yes") AC_MSG_RESULT([$WANT_DEN]) ############################################################################ # Setup Totalview shared library ############################################################################ # Build a list of args that we will pass to the subdirectory configure # scripts. AC_MSG_CHECKING([for subdir args]) LAM_CONFIG_SUBDIR_ARGS([lam_subdir_args]) AC_MSG_RESULT([$lam_subdir_args]) if test "$WANT_TV_QUEUE" = "yes"; then # See if the user explicitly specified --disable-shared on the # command line. If so, refuse to build the TV DLL. lam_show_title "Totalview message queue debugging support" echo "" LAM_CONFIG_SUBDIR([share/totalview], [$lam_subdir_args], [HAPPY=1], [HAPPY=0]) if test "$HAPPY" = "1"; then WANT_TV_QUEUE_DEFINE=1 TOTALVIEW_DLL_DIR=totalview else WANT_TV_QUEUE_DEFINE=0 TOTALVIEW_DLL_DIR= fi else TOTALVIEW_DLL_DIR= WANT_TV_QUEUE_DEFINE=0 fi AC_DEFINE_UNQUOTED(LAM_HAVE_TV_QUEUE_DLL, $WANT_TV_QUEUE_DEFINE, [Whether we built/installed the TotalView queue debugging DLL or not]) AC_SUBST(TOTALVIEW_DLL_DIR) ############################################################################ # Configure ROMIO support ############################################################################ if test "$WANT_ROMIO" = "yes" ; then lam_show_title "Configuring ROMIO (MPI-2 I/O) support" # If we're doing a VPATH build, then there may not be a romio # directory yet. Make it. if test ! -d romio; then mkdir romio mkdir romio/lib mkdir romio/util mkdir romio/test fi cd romio rm -f config.cache if test "$WANT_DEBUG" = "1"; then ROMIO_DEBUG="-debug" else ROMIO_DEBUG= fi # Look for ROMIO's configure (e.g., VPATH stuff) if test -x configure; then cdir="." cd .. LAM_TOP_SRCDIR="`pwd`" cd romio elif test -x "../$srcdir/romio/configure"; then cdir="../$srcdir/romio" tmp="`pwd`" cd "../$srcdir" LAM_TOP_SRCDIR="`pwd`" cd $tmp elif test -x "$srcdir/romio/configure"; then cdir="$srcdir/romio" tmp="`pwd`" cd "$srcdir" LAM_TOP_SRCDIR="`pwd`" cd $tmp else echo "Error! I can't find the configure for the ROMIO package. :-(" exit 1 fi # Call ROMIO's configure script command="$cdir/configure --prefix=\"$prefix\" -mpi=lam -from_lam -mpiincdir=\"$LAM_TOP_SRCDIR/share/include -I$LAM_TOP_BUILDDIR/share/include\" -cc=\"$CC\" -fc=\"$FC\" -mpiolib=\"$LAM_TOP_BUILDDIR/romio/lib/liblammpio.a\" -cflags=\"$CFLAGS -DLAM_BUILDING=1\" -fflags=\"$FFLAGS $ROMIO_FLAGS\" $ROMIO_DEBUG $ROMIO_NOF77 $ROMIO_USER_FLAGS $ROMIO_ARCH_FLAGS && touch .lam_built" cat > $cdir/config.command <> $file fi done # m4 weirdness: must also do the echo after the sort, or we get a # string with newlines in it found_kinds="`sort $file`" found_kinds="`echo $found_kinds`" rm -f $file AC_MSG_RESULT([$found_kinds]) # Now determine the modules in each of the kinds. This is a little # redundant and could be combined into the loop above, but we separate # it out for clarity. The extern statements and array of pointers to # the module global structs are written to a file for each kind that # is #include'd in the flue file for each kind. for kind in $found_kinds; do all_modules= static_modules= dynamic_modules= static_ltlibs= # Ensure that the directory where the #include file is to live # exists. Need to do this for VPATH builds, because the directory # may not exist yet. outdir=share/ssi/$kind/base total_dir="." for dir_part in `IFS='/\\'; set X $outdir; shift; echo "$[@]"`; do total_dir=$total_dir/$dir_part test -d "$total_dir" || mkdir "$total_dir" || AC_MSG_ERROR([cannot create $total_dir]) done # Also ensure that the dynamic-ssi base directory exists total_dir="." dyndir=share/dynamic-ssi/$kind for dir_part in `IFS='/\\'; set X $dyndir; shift; echo "$[@]"`; do total_dir=$total_dir/$dir_part test -d "$total_dir" || mkdir "$total_dir" || AC_MSG_ERROR([cannot create $total_dir]) done # Remove any previous #include file outfile=$outdir/lam-ssi-${kind}-modules.h rm -f $outfile $outfile.struct $outfile.extern \ $file.all $file.static $file.dyanmic touch $outfile.struct $outfile.extern \ $file.all $file.static $file.dynamic # Manual conversion of $kind to its generic name (e.g., crmpi->cr, # crlam->cr). case "$kind" in crmpi) generic_kind="cr" ;; crlam) generic_kind="cr" ;; *) generic_kind="$kind" ;; esac # Go through all the module directories and find valid modules for module in $srcdir/share/ssi/$kind/*; do FOUND=0 HAPPY=0 m="`basename $module`" if test -d $module -a -x $module/configure -a \ ! -f $module/.lam_ignore; then # We found one! FOUND=1 # Remove any possible sym link in the ssi-dynamic tree rm -f share/dynamic-ssi/$kind/$m # If we're skipping SSI, look at the results from last # time cachefile="share/ssi/$kind/$m/.lam_configure_results_cache" if test "$skipssi" = "1"; then AC_MSG_WARN([Llama-specific function to skip configuring SSI module!]) if test -f "$cachefile"; then HAPPY="`grep SUCCESS $cachefile | cut -d= -f2`" else AC_MSG_WARN([Cannot find result of previous configure of]) AC_MSG_WARN([module $kind/$m.]) AC_MSG_WARN([You must run configure without skipssi at least once.]) AC_MSG_ERROR([Cannot continue.]) fi else LAM_CONFIG_SUBDIR([share/ssi/$kind/$m], [$lam_subdir_args], [HAPPY=1], [HAPPY=0]) rm -f "$cachefile" echo "SUCCESS=$HAPPY" > "$cachefile" fi fi # See if it dropped an output file for us to pick up some # shell variables in. infile="share/ssi/$kind/$m/ssi_${kind}_${m}_config.sh" # Did we find a valid module, and did its configure run # successfully? if test "$HAPPY" = "1"; then AC_MSG_NOTICE([Post-module top-level processing]) # Add this subdir to the mast list of all SSI module subdirs echo $m >> $file.all # Is this module going to built staic or shared? str="SHARED_KIND=\$LOADABLE_MODULE_$kind" eval $str str="SHARED_GENERIC_KIND=\$LOADABLE_MODULE_$generic_kind" eval $str str="SHARED_MODULE=\$LOADABLE_MODULE_${kind}_$m" eval $str # If we're doing skipssi, then look at the results from # last time shared_mode_override=static if test "$skipssi" = "1"; then shared_mode_override="`grep COMPILE_MODE $cachefile | cut -d= -f2`" fi # Setup for either shared or static if test "$shared_mode_override" = "dynamic" -o \ "$SHARED_KIND" = "1" -o \ "$SHARED_GENERIC_KIND" = "1" -o \ "$SHARED_MODULE" = "1" -o \ "$LOADABLE_MODULE_all" = "1"; then compile_mode="dynamic" echo $m >> $file.dynamic $LN_S "$LAM_TOP_BUILDDIR/share/ssi/$kind/$m" \ "share/dynamic-ssi/$kind/$m" else static_ltlibs="$m/liblam_ssi_${kind}_${m}.la $static_ltlibs" echo "extern const lam_ssi_t lam_ssi_${kind}_${m}_module;" >> $outfile.extern echo " &lam_ssi_${kind}_${m}_module, " >> $outfile.struct compile_mode="static" echo $m >> $file.static # If we're building static and there's a "libtool" in # the module directory, see if we can snarf any extra # LDFLAGS of LIBS that libtool figured out. We only # want thinks like -Wl... here -- *not* -L or -l flags # (those should be passed in the output .sh [$infile], # and will be processed below). dir="$LAM_TOP_BUILDDIR/share/ssi/$kind/$m" lt="$dir/libtool" if test -x "$lt" -a -f "$dir/Makefile"; then flags1="`egrep '^LDFLAGS[ \t]*=' $dir/Makefile | cut -d= -f2-`" flags2="`egrep '^LIBS[ \t]*=' $dir/Makefile | cut -d= -f2-`" LAM_CHECK_LINKER_FLAGS([$lt], [$flags1 $flags2]) for flag in $extra_ldflags; do case $flag in -L*) ;; -l*) ;; *) WRAPPER_EXTRA_LDFLAGS="$WRAPPER_EXTRA_LDFLAGS $flag" ;; esac done for flag in $extra_libs; do case $flag in -L*) ;; -l*) ;; *) WRAPPER_EXTRA_LIBS="$WRAPPER_EXTRA_LIBS $flag" ;; esac done fi unset dir lt flags1 flags2 fi if test "$skipssi" != "1"; then echo "COMPILE_MODE=$compile_mode" >> "$cachefile" fi # Output pretty results AC_MSG_NOTICE([+++ SSI module $kind:$m compile: yes]) AC_MSG_NOTICE([+++ SSI module $kind:$m mode: $compile_mode]) if test "$compile_mode" = "dynamic"; then AC_MSG_NOTICE([+++ Ignored any extra wrapper flags]) fi # If there's an output file, add the values to # scope_EXTRA_flags. if test -f $infile; then # First check for the ABORT tag line="`grep ABORT= $infile | cut -d= -f2-`" if test -n "$line" -a "$line" != "no"; then AC_MSG_WARN([SSI module configure script told me to abort]) AC_MSG_ERROR([cannot continue]) fi # Now check for the rest of the tags for scope in LIBLAM LIBMPI; do for flags in CFLAGS CXXFLAGS FFLAGS LDFLAGS LIBS; do var="${scope}_EXTRA_${flags}" line="`grep $var= $infile | cut -d= -f2-`" if test -n "$line"; then str="$var="'"$'"$var $line"'"' eval $str fi done done if test "$compile_mode" = "static"; then for flags in LDFLAGS LIBS; do var="WRAPPER_EXTRA_${flags}" line="`grep $var= $infile | cut -d= -f2-`" if test -n "$line"; then str="$var="'"$'"$var $line"'"' eval $str fi done fi fi echo "" elif test "$FOUND" = "1"; then AC_MSG_NOTICE([--- SSI module $kind:$m compile: no]) echo "" # If this module was requested as the default for this # kind, then abort. str="foo="'"$'"with_$kind"'"' eval $str str="bar="'"$'"with_$generic_kind"'"' eval $str if test "$foo" = "$m" -o "$bar" = "$m"; then AC_MSG_WARN([SSI module "$m" failed to configure properly]) AC_MSG_WARN([This module was selected as the default]) AC_MSG_ERROR([Cannot continue]) exit 1 fi fi done # m4 weirdness: must also do the echo after the sort, or we get a # string with newlines in it all_modules="`sort $file.all`" all_modules="`echo $all_modules`" static_modules="`sort $file.static`" static_modules="`echo $static_modules`" dynamic_modules="`sort $file.dynamic`" dynamic_modules="`echo $dynamic_modules`" rm -f $file $file.all $file.static $file.dynamic # Create the final .h file that will be included in the kind's # top-level glue. This lists all the static modules. cat > $outfile < $file fi chmod a+x $file fi]) AC_OUTPUT # 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