dnl -*- m4 -*- # $Source: runtime/gasnet/configure.in $ # $Date: Sat, 20 Aug 2005 22:45:40 -0700 $ # $Revision: 1.60.1.37 $ # Description: GASNet configure script # Copyright 2002, Dan Bonachea # Based in part on the Titanium project configure script # Terms of use are as specified in license.txt AC_DEFUN([cv_prefix],[gasnet_cv_]) AC_REVISION($Revision: 1.60.1.37 $) # the "new" way # AC_INIT(GASNet, 0.2) # AC_CONFIG_SRCDIR(gasnet.h) # AM_INIT_AUTOMAKE([no-define]) # the "old" way AC_INIT(gasnet.h) GASNET_FIX_SHELL AC_CONFIG_AUX_DIR(config-aux) AC_CANONICAL_SYSTEM AC_VALIDATE_CACHED_SYSTEM_TUPLE AM_INIT_AUTOMAKE(GASNet, 1.6, no-define) AC_PREFIX_DEFAULT(/usr/local) AM_CONFIG_HEADER(gasnet_config.h) GASNET_START_CONFIGURE([AWK]) GASNET_DEFINE_CONFIGURE_VARS([GASNETI]) AC_PROG_AWK ######################################################################## ## ## Misc configure option processing ## # default: support pthreads if library found # --enable-pthreads: fail if pthreads lib not found # --disable-pthreads: don't even look for pthreads library GASNET_IF_ENABLED_WITH_AUTO(pthreads, support pthreaded GASNet clients, [use_pthreads="yes"], [use_pthreads="no"], [use_pthreads="try"]) ######################################################################## ## ## Supporting Command-Line Tools ## dnl Store full paths, so we find right ones even if users have dnl some other version in their path GASNET_PATH_PROGS(GMAKE, $GMAKE gmake make $MAKE, GNU make) AC_MSG_CHECKING(for GNU make) if $GMAKE --version | grep GNU ; then AC_MSG_RESULT(yes) else # We don't actually require GNU Make at the moment # AC_MSG_ERROR(cannot find a version of GNU make - please install GNU make and/or set \$GMAKE to indicate where it's located) AC_MSG_WARN([cannot find a version of GNU make - if you encounter make problems, install GNU make and/or set \$GMAKE to indicate where it's located]) fi AC_SUBST(GMAKE) # we do not require nm AC_PATH_PROG(NM, $NM nm, nm utility) AC_MSG_CHECKING(for GNU nm) if test "`${NM:-nm} --version 2>&1 | grep GNU`" = "" ; then gnu_nm=no else gnu_nm=yes fi AC_MSG_RESULT($gnu_nm) AM_CONDITIONAL(GNU_NM, test "$gnu_nm" = "yes") ######################################################################## ## ## Perl ## ## We do this early so we can use "$PERL -e" for complex configure tests. GASNET_PROG_PERL AC_SUBST(PERL) PERLSTART=$TOP_BUILDDIR/other/perlstart AC_SUBST_FILE(PERLSTART) ######################################################################## ## ## C/C++ Compilers ## # Some OS's need help to find the right C compiler case "$target_os" in superux*) # "cc" is completely broken on SuperUX, never use it GASNET_ENV_DEFAULT(CC, c++ -Xa) ;; # may also/alternately want -Kc99 esac GASNET_PROG_CPP GASNET_PROG_CC AC_PROG_LN_S GASNET_C_BIGENDIAN AC_CHECK_PROG(have_mpcc_r,mpcc_r,yes,no) ## DOB: this is more trouble than it's worth because so many OS's define ## LITTLE_ENDIAN or BIG_ENDIAN in random and sultry header files ## Code with access to gasnet_config.h should use #if defined(WORDS_BIGENDIAN) ## If we ever decide we need this (to support other code) then we ## can reintroduce this define with a fresh prefix dnl if test "$ac_cv_c_bigendian" = 'yes'; then dnl ENDIANNESS="-DBIG_ENDIAN" dnl # avoid warnings from re-defining BIG_ENDIAN dnl GASNET_TRY_CACHE_CHECK(for BIG_ENDIAN in sys/types.h, cc_bigend_systypes, dnl [#include dnl #ifndef BIG_ENDIAN dnl #error not defined dnl #endif dnl ], [], dnl ENDIANNESS="") dnl else dnl ENDIANNESS="-DLITTLE_ENDIAN=1234" dnl # avoid warnings from re-defining LITTLE_ENDIAN dnl GASNET_TRY_CACHE_CHECK(for LITTLE_ENDIAN in stdlib.h, cc_littleend_stdlib, dnl [#include dnl #ifndef LITTLE_ENDIAN dnl #error not defined dnl #endif dnl ], [], dnl ENDIANNESS="") dnl fi dnl AC_SUBST(ENDIANNESS) ## specific compiler families GASNET_FAMILY_CACHE_CHECK(C, CC, gasnet_cv_cc_family) if test "$gasnet_cv_cc_family" = MIPS; then # The MIPSPro C compiler apparently has no identifying markings AC_DEFINE(MIPSPRO_COMPILER) fi if test "$gasnet_cv_cc_family" = MTA ; then # override target_os for MTA, which may be wrong if cross-compiling target_os="mtx" fi ### # # choose the default CC flags # case "$gasnet_cv_cc_family" in GNU) GASNET_GCC_VERSION_CHECK(CC) GASNET_PUSHVAR(CFLAGS,"-O3") # prefer the --param inliner option(s), which give us finer control GASNET_TRY_CFLAG([--param max-inline-insns-single=35000], [CFLAGS="$CFLAGS --param max-inline-insns-single=35000" GASNET_TRY_CFLAG([--param max-inline-insns=100000], [CFLAGS="$CFLAGS --param max-inline-insns=100000"])], GASNET_TRY_CFLAG([-finline-limit=10000], [CFLAGS="$CFLAGS -finline-limit=10000"]) ) # gcc 3.4+ require new flags to enable full inlining GASNET_TRY_CFLAG([--param inline-unit-growth=10000], [CFLAGS="$CFLAGS --param inline-unit-growth=10000"]) GASNET_TRY_CFLAG([--param large-function-growth=200000], [CFLAGS="$CFLAGS --param large-function-growth=200000"]) # We'd like to use -Winline to detect call sites where the optimizer # ignores our inline function modifier (usually due to technical limitations) # However, some versions of gcc issue spurious warnings with -Winline # for inlining operations which the user did not request. # Detect that gcc bug and avoid -Winline for those versions GASNET_TRY_CFLAG([-Winline],[ noninlineCFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Winline" AC_MSG_CHECKING(for buggy -Winline) GASNET_TRY_CCOMPILE_WITHWARN([ int foo() { return 0; } int bar() { return foo() + bar(); } ], [ int x = bar(); ], [ AC_MSG_RESULT(ok) # keep -Winline ], [ AC_MSG_RESULT(buggy) CFLAGS="$noninlineCFLAGS" # remove -Winline ], [ AC_MSG_ERROR(failure when detecting buggy -Winline)]) ]) CCOPTFLAGS="$CFLAGS" GASNET_POPVAR(CFLAGS) ;; Pathscale) CCOPTFLAGS="-O3 -Winline" ;; Sun) CCOPTFLAGS="-fast -xO5" ;; Cray) CCOPTFLAGS="-O2" ;; # DOB: -O3 is unstable on Cray cc HP) CCOPTFLAGS="-O3" ;; MIPS) CCOPTFLAGS="-O3" ;; XLC) case "$target_os" in darwin*) # enabling ipa (-O4 or higher) breaks linking to MPI (and thus vapi). case `/usr/sbin/sysctl hw.cpusubtype | cut '-d ' -f2` in # bug926: on G5 (cpusubtype 100) -qarch={ppc970,auto} causes corruption of 64-bit integer arithmetic 100) CCOPTFLAGS="-O3 -qhot -qarch=g5 -qtune=auto -qsmp=noauto -qmaxmem=-1" ;; *) CCOPTFLAGS="-O3 -qhot -qarch=auto -qtune=auto -qsmp=noauto -qmaxmem=-1" ;; esac ;; linux*) CCOPTFLAGS="-O3 -qhot -qarch=auto -qtune=auto -qsmp=noauto -qmaxmem=-1" ;; # XXX: untested *) #CCOPTFLAGS="-O5 -qsmp=noauto -qmaxmem=-1" ;; # -O5 == -O3 w/ intra-procedural analysis, maxmem=-1 is default for -O3 or higher CCOPTFLAGS="-O3 -qarch=auto -qtune=auto -qsmp=noauto -qmaxmem=-1" ;; # -O5 causes linker to hang on Titanium esac ;; Compaq) CCOPTFLAGS="-fast -noifo -O4 -tune host -inline all" ;; Intel) CCOPTFLAGS="-O3" ;; MTA) CCOPTFLAGS="-O3" ;; # MTA C actually ignores -O, optimization controlled by presence/absence of -g PGI) CCOPTFLAGS="-O2" ;; *) CCOPTFLAGS="-O" ;; esac dnl GASNET_GET_GNUWARNINGFLAGS(type) type=C or CXX AC_DEFUN([GASNET_GET_GNUWARNINGFLAGS],[ [$1]FLAGS="-g3" ]GASNET_TRY_[$1]FLAG[([-Wall],[[$1]FLAGS="$[$1]FLAGS -Wall"]) ]GASNET_TRY_[$1]FLAG[([-Wno-unused],[[$1]FLAGS="$[$1]FLAGS -Wno-unused"]) ]GASNET_TRY_[$1]FLAG[([-Wpointer-arith],[[$1]FLAGS="$[$1]FLAGS -Wpointer-arith"]) ]GASNET_TRY_[$1]FLAG[([-Wnested-externs],[[$1]FLAGS="$[$1]FLAGS -Wnested-externs"]) ]GASNET_TRY_[$1]FLAG[([-Wwrite-strings],[[$1]FLAGS="$[$1]FLAGS -Wwrite-strings"]) ]GASNET_TRY_[$1]FLAG[([-Wdeclaration-after-statement],[[$1]FLAGS="$[$1]FLAGS -Wdeclaration-after-statement"]) ]GASNET_TRY_[$1]FLAG[([-Wmissing-format-attribute],[[$1]FLAGS="$[$1]FLAGS -Wmissing-format-attribute"]) if test "$use_pthreads" != "no" ; then # some crappy pthread mutex implementations generate warnings without -Wno-missing-braces AC_MSG_CHECKING(for buggy pthread.h mutex initializers) old[$1]FLAGS="$[$1]FLAGS" # OSF and FREEBSD require the -pthread compiler flag when including pthread.h case "$target_os" in osf*) [$1]FLAGS="-pthread $[$1]FLAGS" ;; freebsd*) [$1]FLAGS="-pthread $[$1]FLAGS" ;; esac ]GASNET_TRY_[$1]COMPILE_WITHWARN[([#include ], [pthread_mutex_t fastmutex = PTHREAD_MUTEX_INITIALIZER;], [AC_MSG_RESULT(ok)], [AC_MSG_RESULT(buggy) ]GASNET_TRY_[$1]FLAG[([-Wno-missing-braces],[old[$1]FLAGS="$old[$1]FLAGS -Wno-missing-braces"])], [#bug611: ignore failures here, which may be due to broken/missing pthreads support #AC_MSG_ERROR(failure while checking for buggy pthread.h mutexes) AC_MSG_RESULT(failure - ignored) ] ) [$1]FLAGS="$old[$1]FLAGS" fi case "$target_os" in solaris*) # hide pragma warnings in system header files included by absolute path ]GASNET_TRY_[$1]FLAG[([-Wno-unknown-pragmas],[[$1]FLAGS="$[$1]FLAGS -Wno-unknown-pragmas"]) esac #]GASNET_TRY_[$1]FLAG[([-ansi -U__STRICT_ANSI__],[[$1]FLAGS="$[$1]FLAGS -ansi -U__STRICT_ANSI__"]) ]) case "$gasnet_cv_cc_family" in GNU) GASNET_PUSHVAR(CFLAGS,"$CFLAGS") GASNET_GET_GNUWARNINGFLAGS(C) CCDEBUGFLAGS="$CFLAGS" GASNET_POPVAR(CFLAGS) ;; NEC) CCDEBUGFLAGS="-g -Cnoopt -Cdebug" ;; HP) CCDEBUGFLAGS="-g +ESdbgasm" ;; # need +ESdbgasm to use -g with _asm() MTA) CCDEBUGFLAGS="-g2" ;; # need +ESdbgasm to use -g with _asm() Compaq) CCDEBUGFLAGS="-trapuv -g2" ;; *) CCDEBUGFLAGS="-g" ;; esac case "$gasnet_cv_cc_family" in GNU) case "$target_cpu" in sparc) # Get sparc v9 ISA GASNET_TRY_CFLAG([-mcpu=ultrasparc -mtune=ultrasparc], [ MISC_CFLAGS="-mcpu=ultrasparc -mtune=ultrasparc" AC_DEFINE(GASNETI_ARCH_SPARCV9) ] ) ;; *) ;; esac ;; Cray) case "$target_cpu" in alphaev5) MISC_CFLAGS="-hnomessage=236 -htaskprivate $LIBCM" ;; # T3E *) MISC_CFLAGS="-hnomessage=236 $LIBCM" ;; # X1 esac ;; MIPS) MISC_CFLAGS="-common -diag_error 1035 -diag_suppress1171,1174,1209,1552 -LD_MSG:off=84" ;; # 1035 ensures "#error" is fatal Compaq) MISC_CFLAGS="-msg_disable extrasemi" ;; HP) MISC_CFLAGS="+W612 +W2111 +W2174 +W2177 +W2236 +W2550 -Wp,-H100000" ;; # -H increases internal preprocessor table size Intel) MISC_CFLAGS="-wd177 -wd279" GASNET_TRY_CFLAG([-wd1572], [MISC_CFLAGS="$MISC_CFLAGS -wd1572"]) ;; NEC) MISC_CFLAGS="-woff=68:111:174:177:236:301:550:940" ;; PGI) MISC_CFLAGS="-Masmkeyword -c9x" ;; # get inline assembly and restrict MTA) MISC_CFLAGS="-display_error_number -WS 111,174,238" ;; Sun) MISC_CFLAGS="-errtags" ;; # show warning tag ids in warnings XLC) MISC_CFLAGS="-qsuppress=1500-010:1506-229" ;; # 1500-010 = infinite loop (such as in our tests) # 1506-229 = empty source file (some linux headers) *) MISC_CFLAGS="" ;; esac case "$gasnet_cv_cc_family" in XLC) MISC_CPPFLAGS="-qcpluscmt" ;; # tell preprocessor to allow C++-style comments PGI) MISC_CPPFLAGS="-B" ;; # C++ comments Sun) MISC_CPPFLAGS="-xCC" ;; # C++ comments HP) MISC_CPPFLAGS="+W67" ;; # unrecognized #pragma upc GNU) case "$target_os" in darwin*) MISC_CPPFLAGS="-no-cpp-precomp -Wno-long-double" ;; esac ;; *) MISC_CPPFLAGS="" ;; esac GASNET_IF_ENABLED(debug, Build GASNet in a debugging mode, [ echo "-----------------------------------------------------------------------" echo " WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING" echo "" echo " Configuring the system for global, forced debugging mode. " echo " This usually has a SERIOUS impact on performance, so you should NOT" echo " trust any performance numbers obtained from programs built" echo " using this GASNet installation!!!" echo "" echo " WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING" echo "-----------------------------------------------------------------------" CFLAGS="$CCDEBUGFLAGS" BUILDCONFIG_DEFINES="-DGASNET_DEBUG" BUILDCONFIG="debug" enabled_debug=yes], [ CFLAGS="$CCOPTFLAGS" BUILDCONFIG_DEFINES="-DGASNET_NDEBUG" BUILDCONFIG="optimize" enabled_debug=no]) AM_CONDITIONAL(BUILDCONFIG_DEBUG, test "$enabled_debug" = yes) GASNET_IF_ENABLED(gasnet-verbose, Build GASNet lib with debugging status messages, [ enabled_debug_verbose=yes ], [ enabled_debug_verbose=no ]) if test "$enabled_debug_verbose" = yes; then BUILDCONFIG_DEFINES="$BUILDCONFIG_DEFINES -DGASNET_DEBUG_VERBOSE=1" fi AM_CONDITIONAL(BUILDCONFIG_DEBUG_VERBOSE, test "$enabled_debug_verbose" = yes) GASNET_IF_ENABLED_WITH_AUTO(trace, Build GASNet with tracing enabled (enabled by default with --enable-debug), enabled_trace=yes, enabled_trace=no, enabled_trace=$enabled_debug) if test "$enabled_trace" = yes; then BUILDCONFIG_DEFINES="$BUILDCONFIG_DEFINES -DGASNET_TRACE" fi AM_CONDITIONAL(BUILDCONFIG_TRACE, test "$enabled_trace" = yes) GASNET_IF_ENABLED_WITH_AUTO(stats, Build GASNet with statistical collection enabled (enabled by default with --enable-debug), enabled_stats=yes, enabled_stats=no, enabled_stats=$enabled_debug) if test "$enabled_stats" = yes; then BUILDCONFIG_DEFINES="$BUILDCONFIG_DEFINES -DGASNET_STATS" fi AM_CONDITIONAL(BUILDCONFIG_STATS, test "$enabled_stats" = yes) GASNET_CHECK_OPTIMIZEDDEBUG(CC,CFLAGS,[$CPPFLAGS $MISC_CFLAGS $MISC_CPPFLAGS $BUILDCONFIG_DEFINES],[]) #AC_SUBST(CFLAGS) # opt/debug flags AC_SUBST(MISC_CFLAGS) # warning suppression and other misc C flags AC_SUBST(MISC_CPPFLAGS) # misc preprocessor flags AC_SUBST(BUILDCONFIG_DEFINES) # defines that setup build configuration segconfig="" GASNET_IF_ENABLED(segment-fast, Build GASNet in the FAST shared segment configuration, segconfig="fast$segconfig", ) GASNET_IF_ENABLED(segment-large, Build GASNet in the LARGE shared segment configuration, segconfig="large$segconfig", ) GASNET_IF_ENABLED(segment-everything, Build GASNet in the EVERYTHING shared segment configuration, segconfig="everything$segconfig", ) case "$segconfig" in "") segconfig=fast; #for AM_CONDITIONAL, below AC_DEFINE(GASNET_SEGMENT_FAST) ;; # default is fast fast) AC_DEFINE(GASNET_SEGMENT_FAST) ;; large) AC_DEFINE(GASNET_SEGMENT_LARGE) ;; everything) AC_DEFINE(GASNET_SEGMENT_EVERYTHING) ;; *) AC_MSG_ERROR(Conflicting shared segment configurations specified) ;; esac # Do it all again because AM_CONDITIONAL()s can't go inside if or case. # Groan. AM_CONDITIONAL(GASNET_SEGMENT_FAST, test "$segconfig" = fast) AM_CONDITIONAL(GASNET_SEGMENT_LARGE, test "$segconfig" = large) AM_CONDITIONAL(GASNET_SEGMENT_EVERYTHING, test "$segconfig" = everything) GASNET_WITH(segment-mmap-max, [Upper bound for mmap-based GASNet segments (ex: "2GB", "1045MB")], [case "$withval" in [[1-9]]*G*) AC_DEFINE_UNQUOTED(GASNETI_MMAP_MAX_SIZE, [((uint64_t)(`expr "${withval}" : "\([[0-9]]\+\)"`ull << 30))]) ;; [[1-9]]*M*) AC_DEFINE_UNQUOTED(GASNETI_MMAP_MAX_SIZE, [((uint64_t)(`expr "${withval}" : "\([[0-9]]\+\)"`ull << 20))]) ;; [[1-9]][[0-9]]*) AC_DEFINE_UNQUOTED(GASNETI_MMAP_MAX_SIZE, [((uint64_t)${withval}ull)]) ;; *) AC_MSG_ERROR(Illegal value for --with-segment-mmap-max=$withval) ;; esac]) pushdef([BARRIERVALS],[permitted values are AMDISSEM or AMCENTRAL]) GASNET_WITH(barrier, [Default barrier implementation to use for reference extended implementation, BARRIERVALS], [case "$withval" in AMDISSEM) AC_DEFINE(GASNETE_USE_AMDISSEMINATION_REFBARRIER) ;; AMCENTRAL) ;; *) AC_MSG_ERROR(Illegal value for --with-barrier: BARRIERVALS) ;; esac], [ AC_MSG_ERROR(Illegal value for --with-barrier: BARRIERVALS) ], [ # default is AMDISSEM AC_DEFINE(GASNETE_USE_AMDISSEMINATION_REFBARRIER) ]) popdef([BARRIERVALS]) GASNET_LIBGCC GASNET_PUSHVAR(CFLAGS,"$CFLAGS $MISC_CPPFLAGS $MISC_CFLAGS") GASNET_CHECK_RESTRICT GASNET_POPVAR(CFLAGS) ######################################################################## # hunt for 16-, 32-, and 64-bit integer types GASNET_SETUP_INTTYPES() ######################################################################## ## ## Page size ## GASNET_CROSS_VAR(GASNETI_PAGESIZE,PAGESIZE) if test "$GASNETI_PAGESIZE" = ""; then GASNET_TRY_CACHE_RUN_EXPR(PAGESIZE, PAGESIZE, [ #include ], [ val = PAGESIZE; if (val<=0) exit(1); ], GASNETI_PAGESIZE) fi if test "$GASNETI_PAGESIZE" = ""; then GASNET_TRY_CACHE_RUN_EXPR(PAGE_SIZE, PAGE_SIZE, [ #include ], [ val = PAGE_SIZE; if (val<=0) exit(1); ], GASNETI_PAGESIZE) fi if test "$GASNETI_PAGESIZE" = ""; then GASNET_TRY_CACHE_RUN_EXPR([sysconf(_SC_PAGESIZE)], _SC_PAGESIZE, [ #include ], [ val = sysconf(_SC_PAGESIZE); if (val<=0) exit(1); ], GASNETI_PAGESIZE) fi if test "$GASNETI_PAGESIZE" = ""; then GASNET_TRY_CACHE_RUN_EXPR([sysconf(_SC_PAGE_SIZE)], _SC_PAGE_SIZE, [ #include ], [ val = sysconf(_SC_PAGE_SIZE); if (val<=0) exit(1); ], GASNETI_PAGESIZE) fi if test "$GASNETI_PAGESIZE" = ""; then GASNET_TRY_CACHE_RUN_EXPR([getpagesize()], getpagesize, [ #include ], [ val = getpagesize(); if (val<=0) exit(1); ], GASNETI_PAGESIZE) fi if test "$GASNETI_PAGESIZE" != ""; then AC_DEFINE_UNQUOTED(GASNETI_PAGESIZE,$GASNETI_PAGESIZE) case "$GASNETI_PAGESIZE" in 1024) GASNETI_PAGESHIFT=10 ;; 2048) GASNETI_PAGESHIFT=11 ;; 4096) GASNETI_PAGESHIFT=12 ;; 8192) GASNETI_PAGESHIFT=13 ;; 16384) GASNETI_PAGESHIFT=14 ;; 32768) GASNETI_PAGESHIFT=15 ;; 65536) GASNETI_PAGESHIFT=16 ;; 131072) GASNETI_PAGESHIFT=17 ;; 262144) GASNETI_PAGESHIFT=18 ;; 524288) GASNETI_PAGESHIFT=19 ;; 1048576) GASNETI_PAGESHIFT=20 ;; 2097152) GASNETI_PAGESHIFT=21 ;; 4194304) GASNETI_PAGESHIFT=22 ;; 8388608) GASNETI_PAGESHIFT=23 ;; 16777216) GASNETI_PAGESHIFT=24 ;; *) AC_MSG_ERROR(unknown GASNETI_PAGESIZE=$GASNETI_PAGESIZE) ;; esac AC_DEFINE_UNQUOTED(GASNETI_PAGESHIFT,$GASNETI_PAGESHIFT) fi ######################################################################## ## ## Cluster computing libraries ## # -lm should only live in LIBM, and only if we have it (not in LIBS) GASNET_LIBM() GASNET_CHECK_LIB(ens, NameServer_Init, have_libens=yes, , -L/usr/lib ${with_ens:+-L$with_ens}) AC_CHECK_LIB(glunix, Glib_Initialize, have_libglunix=yes, , -lsocket) AC_PATH_PROG(REXEC, $REXEC rexec, , $with_rexec:$PATH) AC_MSG_CHECKING(for Millennium rexec) # We're only interested in the Millennium version of rexec # the standard UNIX command 'rexec' has completely different behavior and is currently of no use to us if test -n "$REXEC" -a -n "`$REXEC 2> /dev/null | grep -- '-n #nodes'`"; then have_rexec=yes GASNET_REXEC_DEFINES="-DREXEC" AC_MSG_RESULT(yes) else have_rexec=no GASNET_REXEC_DEFINES="" AC_MSG_RESULT(no) fi #--------------------------------------------------------------------------------------------------------------- # Machine defs AC_DEFINE(UNIX) GASNET_THREAD_DEFINES="" GASNET_THREAD_LIBS="" case "$target_os" in solaris*) AC_DEFINE(SOLARIS) GASNET_MACHINE_DEFINES="-DSOLARIS" GASNET_THREAD_DEFINES="-D_REENTRANT" # on some systems static linking fails with -lpthread, # but need it or pthread_create will fail at runtime GASNET_THREAD_LIBS="-lpthread" ;; linux*) AC_DEFINE(LINUX) GASNET_MACHINE_DEFINES="-DLINUX" # Check for SGI Altix, using a device heuristic. SGI has assured us # that /dev/hw is specific (and standard) on their system if test -d "/dev/hw/cpunum"; then AC_DEFINE(ALTIX) GASNET_MACHINE_DEFINES="$GASNET_MACHINE_DEFINES -DALTIX" fi case "$target" in *-catamount-*) AC_DEFINE(CATAMOUNT) GASNET_MACHINE_DEFINES="-DCATAMOUNT" ;; esac # Defining _GNU_SOURCE gives us accesss to the "adaptive" # implementation of pthread_mutex_t, which is faster then # the default implementation for our purposes. GASNET_THREAD_DEFINES="-D_REENTRANT -D_GNU_SOURCE" GASNET_THREAD_LIBS="-lpthread" ;; freebsd*) AC_DEFINE(FREEBSD) GASNET_MACHINE_DEFINES="-DFREEBSD" GASNET_THREAD_DEFINES="-D_REENTRANT" GASNET_THREAD_LIBS="-pthread" # bug 1205: do not explicitly select threading lib ;; netbsd*) AC_DEFINE(NETBSD) GASNET_MACHINE_DEFINES="-DNETBSD" GASNET_THREAD_DEFINES="-D_REENTRANT" GASNET_THREAD_LIBS="-pthread" # bug 1205: do not explicitly select threading lib ;; cygwin*) AC_DEFINE(CYGWIN) GASNET_MACHINE_DEFINES="-DCYGWIN" GASNET_THREAD_DEFINES="-D_REENTRANT" GASNET_THREAD_LIBS="" ;; darwin*) AC_DEFINE(DARWIN) GASNET_MACHINE_DEFINES="-DDARWIN" GASNET_THREAD_DEFINES="-D_REENTRANT" GASNET_THREAD_LIBS="" ;; irix*) AC_DEFINE(IRIX) GASNET_MACHINE_DEFINES="-DIRIX" GASNET_THREAD_DEFINES="-D_REENTRANT" GASNET_THREAD_LIBS="-lpthread" ;; aix*) AC_DEFINE(AIX) GASNET_MACHINE_DEFINES="-DAIX" GASNET_THREAD_DEFINES="-D_REENTRANT -D_THREAD_SAFE" GASNET_THREAD_LIBS="-lpthread" ;; osf*) AC_DEFINE(OSF) GASNET_MACHINE_DEFINES="-DOSF" # -D_PTHREAD_NOMETER_STATIC fixes failures when initially trylocking a statically-init mutex GASNET_THREAD_DEFINES="-D_REENTRANT -D_THREAD_SAFE -D_PTHREAD_NOMETER_STATIC" GASNET_THREAD_LIBS="-pthread -lpthreads" ;; hpux*) AC_DEFINE(HPUX) GASNET_MACHINE_DEFINES="-DHPUX" GASNET_THREAD_DEFINES="-D_REENTRANT" GASNET_THREAD_LIBS="-lpthread" ;; mtx*) AC_DEFINE(MTA) GASNET_MACHINE_DEFINES="-DMTA" GASNET_THREAD_DEFINES="" GASNET_THREAD_LIBS="-lpthread" ;; superux*) AC_DEFINE(SUPERUX) GASNET_MACHINE_DEFINES="-DSUPERUX" GASNET_THREAD_DEFINES="-D_REENTRANT" GASNET_THREAD_LIBS="-lpthread" ;; unicos*) AC_DEFINE(UNICOS) GASNET_MACHINE_DEFINES="-DUNICOS" GASNET_THREAD_LIBS="-lpthread" GASNET_TRY_CACHE_CHECK(for Cray T3E, cc_is_t3e, [], [ #ifndef _CRAYT3E #error not Cray T3E #endif ], [ GASNET_THREAD_DEFINES="-D_REENTRANT" GASNET_MACHINE_DEFINES="$GASNET_MACHINE_DEFINES -DCRAYT3E" AC_DEFINE(CRAYT3E) use_pthreads=no # pthreads are horribly broken on the T3E ]) GASNET_TRY_CACHE_CHECK(for Cray X1, cc_is_x1, [], [ #ifndef __crayx1 #error not Cray X1 #endif ], [ GASNET_THREAD_DEFINES="-D_REENTRANT -hthreadsafe" GASNET_MACHINE_DEFINES="$GASNET_MACHINE_DEFINES -DCRAYX1" AC_DEFINE(CRAYX1) ]) ;; *) AC_MSG_WARN(unknown OS - you may need to update the configure script) ;; esac GASNET_MACHINE_DEFINES="$GASNET_MACHINE_DEFINES -DUNIX" AC_SUBST(GASNET_MACHINE_DEFINES) AC_SUBST(GASNET_THREAD_DEFINES) AC_SUBST(GASNET_THREAD_LIBS) AC_SUBST(GASNET_REXEC_DEFINES) # Find the appropriate OS suffix for executables case "$target_os" in cygwin*) EXESUFFIX='.exe' ;; *) EXESUFFIX='' ;; esac AC_SUBST(EXESUFFIX) ######################################################################## ## ## Multithreading Libraries ## ## POSIX threads # have_pthread=no if test "$use_pthreads" != "no"; then GASNET_CHECK_OVERRIDE_PTHREADS AC_MSG_CHECKING([for working pthreads support]) GASNET_PUSHVAR(CFLAGS,"$CFLAGS $GASNET_THREAD_DEFINES") GASNET_PUSHVAR(LIBS,"$LIBS $GASNET_THREAD_LIBS") AC_TRY_LINK( [ #include ], [ pthread_create(0,0,0,0); ], [have_pthread=yes]) GASNET_POPVAR(CFLAGS) GASNET_POPVAR(LIBS) AC_MSG_RESULT($have_pthread) else pthread_reason="was disabled" fi if test "$use_pthreads$have_pthread" = "yesno" ; then AC_MSG_ERROR([--enable-pthreads passed but no working pthreads support found]) fi if test "$use_pthreads$have_pthread" = "tryno" ; then AC_MSG_WARN([No working pthreads support found - disabling pthreads support]) pthread_reason="appear to be missing or broken" fi GASNETI_CACHE_LINE_BYTES="" if test "$have_pthread" = no ; then GASNET_THREAD_DEFINES="" GASNET_THREAD_LIBS="" else GASNET_PUSHVAR(CPPFLAGS,"$CPPFLAGS $GASNET_THREAD_DEFINES -I$TOP_SRCDIR/other") GASNET_PUSHVAR(LIBS,"$GASNET_THREAD_LIBS") # define HAVE_PTHREAD_H AC_CHECK_HEADERS(pthread.h) # look for optional pthreads entry points and features AC_SEARCH_LIBS(pthread_setconcurrency, pthread pthreads c_r, AC_DEFINE(HAVE_PTHREAD_SETCONCURRENCY)) AC_SEARCH_LIBS(pthread_kill_other_threads_np, pthread pthreads, AC_DEFINE(HAVE_PTHREAD_KILL_OTHER_THREADS_NP)) if test "$cross_compiling" = "no"; then case "$target_os" in darwin*) AC_MSG_CHECKING(for shared data cache line size) GASNETI_CACHE_LINE_BYTES=`/usr/sbin/sysctl hw.cachelinesize | cut '-d ' -f2` AC_MSG_RESULT($GASNETI_CACHE_LINE_BYTES) ;; *) GASNET_TRY_CACHE_RUN_EXPR(for shared data cache line size, datacache_line_size, [ #define CONFIG_TEST 1 #include "detect-cachesz.c" ], [ val = detect_cachesz(79.0, 0); if (val<=0) exit(1); ], GASNETI_CACHE_LINE_BYTES) ;; esac fi case "$target_os" in freebsd*) ;; # bug 1205: intentionally avoid -lpthread on BSD, where it causes problems netbsd*) ;; *) GASNET_THREAD_LIBS="$LIBS" ;; esac GASNET_POPVAR(CPPFLAGS) GASNET_POPVAR(LIBS) fi if test "$GASNETI_CACHE_LINE_BYTES" = "" ; then GASNETI_CACHE_LINE_BYTES=128 AC_MSG_WARN([Unable to automatically detect a shared data cache line size (either system load too high, pthreads is broken or this is not a cache-coherent SMP). Using a safe default size of $GASNETI_CACHE_LINE_BYTES]) fi AC_DEFINE_UNQUOTED(GASNETI_CACHE_LINE_BYTES,$GASNETI_CACHE_LINE_BYTES) AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = yes) PTHREADS="$have_pthread" AC_SUBST(PTHREADS) ## Solaris threads AC_CHECK_LIB(thread, thr_create, have_solthread=yes, have_solthread=no) AC_MSG_CHECKING(for x86 pause instruction) AC_TRY_COMPILE([], [ #if defined(__i386__) || defined(__x86_64__) || defined(__ia64__) __asm__ __volatile__ ("pause" : : : "memory"); #else #error wrong CPU architecture #endif ], [AC_DEFINE(HAVE_X86_PAUSE_INSTRUCTION) AC_MSG_RESULT(yes) ], [AC_MSG_RESULT(no)]) #--------------------------------------------------------------------------------------------------------------- # Check for overrides of compile-time checks for SMPs GASNET_IF_ENABLED_WITH_AUTO(smp-safe, Enable build of SMP-safe libraries (default is to probe at configure time), [ uni_build=no ], [ uni_build=yes], [ AC_CHECK_HEADERS(/boot/kernel.h) AC_MSG_CHECKING(whether to force a uni-processor build) if test "`uname -a | grep -i SMP`" != ""; then uni_build=no; else AC_TRY_COMPILE([ /* Note that we try to error on the side of an SMP */ #if defined(__linux__) #include #if defined(CONFIG_SMP) #error Make the AC_TRY_COMPILE fail (SMP) #endif #ifdef HAVE__BOOT_KERNEL_H #include #if defined(__BOOT_KERNEL_SMP) && (__BOOT_KERNEL_SMP == 1) #error Make the AC_TRY_COMPILE fail (SMP) #endif #endif #elif defined(__FreeBSD__) #if defined(SMP) #error Make the AC_TRY_COMPILE fail (SMP) #endif #else #error Make the AC_TRY_COMPILE fail (SMP) #endif ], [], [ uni_build=yes ], [ uni_build=no ]) fi AC_MSG_RESULT($uni_build) ] ) if test "$uni_build" = yes; then AC_DEFINE(GASNETI_UNI_BUILD) fi GASNET_IF_ENABLED(loopback-memsync, Force memory barriers for GASNet local (loopback) puts and gets, [AC_DEFINE(GASNETI_MEMSYNC_ON_LOOPBACK)]) GASNET_IF_ENABLED(throttle-poll, throttle polling threads in multi-threaded configurations to reduce contention, [AC_DEFINE(GASNETI_THROTTLE_FEATURE_ENABLED)]) #--------------------------------------------------------------------------------------------------------------- # CONDUIT CONFIGURATIONS #--------------------------------------------------------------------------------------------------------------- CONDUITS= AC_SUBST(CONDUITS) # reporting file output at completion CONDUIT_LIST=.gasnet-conduit-list.tmp echo > $CONDUIT_LIST AC_DEFUN([CONDUIT_REPORT],[echo " CONDUIT_DESC m4_substr([ ],len(CONDUIT_DESC))$1" >> $CONDUIT_LIST]) echo " Portable conduits:" >> $CONDUIT_LIST echo " -----------------" >> $CONDUIT_LIST #--------------------------------------------------------------------------------------------------------------- # UDP/AMUDP Configuration # Hack-around to prevent a bogus autoconf 2.58 bug when AC_PROG_CXX is called conditionally below am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= pushdef([CONDUIT_DESC],[portable UDP network conduit (udp)]) GASNET_IF_ENABLED_WITH_AUTO(udp, Enable/disable the CONDUIT_DESC (auto-detected), [enabled_udp=yes;force_udp=yes], enabled_udp=no, enabled_udp=yes) if test $enabled_udp = yes; then # Do C++ configuration AC_LANG_SAVE GASNET_PROG_CXXCPP GASNET_PROG_CXX have_cxx=1 AC_LANG_CPLUSPLUS GASNET_FAMILY_CACHE_CHECK(C++, CXX, gasnet_cv_cxx_family) CXXDEBUGFLAGS="-g" CXXOPTFLAGS="-O2" GASNET_UDP_LIBS="" case "$gasnet_cv_cxx_family" in GNU) GASNET_GCC_VERSION_CHECK(CXX) GASNET_PUSHVAR(CXXFLAGS,"$CXXFLAGS") GASNET_GET_GNUWARNINGFLAGS(CXX) MISC_CXXFLAGS="$CXXFLAGS" case "$target_cpu" in sparc) # Get sparc v9 ISA GASNET_TRY_CXXFLAG([-mcpu=ultrasparc -mtune=ultrasparc], [ MISC_CXXFLAGS="$MISC_CXXFLAGS -mcpu=ultrasparc -mtune=ultrasparc" AC_DEFINE(GASNETI_ARCH_SPARCV9) ] ) ;; *) ;; esac GASNET_POPVAR(CXXFLAGS) ;; PGI) MISC_CXXFLAGS="-w -Masmkeyword" ;; # apparently has no way to indep control warnings KAI) MISC_CXXFLAGS="--diag_suppress 611 --diag_suppress 610" ;; MIPS) MISC_CXXFLAGS="-diag_error 1035 -diag_suppress 1171,1174,1209,1552,1681,1682 -LANG:std -common" ;; HP) MISC_CXXFLAGS="+W612 +W749 +W2111 +W2174 +W2177 +W2236 +W2550" ;; Compaq) MISC_CXXFLAGS="-msg_disable extrasemi,boolexprconst,codeunreachable" ;; MTA) MISC_CXXFLAGS="-exceptions -display_error_number -WS 111,174,238" CXXDEBUGFLAGS="-g2" CXXOPTFLAGS="-O3" ;; Intel) MISC_CXXFLAGS="-wd654 -wd1125 -wd279" GASNET_TRY_CXXFLAG([-wd1572], [MISC_CXXFLAGS="$MISC_CXXFLAGS -wd1572"]) ;; XLC) MISC_CXXFLAGS="-qsuppress=1540-0809" # 1540-0809 = empty source file (some linux headers) case "$target_os" in aix*) MISC_CXXFLAGS="$MISC_CXXFLAGS -qeh -qweaksymbol" ;; *) MISC_CXXFLAGS="$MISC_CXXFLAGS -qeh" ;; esac ;; NEC) MISC_CXXFLAGS="-woff=68:111:174:177:236:301:550:940 -Kexceptions" CXXDEBUGFLAGS="-g -Cnoopt -Cdebug" GASNET_UDP_LIBS="-Kexceptions" ;; Cray) case "$target_cpu" in # Cray CC v3.3.0.2 fails to accept "-htaskprivate", but accepts "-htask private" alphaev5) MISC_CXXFLAGS="-hnomessage=236:611:997 -hexceptions -hnew_for_init -htask private $LIBCM" ;; # T3E *) MISC_CXXFLAGS="-hnomessage=236:611:997 -hexceptions -hnew_for_init $LIBCM" ;; # X1 esac ;; esac if test "$BUILDCONFIG" = "optimize" ; then CXXFLAGS="$CXXOPTFLAGS" else CXXFLAGS="$CXXDEBUGFLAGS" fi GASNET_CHECK_OPTIMIZEDDEBUG(CXX,CXXFLAGS,[$CXXCPPFLAGS $MISC_CXXFLAGS $BUILDCONFIG_DEFINES],[]) GASNET_PUSHVAR(CXXFLAGS,"$CXXFLAGS $CXXCPPFLAGS $MISC_CXXFLAGS $BUILDCONFIG_DEFINES") GASNET_TRY_CACHE_VERIFY_RUN( [for working C++ exceptions], cxx_exceptions, [ ], [ try { int *p = new int[[10]]; throw p; return 1; } catch (int *exn) { if (exn) return 0; else return 2; } ], [ "I can\'t figure out how to build and run a program that uses C++ exceptions" ] ) GASNET_POPVAR(CXXFLAGS) AC_SUBST(MISC_CXXFLAGS) AC_LANG_RESTORE supported_amudp=yes if test "$force_udp$supported_udp" = yesno ; then AC_MSG_ERROR(User requested --enable-udp but AMUDP is not supported on your system) fi if test $supported_amudp = yes; then # detect libraries necessary for udp-* backends GASNET_PUSHVAR(LIBS,"") AC_SEARCH_LIBS(socket, socket, have_udp=yes, have_udp=no) AC_SEARCH_LIBS(gethostbyname, nsl, , have_udp=no) GASNET_UDP_LIBS="$GASNET_UDP_LIBS $LIBS" if test "$have_udp" = yes ; then AC_MSG_CHECKING(for working UDP configuration) # TODO: add a basic test of the UDP configuration to make sure it works # this is a mess because every OS has different headers required udp_test_worked=yes if test "$udp_test_worked" = yes ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_MSG_WARN(build test failed: I don't know how to build UDP programs on your system) have_udp=no fi fi if test "$force_udp$have_udp" = yesno ; then GASNET_MSG_ERROR(User requested --enable-udp but I don't know how to build UDP programs for your system) fi GASNET_POPVAR(LIBS) fi fi AM_CONDITIONAL(HAVE_CXX, test "$have_cxx" = 1) AC_SUBST(GASNET_UDP_LIBS) AM_CONDITIONAL(USE_UDP_CONDUIT, test "$enabled_udp$have_udp" = yesyes) if test "$enabled_udp$have_udp" = yesyes ; then CONDUITS="$CONDUITS udp" CONDUIT_REPORT(ON) else CONDUIT_REPORT(OFF) fi popdef([CONDUIT_DESC]) GASNET_ENV_DEFAULT(GASNET_CSPAWN_CMD, "$TI_CSPAWN_CMD") if test "$GASNET_CSPAWN_CMD" != "" ; then AC_DEFINE_UNQUOTED(GASNET_CSPAWN_CMD, "$GASNET_CSPAWN_CMD") fi #--------------------------------------------------------------------------------------------------------------- # MPI/AMMPI Configuration # (In the future it would be nice to try and discover MPI setup automatically) pushdef([CONDUIT_DESC],[portable MPI-1.1 network conduit (mpi)]) GASNET_IF_ENABLED_WITH_AUTO(mpi, Enable/disable the CONDUIT_DESC (auto-detected), [enabled_mpi=yes;force_mpi=yes], enabled_mpi=no, enabled_mpi=yes) if test $enabled_mpi = yes; then # user can explicitly configure MPI by setting MPI_CC, MPI_CFLAGS and MPI_LIBS have_mpi=yes # start by assuming they have it if test "$BUILDCONFIG" = "debug" ; then SAFE_MPI_CFLAGS="-g" else SAFE_MPI_CFLAGS="-O" fi case "$target_os" in solaris*) # I don't have access to a Solaris cluster with MPI (other than NOW) # but these seem like sane defaults GASNET_ENV_DEFAULT(MPI_CC, mpicc) GASNET_SET_CHECKED_CFLAGS(MPI_CC, MPI_CFLAGS, $MISC_CFLAGS $CFLAGS, $SAFE_MPI_CFLAGS) GASNET_ENV_DEFAULT(MPI_LIBS, ) GASNET_ENV_DEFAULT(MPIRUN_CMD, mpirun -np %N %C) ;; linux*) GASNET_ENV_DEFAULT(MPI_CC, mpicc) GASNET_SET_CHECKED_CFLAGS(MPI_CC, MPI_CFLAGS, $MISC_CFLAGS $CFLAGS, $SAFE_MPI_CFLAGS) GASNET_ENV_DEFAULT(MPI_LIBS, ) GASNET_ENV_DEFAULT(MPIRUN_CMD, mpirun -np %N %C) ;; irix*) # use SGI native MPI library # user may need to do a "module load mpt" to make this work GASNET_ENV_DEFAULT(MPI_CC, cc -n32) # cannot use MISC_CFLAGS here because C compiler may not be MIPSPro # -common gets us correct linking behavior for tentative definitions BASIC_MPI_CFLAGS="-diag_error 1035 -diag_suppress1171,1174,1209,1552 -common" if test "$BUILDCONFIG" = "optimize" ; then BASIC_MPI_CFLAGS="-O2 $BASIC_MPI_CFLAGS" else BASIC_MPI_CFLAGS="-g $BASIC_MPI_CFLAGS" fi GASNET_SET_CHECKED_CFLAGS(MPI_CC, MPI_CFLAGS, $BASIC_MPI_CFLAGS, $SAFE_MPI_CFLAGS) GASNET_ENV_DEFAULT(MPI_LIBS, -lmpi) GASNET_ENV_DEFAULT(MPIRUN_CMD, mpirun -np %N %C) ;; aix*) GASNET_ENV_DEFAULT(MPI_CC, mpcc) BASIC_MPI_CFLAGS="" if test "$BUILDCONFIG" = "optimize" ; then BASIC_MPI_CFLAGS="-O3 -qstrict -qarch=auto -qtune=auto -qsmp=noauto -qmaxmem=-1 $BASIC_MPI_CFLAGS" else BASIC_MPI_CFLAGS="-g $BASIC_MPI_CFLAGS" fi GASNET_SET_CHECKED_CFLAGS(MPI_CC, MPI_CFLAGS, $BASIC_MPI_CFLAGS, $SAFE_MPI_CFLAGS) GASNET_ENV_DEFAULT(MPI_LIBS, [-Wl,-bbigtoc]) GASNET_ENV_DEFAULT(MPIRUN_CMD, poe %C -nodes %N -tasks_per_node 1 -rmpool 1 -euilib us -retry 1 -retrycount 10000 -msg_api mpi) ;; osf*) GASNET_ENV_DEFAULT(MPI_CC, cc) BASIC_MPI_CFLAGS="-msg_disable extrasemi" if test "$BUILDCONFIG" = "optimize" ; then BASIC_MPI_CFLAGS="-fast -noifo -O4 -tune host -inline speed $BASIC_MPI_CFLAGS" else BASIC_MPI_CFLAGS="-g $BASIC_MPI_CFLAGS" fi GASNET_SET_CHECKED_CFLAGS(MPI_CC, MPI_CFLAGS, $BASIC_MPI_CFLAGS, $SAFE_MPI_CFLAGS) GASNET_ENV_DEFAULT(MPI_LIBS, -lmpi -lelan -lrt) GASNET_ENV_DEFAULT(MPIRUN_CMD, prun -N %N %C) ;; unicos*) # Cray cc - need to enable private global vars and disable a silly warning # user may need to do a "module load mpt" to make this work GASNET_ENV_DEFAULT(MPI_CC, cc) case "$target_cpu" in alphaev5) BASIC_MPI_CFLAGS="-hnomessage=236 -htaskprivate $LIBCM" # T3E GASNET_ENV_DEFAULT(MPIRUN_CMD, mpprun -n %N %C) GASNET_ENV_DEFAULT(MPI_LIBS, ) ;; *) BASIC_MPI_CFLAGS="-hnomessage=236 $LIBCM" # X1 GASNET_ENV_DEFAULT(MPIRUN_CMD, mpirun -np %N %C) GASNET_ENV_DEFAULT(MPI_LIBS, -lpthread) ;; esac if test "$BUILDCONFIG" = "optimize" ; then BASIC_MPI_CFLAGS="-O2 $BASIC_MPI_CFLAGS" else BASIC_MPI_CFLAGS="-g $BASIC_MPI_CFLAGS" fi GASNET_SET_CHECKED_CFLAGS(MPI_CC, MPI_CFLAGS, $BASIC_MPI_CFLAGS, $SAFE_MPI_CFLAGS) ;; mtx*) GASNET_ENV_DEFAULT(MPI_CC, cc) GASNET_SET_CHECKED_CFLAGS(MPI_CC, MPI_CFLAGS, $MISC_CFLAGS $CFLAGS, $SAFE_MPI_CFLAGS) GASNET_ENV_DEFAULT(MPI_LIBS, -lmpi) GASNET_ENV_DEFAULT(MPIRUN_CMD, mtarun -t %N -m %N /usr/bin/env _MPI_MT=%N %C) ;; superux*) GASNET_ENV_DEFAULT(MPI_CC, mpic++ -Xa) GASNET_SET_CHECKED_CFLAGS(MPI_CC, MPI_CFLAGS, $MISC_CFLAGS $CFLAGS, $SAFE_MPI_CFLAGS) GASNET_ENV_DEFAULT(MPI_LIBS, ) GASNET_ENV_DEFAULT(MPIRUN_CMD, mpirun -np %N %C) ;; *) # unknown OS - if user doesn't provide info, nothing we can do GASNET_ENV_DEFAULT(MPI_CC, mpicc) GASNET_SET_CHECKED_CFLAGS(MPI_CC, MPI_CFLAGS, $MISC_CFLAGS $CFLAGS, $SAFE_MPI_CFLAGS) GASNET_ENV_DEFAULT(MPI_LIBS, ) GASNET_ENV_DEFAULT(MPIRUN_CMD, mpirun -np %N %C) if test "$MPI_CC" = ""; then AC_MSG_WARN(I don't know how to build MPI programs on your system) AC_MSG_WARN(consider using \$MPI_CC \$MPI_CFLAGS and \$MPI_LIBS to configure MPI support for your site if you want the mpi-* backends) MPI_CC=$CC have_mpi=no fi ;; esac GASNET_GETFULLPATH(MPI_CC) GASNET_GETFULLPATH(MPIRUN_CMD) MPI_CFLAGS="$BUILDCONFIG_DEFINES $MPI_CFLAGS" # now run a basic test of the MPI configuration to make sure it works if test $have_mpi = yes; then AC_MSG_CHECKING(building MPI helper object) # we link in an object compiled with CC that uses libc, to ensure that's working MPIHELPER_BASE=conftest_cfunc MPIHELPER_SRC=$MPIHELPER_BASE.c MPIHELPER_OBJ=$MPIHELPER_BASE.o MPIHELPER_LIBS="$MPIHELPER_OBJ $LIBM" MPIHELPER_CODE="extern int mpihelper_cint; extern void mpihelper_cfunc(int val); mpihelper_cfunc(mpihelper_cint);" cat >$MPIHELPER_BASE.c <<_GASNET_EOF #include #include #include #include int mpihelper_cint = 0xFFFF; extern void mpihelper_cfunc(int val) { char s[[255]], s2[[255]]; int a[[40]] = {1}; /* trigger Intel C issue */ assert(val == mpihelper_cint); s[[4]] = '\0'; s[[5]] = (char)(sin((double)val)+cos((double)val))+sqrt((double)val)+log((double)val); strcpy(s2, s); memcpy(s2, s, strlen(s)); memmove(s2, s, strlen(s)); memcpy(s2, s, 4); memmove(s2, s, 4); fprintf(stdout,"hi\n"); } _GASNET_EOF compile="$CC $CFLAGS $CPPFLAGS -c $MPIHELPER_SRC" eval echo "$compile" >&5 if eval $compile 2>&5 && test -s $MPIHELPER_OBJ ; then AC_MSG_RESULT(ok) else AC_MSG_ERROR(failed while building MPI helper object) fi AC_MSG_CHECKING(for working MPI configuration) # we need a clean slate here because MPI config may be totally different GASNET_PUSHVAR(CC,"$MPI_CC") GASNET_PUSHVAR(CFLAGS,"$MPI_CFLAGS") GASNET_PUSHVAR(CPPFLAGS,"") GASNET_PUSHVAR(LDFLAGS,"") GASNET_PUSHVAR(LIBS,"$MPIHELPER_LIBS $MPI_LIBS") # we just try to link an MPI app - running MPI apps is a whole new can of worms AC_TRY_LINK( [ #include ], [ $MPIHELPER_CODE MPI_Init((void*)0,(void*)0); MPI_Finalize(); ], [ mpi_test_worked=yes ], [ mpi_test_worked=no GASNET_ERR_SAVE() ] ) GASNET_POPVAR(CC) GASNET_POPVAR(CFLAGS) GASNET_POPVAR(CPPFLAGS) GASNET_POPVAR(LDFLAGS) GASNET_POPVAR(LIBS) rm -f $MPIHELPER_OBJ fi if test "$mpi_test_worked" = yes ; then AC_MSG_RESULT(yes) if echo "$MPI_CFLAGS" | grep -- "-DAMMPI_COEXIST_WITH_AM" > /dev/null ; then # -DAMMPI_COEXIST_WITH_AM must be included whenever ammpi.h is compiled, or not at all MPI_DEFINES="$MPI_DEFINES -DAMMPI_COEXIST_WITH_AM" fi GASNET_CHECK_OPTIMIZEDDEBUG(MPI_CC,MPI_CFLAGS,[], [ #include ]) else AC_MSG_RESULT(no) AC_MSG_WARN(build test failed: I don't know how to build MPI programs on your system -- see $TOP_BUILDDIR/config.log for details) AC_MSG_WARN(consider using \$MPI_CC \$MPI_CFLAGS and \$MPI_LIBS to configure MPI support for your site if you want the mpi conduit) have_mpi=no fi if test "$force_mpi$have_mpi" = yesno ; then GASNET_MSG_ERROR(User requested --enable-mpi but I don't know how to build MPI programs for your system) fi if test "$have_mpi" = no ; then mpi_reason="was not found" fi else have_mpi=no mpi_reason="was disabled" fi AC_SUBST(MPI_CC) # compiler to be used to build AMMPI, and linker for AMMPI-based backends AC_SUBST(MPI_CFLAGS) # compiler flags (optimization, includes, etc) to be used with above compiler when building AMMPI AC_SUBST(MPI_LIBS) # libs and ldflags that must be used when linking AMMPI-based backend AC_SUBST(MPI_DEFINES) # preprocessor defs to be used for all client code that includes ammpi.h (not including AMMPI library itself) AC_SUBST(MPIRUN_CMD) # prototype command used by tcrun to run MPI programs AM_CONDITIONAL(USE_MPI_CONDUIT, test "$enabled_mpi$have_mpi" = yesyes) if test "$enabled_mpi$have_mpi" = yesyes ; then CONDUITS="$CONDUITS mpi" CONDUIT_REPORT(ON) else CONDUIT_REPORT(OFF) fi popdef([CONDUIT_DESC]) #----------------------------------------------------------------------------------------------- # SMP configuration pushdef([CONDUIT_DESC],[portable SMP-loopback network conduit (smp)]) GASNET_IF_ENABLED_WITH_AUTO(smp, Enable/disable the CONDUIT_DESC (auto-detected), have_smp=yes, have_smp=no, have_smp=yes) AM_CONDITIONAL(USE_SMP_CONDUIT, test "$have_smp" = yes) if test "$have_smp" = yes ; then CONDUITS="$CONDUITS smp" CONDUIT_REPORT(ON) else CONDUIT_REPORT(OFF) fi popdef([CONDUIT_DESC]) echo " " >> $CONDUIT_LIST echo " Native, high-performance conduits:" >> $CONDUIT_LIST echo " ---------------------------------" >> $CONDUIT_LIST #-------------------------------------------------------------------------------------------------------- # GM configuration pushdef([CONDUIT_DESC],[Myricom/GM network conduit (gm)]) GASNET_IF_ENABLED_WITH_AUTO(gm, Enable/disable the CONDUIT_DESC (auto-detected), [enabled_gm=yes;force_gm=yes], enabled_gm=no, enabled_gm=yes) if test $enabled_gm = yes; then # Assume the best have_gm=yes # Look for gm binaries in our path AC_PATH_PROGS(gm_board_info, gm_board_info) case "$gm_board_info" in '') gm_guess=/usr/local/gm ;; *) gm_guess=`dirname $gm_board_info` gm_guess=`dirname $gm_guess` ;; esac GASNET_ENV_DEFAULT(GMHOME, $gm_guess) case "$target_os" in solaris*) ;; *) # All unknown for now GASNET_ENV_DEFAULT(GM_INCLUDE, $GMHOME/include) GASNET_ENV_DEFAULT(GM_LIB, $GMHOME/lib) if test "$GM_INCLUDE" = "" || test ! -d "$GM_INCLUDE"; then have_gm=no fi if test "$GM_LIB" = ""; then have_gm=no fi ;; esac if test $have_gm = yes; then AC_MSG_CHECKING(for working GM configuration) GASNET_PUSHVAR(CFLAGS,"$CFLAGS -I$GM_INCLUDE -L$GM_LIB") GASNET_PUSHVAR(LIBS,"$LIBS -lgm") # try to compile and link a simple gm_init, gm_finalize AC_TRY_LINK( [ #include #include ], [ gm_init(); gm_finalize(); ], [ gm_test_worked=yes ], [ gm_test_worked=no GASNET_ERR_SAVE() ] ) GASNET_POPVAR(CFLAGS) GASNET_POPVAR(LIBS) if test "$gm_test_worked" = yes; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) have_gm=no fi # GM conduit was shown to break horribly on some versions of gcc, because # of our reuse of memory storage in firehose. We disable strict aliasing # altogether as the problem appears and disappears across gcc3 minor # versions. # This is a firehose problem, and bug #1052 showed xlc to be affected as well. case "$gasnet_cv_cc_family" in GNU) GM_NO_ALIAS="-fno-strict-aliasing";; Pathscale) GM_NO_ALIAS="-fno-strict-aliasing";; XLC) GM_NO_ALIAS="-qnoansialias -qalias=addr";; *) GM_NO_ALIAS="";; esac # Only test if working GM config if test $have_gm = yes; then GASNET_IF_ENABLED(broken-gm, Allow 2.x GM versions with broken RDMA gets, [AC_DEFINE(GASNETC_GM_ENABLE_BROKEN_VERSIONS) allow_broken_gm=yes], [allow_broken_gm=no]) # Now test to see if the targetted GM is a broken one # broken gm builds AC_MSG_CHECKING(for broken GM 2.x RDMA gets build) GASNET_PUSHVAR(CFLAGS,"$CFLAGS -I$GM_INCLUDE -L$GM_LIB") GASNET_PUSHVAR(LIBS,"$LIBS -lgm") AC_TRY_COMPILE([ #include ], [ #if GM_API_VERSION_2_0 && \ ((GM_API_VERSION_2_1_0 && GM_API_VERSION < 0x20102) || \ GM_API_VERSION < 0x2000c) #error GM build is broken #endif ], [ gm_build_broken=no ], [ gm_build_broken=yes ]) if test "$gm_build_broken" = yes; then if test "$allow_broken_gm" = no; then AC_MSG_RESULT(yes) AC_MSG_ERROR(Detected a broken GM 2.x RDMA gets build. See gm-conduit/README) else AC_MSG_RESULT(yes which disables RDMA gets) fi else AC_MSG_RESULT(no) fi GASNET_POPVAR(CFLAGS) GASNET_POPVAR(LIBS) force_enable_gm_mpi_compat=no AC_MSG_CHECKING(for GM interoperability with MPI) GASNET_IF_ENABLED_WITH_AUTO(gm-mpi-compat, Enable/disable GM interoperability with MPI (enabled if MPI detected), [force_enable_gm_mpi_compat=yes; enabled_gm_mpi_compat=yes], enabled_gm_mpi_compat=no, enabled_gm_mpi_compat=yes) if test "$enabled_gm_mpi_compat" = yes; then if test "$have_mpi" = yes; then AC_DEFINE(GASNETC_GM_MPI_COMPAT) GM_MPI_COMPAT='yes' else GM_MPI_COMPAT='no' if test "$force_enable_gm_mpi_compat" = yes; then AC_MSG_ERROR([GM requires a working MPI for interoperability. Install MPI \ and fix detection OR rerun configure with --disable-gm-mpi-compat]) else AC_MSG_WARN([GM requires MPI for interoperability and MPI $mpi_reason - disabling feature]) fi fi else GM_MPI_COMPAT='no' fi AC_MSG_RESULT($GM_MPI_COMPAT) fi fi if test "$force_gm$have_gm" = yesno ; then GASNET_MSG_ERROR(User requested --enable-gm but I don't know how to build GM programs for your system) fi fi AC_SUBST(GM_INCLUDE) AC_SUBST(GM_LIB) AC_SUBST(GM_NO_ALIAS) AC_SUBST(GM_MPI_COMPAT) AM_CONDITIONAL(USE_GM_CONDUIT, test "$enabled_gm$have_gm" = yesyes) AM_CONDITIONAL(GM_MPI_COMPAT, test "$GM_MPI_COMPAT" = yes) GASNET_IF_ENABLED(gm-rodata-workaround, [Enable rodata permissions hack to work-around GM's inability to register read-only program data segments], [gm_rodata_workaround=yes]) AM_CONDITIONAL(GM_RODATA_WORKAROUND, test "$gm_rodata_workaround" = yes) if test "$enabled_gm$have_gm" = yesyes ; then CONDUITS="$CONDUITS gm" CONDUIT_REPORT(ON) else CONDUIT_REPORT(OFF) fi popdef([CONDUIT_DESC]) #-------------------------------------------------------------------------------------------------------- # LAPI configuration pushdef([CONDUIT_DESC],[LAPI (IBM SP) network conduit (lapi)]) GASNET_IF_ENABLED_WITH_AUTO(lapi, Enable the CONDUIT_DESC (auto-detected), [enabled_lapi=yes;force_lapi=yes], enabled_lapi=no, enabled_lapi=yes) if test "$force_lapi$have_pthread" = yesno; then AC_MSG_ERROR([lapi-conduit requires pthread support but pthreads $pthread_reason]) fi if test "$enabled_lapi$have_pthread" = yesno; then enabled_lapi=no AC_MSG_WARN([lapi-conduit requires pthread support but pthreads $pthread_reason - disabling lapi]) fi if test "$enabled_lapi" = yes; then AC_MSG_CHECKING(for working LAPI configuration) GASNET_PUSHVAR(LIBS,"$LIBS -llapi_r -lpthread") # try to compile and link a simple LAPI program AC_TRY_LINK( [ #include #include ], [{ lapi_handle_t gasnetc_lapi_context; lapi_info_t gasnetc_lapi_info; memset(&gasnetc_lapi_info, 0, sizeof(lapi_info_t)); LAPI_Init(&gasnetc_lapi_context, &gasnetc_lapi_info); }], [ have_lapi=yes ], [ have_lapi=no GASNET_ERR_SAVE() ] ) GASNET_POPVAR(LIBS) AC_MSG_RESULT($have_lapi) # Check for hardware version if test "$have_lapi" = "yes"; then have_fed="no" have_col="no" lapi_how="selected" GASNET_WITH(lapi-type, [IBM Switch hardware type ("colony" or "federation", default is to probe)], [case "$withval" in [[cC]]olony|COLONY) have_col="yes" ;; [[fF]]ederation|FEDERATION) have_fed="yes" ;; *) AC_MSG_ERROR([Unrecognized value "$withval" passed to --with-lapi-type. Legal values are "colony" or "federation".]); esac], [have_lapi=no], [AC_MSG_CHECKING([for Federation Switch hardware]) if test -n "`lscfg -l sni0 2> /dev/null | grep -- sni0`" ; then have_fed="yes" fi AC_MSG_RESULT([$have_fed]) AC_MSG_CHECKING([for Colony Switch hardware]) if test -n "`lscfg -l css0 2> /dev/null | grep -- css0`" ; then have_col="yes" fi AC_MSG_RESULT([$have_col]) lapi_how="found"]) if test "${have_fed}${have_col}" = "yesyes"; then AC_MSG_WARN([Both Federation and Colony Switch hardware $lapi_how - disabling lapi. Pass exactly one of --with-lapi-type=colony or --with-lapi-type=federation to select one.]) have_lapi="no" elif test "${have_fed}" = "yes"; then AC_DEFINE(GASNETC_LAPI_FEDERATION) AC_MSG_CHECKING([For LAPI Federation Version]) LAPI_VER=`lslpp -l | grep rsct.lapi.rte 2>/dev/null | tail -1 | $AWK '{print $2}'` if test -z "$LAPI_VER" ; then AC_MSG_WARN([Could not detect LAPI version number with lslpp. ]) else LAPI_VER_NUM1=`echo $LAPI_VER | cut -d\. -f 1` AC_DEFINE_UNQUOTED(GASNETC_LAPI_VERSION_A,$LAPI_VER_NUM1) LAPI_VER_NUM2=`echo $LAPI_VER | cut -d\. -f 2` AC_DEFINE_UNQUOTED(GASNETC_LAPI_VERSION_B,$LAPI_VER_NUM2) LAPI_VER_NUM3=`echo $LAPI_VER | cut -d\. -f 3` AC_DEFINE_UNQUOTED(GASNETC_LAPI_VERSION_C,$LAPI_VER_NUM3) LAPI_VER_NUM4=`echo $LAPI_VER | cut -d\. -f 4` AC_DEFINE_UNQUOTED(GASNETC_LAPI_VERSION_D,$LAPI_VER_NUM4) fi AC_MSG_RESULT([$LAPI_VER]) elif test "${have_col}" = "yes"; then AC_DEFINE(GASNETC_LAPI_COLONY) AC_MSG_CHECKING([For LAPI Colony Version]) LAPI_VER=`lslpp -l | grep ssp.css.lapi 2>/dev/null | tail -1 | $AWK '{print $2}'` if test -z "$LAPI_VER" ; then AC_MSG_WARN([Could not detect LAPI version number with lslpp. ]) else LAPI_VER_NUM1=`echo $LAPI_VER | cut -d\. -f 1` AC_DEFINE_UNQUOTED(GASNETC_LAPI_VERSION_A,$LAPI_VER_NUM1) LAPI_VER_NUM2=`echo $LAPI_VER | cut -d\. -f 2` AC_DEFINE_UNQUOTED(GASNETC_LAPI_VERSION_B,$LAPI_VER_NUM2) LAPI_VER_NUM3=`echo $LAPI_VER | cut -d\. -f 3` AC_DEFINE_UNQUOTED(GASNETC_LAPI_VERSION_C,$LAPI_VER_NUM3) LAPI_VER_NUM4=`echo $LAPI_VER | cut -d\. -f 4` AC_DEFINE_UNQUOTED(GASNETC_LAPI_VERSION_D,$LAPI_VER_NUM4) fi AC_MSG_RESULT([$LAPI_VER]) else AC_MSG_WARN([No IBM SP Switch hardware $lapi_how - disabling lapi]) have_lapi="no" fi fi # Check for conflict if test "$force_lapi$have_lapi" = yesno; then GASNET_MSG_ERROR([User requested --enable-lapi but I don't know how to build LAPI programs for your system.]) fi if test x"$ac_cv_sizeof_void_p" = x4; then LAPI_LD="mpcc_r" else LAPI_LD="mpcc_r -q64" fi AC_SUBST(LAPI_LD) fi AM_CONDITIONAL(USE_LAPI_CONDUIT, test "$have_lapi" = yes) if test "$have_lapi" = yes ; then CONDUITS="$CONDUITS lapi" CONDUIT_REPORT(ON) else CONDUIT_REPORT(OFF) fi popdef([CONDUIT_DESC]) #-------------------------------------------------------------------------------------------------------- # ELAN configuration pushdef([CONDUIT_DESC],[Quadrics Elan3/Elan4 network conduit (elan)]) GASNET_IF_ENABLED_WITH_AUTO(elan, Enable/disable the CONDUIT_DESC (auto-detected), [enabled_elan=yes;force_elan=yes], enabled_elan=no, enabled_elan=yes) if test $enabled_elan = yes; then case "$target_os" in linux*) # the default locations are /usr/include and /usr/lib # rms libs are only there to support signalling exit, # if they're problematic they can be removed provided # you compile with -DGASNETC_USE_SIGNALING_EXIT=0 GASNET_ENV_DEFAULT(ELAN_INCLUDE, /usr/include) ;; *) # the default locations are /usr/opt/rms/include and /usr/lib GASNET_ENV_DEFAULT(ELAN_INCLUDE, /usr/opt/rms/include) ;; esac ELAN_HEADERBASE="${ELAN_INCLUDE}" # Don't actually place -I/usr/include on the compile line, because this # breaks IA64 Intel C, which relies on preceding /usr/include with its own # include directory that overrides some system headers (eg asm/*) if test "`cd ${ELAN_INCLUDE} 2>/dev/null; pwd`" = "/usr/include"; then ELAN_INCLUDE=. fi AC_MSG_CHECKING(for ELAN device driver headers) if test -f "$ELAN_HEADERBASE/elan4/library.h" ; then AC_MSG_RESULT(elan4) ELANDEVLIB="-lelan4" AC_DEFINE(GASNETC_ELAN4) have_elan=yes else if test -f "$ELAN_HEADERBASE/elan3/elan3.h" ; then AC_MSG_RESULT(elan3) ELANDEVLIB="-lelan3" AC_DEFINE(GASNETC_ELAN3) have_elan=yes else AC_MSG_RESULT(none found) have_elan=no fi fi if test $have_elan = yes; then GASNET_PUSHVAR(CFLAGS,"$CFLAGS -I$ELAN_INCLUDE") GASNET_PUSHVAR(LIBS,"$LIBS") # librmscall used by any elan program, librms also used on older systems RMSLIBS="-lrmscall" AC_CHECK_LIB(rms, main, RMSLIBS="$RMSLIBS -lrms") # look for RMS rcontrol AC_MSG_CHECKING(for RMS rcontrol) RMS_RCONTROL_PATH=`which rcontrol 2> /dev/null` if test -x "$RMS_RCONTROL_PATH" -a \ "`$RMS_RCONTROL_PATH help 2> /dev/null | grep signal`" != "" ; then AC_DEFINE_UNQUOTED(RMS_RCONTROL_PATH,$RMS_RCONTROL_PATH) AC_MSG_RESULT($RMS_RCONTROL_PATH) else AC_MSG_RESULT(no) fi # rmsapi is used for RMS signalling exit AC_CHECK_HEADERS(rms/rmsapi.h) AC_CHECK_LIB(rmsapi, rms_killResource, AC_DEFINE(HAVE_RMS_KILLRESOURCE) RMSLIBS="$RMSLIBS -lrmsapi") # look for SLURM scancel AC_MSG_CHECKING(for SLURM scancel) SLURM_SCANCEL_PATH=`which scancel 2> /dev/null` if test -x "$SLURM_SCANCEL_PATH" -a \ "`$SLURM_SCANCEL_PATH -V 2> /dev/null | grep slurm`" != "" ; then AC_DEFINE_UNQUOTED(SLURM_SCANCEL_PATH,$SLURM_SCANCEL_PATH) AC_MSG_RESULT($SLURM_SCANCEL_PATH) else AC_MSG_RESULT(no) fi # slurm API is used for SLURM signalling exit AC_CHECK_HEADERS(slurm/slurm.h) AC_CHECK_LIB(slurm, slurm_kill_job, AC_DEFINE(HAVE_SLURM_KILL_JOB) RMSLIBS="$RMSLIBS -lslurm") GASNET_ENV_DEFAULT(ELAN_LIBS, -lelan $ELANDEVLIB $RMSLIBS) AC_CHECK_LIB(elan, elan_queueMaxSlotSize, AC_DEFINE(HAVE_ELAN_QUEUEMAXSLOTSIZE)) AC_CHECK_LIB(elan, elan_queueTxInit, AC_DEFINE(HAVE_ELAN_QUEUETXINIT)) AC_CHECK_LIB(elan, elan_done, AC_DEFINE(HAVE_ELAN_DONE)) LIBS="$ELAN_LIBS" AC_MSG_CHECKING(for working ELAN configuration) # try to compile and link a simple elan prog AC_TRY_LINK( [ #include #include ], [ #ifdef QSNETLIBS_VERSION_CODE #if QSNETLIBS_VERSION_CODE >= QSNETLIBS_VERSION(1,4,10) elan_baseInit(0); #else elan_baseInit(); #endif #else elan_baseInit(); #endif ], [ elan_test_worked=yes ], [ elan_test_worked=no ] ) GASNET_POPVAR(CFLAGS) GASNET_POPVAR(LIBS) if test "$elan_test_worked" = yes; then AC_MSG_RESULT(yes) AC_MSG_CHECKING(for libelan version) if test -e ${ELAN_HEADERBASE}/elan/version.h; then verstr=`grep QSNETLIBS_VERSION_STRING ${ELAN_HEADERBASE}/elan/version.h` [majorver=`echo $verstr | $AWK -F'[ \t]*|\"|[.]' '{ print $4 }'`] [minorver=`echo $verstr | $AWK -F'[ \t]*|\"|[.]' '{ print $5 }'`] [subver=`echo $verstr | $AWK -F'[ \t]*|\"|[.]' '{ print $6 }'`] else verstr=`grep 'ELAN_VERSION' ${ELAN_HEADERBASE}/elan/misc.h` [majorver=`echo $verstr | $AWK -F'[ \t]*|\"|[.]' '{ print $5 }'`] [minorver=`echo $verstr | $AWK -F'[ \t]*|\"|[.]' '{ print $6 }'`] subver=0 fi AC_MSG_RESULT("${majorver}.${minorver}.${subver}") if test "$majorver" = "" -o "$minorver" = "" -o "$subver" = "" ; then AC_MSG_ERROR(["libelan present, but unable to determine libelan version"]) fi AC_DEFINE_UNQUOTED(ELAN_VERSION_MAJOR, $majorver) AC_DEFINE_UNQUOTED(ELAN_VERSION_MINOR, $minorver) AC_DEFINE_UNQUOTED(ELAN_VERSION_SUB, $subver) else AC_MSG_RESULT(no) have_elan=no fi fi if test "$force_elan$have_elan" = yesno; then AC_MSG_ERROR([User requested --enable-elan but I don't know how to build elan programs for your system.]) fi fi AC_SUBST(ELAN_INCLUDE) AC_SUBST(ELAN_LIBS) AM_CONDITIONAL(USE_ELAN_CONDUIT, test "$enabled_elan$have_elan" = yesyes) if test "$enabled_elan$have_elan" = yesyes ; then CONDUITS="$CONDUITS elan" CONDUIT_REPORT(ON) else CONDUIT_REPORT(OFF) fi popdef([CONDUIT_DESC]) #-------------------------------------------------------------------------------------------------------- # VAPI configuration pushdef([CONDUIT_DESC],[Mellanox InfiniBand/VAPI network conduit (vapi)]) GASNET_IF_ENABLED_WITH_AUTO(vapi, Enable/disable the CONDUIT_DESC (auto-detected), [enabled_vapi=yes;force_vapi=yes], enabled_vapi=no, enabled_vapi=yes) if test "$force_vapi$have_pthread" = yesno; then AC_MSG_ERROR([vapi-conduit requires pthread support but pthreads $pthread_reason]) fi if test "$enabled_vapi$have_pthread" = yesno; then enabled_vapi=no AC_MSG_WARN([vapi-conduit requires pthread support but pthreads $pthread_reason - disabling vapi]) fi if test "$enabled_vapi" = yes; then # Start by assuming we do have VAPI have_vapi=yes # Start with some sensable defaults GASNET_ENV_DEFAULT(MTHOME, /usr/mellanox) GASNET_ENV_DEFAULT(VAPI_INCLUDE, $MTHOME/include) GASNET_ENV_DEFAULT(VAPI_LIBS, -lvapi -lmtl_common -lmosal -lmpga) # Note 'test -d $foo/.' works even if $foo is a symlink if test x"$ac_cv_sizeof_void_p" = x8 -a -d $MTHOME/lib64/.; then vapi_libdir_default=$MTHOME/lib64 else vapi_libdir_default=$MTHOME/lib fi GASNET_ENV_DEFAULT(VAPI_LIBDIR, $vapi_libdir_default) # Assemble any extra flags needed at library build time VAPI_LIBCFLAGS='' AC_MSG_CHECKING(if $CC supports GNU variadic preprocessor macros) if test "$gasnet_cv_cc_family" = "GNU"; then AC_MSG_RESULT([yes (gcc)]) else AC_TRY_COMPILE([ extern void bar1(int a); extern void bar3(int a, int b, int c); #define foo1(A, B...) bar1(A, ## B) /* expect the comma to disappear */ #define foo3(A, B...) bar3(A, ## B) /* expect the comma to remain */ ],[ foo1(1); foo3(1, 2, 3); ],AC_MSG_RESULT(yes),[ # Work aroung bug #522 by omitting mtl_log.h AC_MSG_RESULT(no) VAPI_LIBCFLAGS="$VAPI_LIBCFLAGS -DH_MTL_LOG_H" ]) fi # Since we are using firehose we need to disable certain optimizations. # See bug #350 for an example of why firehose needs this. # See bug #596 or #1031 for evidence that VAPI is affected by this. # See bug #1052 for evidence that xlc is affected. case "$gasnet_cv_cc_family" in GNU) VAPI_NO_ALIAS="-fno-strict-aliasing";; Pathscale) VAPI_NO_ALIAS="-fno-strict-aliasing";; XLC) VAPI_NO_ALIAS="-qnoansialias -qalias=addr";; *) VAPI_NO_ALIAS="";; esac # Try to compile and link a basic VAPI program AC_MSG_CHECKING(for working VAPI configuration) GASNET_PUSHVAR(CFLAGS,"$CFLAGS -I$VAPI_INCLUDE $GASNET_THREAD_DEFINES $VAPI_LIBCFLAGS") GASNET_PUSHVAR(LIBS,"$LIBS -L$VAPI_LIBDIR $VAPI_LIBS $GASNET_THREAD_LIBS") # try to compile and link a simple VAPI program AC_TRY_LINK( [ #include ], [{ int rc; u_int32_t num_of_hcas; VAPI_hca_id_t inst_hca_id; rc = EVAPI_list_hcas(1, &num_of_hcas, &inst_hca_id); }], [ vapi_test_worked=yes ], [ vapi_test_worked=no GASNET_ERR_SAVE() ] ) GASNET_POPVAR(CFLAGS) GASNET_POPVAR(LIBS) if test "$vapi_test_worked" = yes; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) have_vapi=no fi # Check for conflict if test "$force_vapi$have_vapi" = yesno; then GASNET_MSG_ERROR([User requested --enable-vapi but I don't know how to build VAPI programs for your system.]) fi if test "$have_vapi" = yes; then AC_MSG_CHECKING(for VAPI FMR support) GASNET_PUSHVAR(CFLAGS,"$CFLAGS -I$VAPI_INCLUDE $GASNET_THREAD_DEFINES $VAPI_LIBCFLAGS") GASNET_PUSHVAR(LIBS,"$LIBS -L$VAPI_LIBDIR $VAPI_LIBS $GASNET_THREAD_LIBS") AC_TRY_LINK( [ #include #include ], [{ VAPI_hca_hndl_t my_hca; EVAPI_fmr_hndl_t handles[1]; EVAPI_unmap_fmr(my_hca, 1, handles); }], [ AC_DEFINE(HAVE_VAPI_FMR) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ] ) GASNET_POPVAR(CFLAGS) GASNET_POPVAR(LIBS) # Collect some VAPI-specifc configure options GASNET_IF_ENABLED_WITH_AUTO(vapi-force-poll-lock, [See vapi-conduit/README (disabled by default)], enabled_vapi_force_poll_lock=yes, enabled_vapi_force_poll_lock=no, enabled_vapi_force_poll_lock=no) if test "$enabled_vapi_force_poll_lock" = yes; then AC_DEFINE(GASNETC_VAPI_FORCE_POLL_LOCK) fi GASNET_IF_ENABLED_WITH_AUTO(vapi-rcv-thread, [See vapi-conduit/README (enabled by default)], enabled_vapi_rcv_thread=yes, enabled_vapi_rcv_thread=no, enabled_vapi_rcv_thread=yes) if test "$enabled_vapi_rcv_thread" = yes; then AC_DEFINE(GASNETC_VAPI_RCV_THREAD) fi GASNET_WITH(vapi-spawner, [VAPI job spawner ("ssh" or "mpi", default is mpi when available)], [case "$withval" in ssh|mpi) GASNET_VAPI_SPAWNER=$withval ;; yes) AC_MSG_ERROR([--with-vapi-spawner requires an argument ("ssh" or "mpi")]) ;; *) AC_MSG_ERROR([--with-vapi-spawner argument must be "ssh" or "mpi"]) ;; esac], [AC_MSG_ERROR([--with-vapi-spawner argument must be "ssh" or "mpi"])], [if test "$have_mpi" = yes; then GASNET_VAPI_SPAWNER=mpi else GASNET_VAPI_SPAWNER=ssh fi]) AC_SUBST(GASNET_VAPI_SPAWNER) if test "$GASNET_VAPI_SPAWNER$have_mpi" = mpino; then AC_MSG_ERROR([--with-vapi-spawner=mpi requires MPI support and MPI $mpi_reason]); fi fi fi AC_SUBST(VAPI_INCLUDE) AC_SUBST(VAPI_LIBDIR) AC_SUBST(VAPI_LIBS) AC_SUBST(VAPI_LIBCFLAGS) AC_SUBST(VAPI_NO_ALIAS) AM_CONDITIONAL(USE_VAPI_CONDUIT, test "$have_vapi" = yes) AM_CONDITIONAL(VAPI_BOOTSTRAP_MPI, test "$have_mpi" = yes) # Option to omit MPI support? AM_CONDITIONAL(VAPI_RCV_THREAD,test "$enabled_vapi_rcv_thread" = yes) if test "$have_vapi" = yes ; then CONDUITS="$CONDUITS vapi" CONDUIT_REPORT(ON) else CONDUIT_REPORT(OFF) fi popdef([CONDUIT_DESC]) #-------------------------------------------------------------------------------------------------------- # SHMEM configuration pushdef([CONDUIT_DESC],[Shmem network conduit (shmem)]) GASNET_IF_ENABLED_WITH_AUTO(shmem, Enable the CONDUIT_DESC (auto-detected), [enabled_shmem=yes;force_shmem=yes], enabled_shmem=no, enabled_shmem=yes) if test $enabled_shmem = yes; then SHMEM_FLAVOUR="unknown" have_shmem=yes AC_MSG_CHECKING(for SHMEM network type) case "$target_os" in unicos*) AC_MSG_RESULT(Cray) GASNET_ENV_DEFAULT(SHMEM_INCLUDE, /opt/ctl/mpt/mpt/include) GASNET_ENV_DEFAULT(SHMEM_LIBDIR, /opt/ctl/mpt/mpt/lib) GASNET_ENV_DEFAULT(SHMEM_LIBS, "-lsma") SHMEM_FLAVOUR="CRAY_SHMEM" ;; irix*) AC_MSG_WARN(Currently no access to shmem on IRIX) have_shmem=no ;; # Linux shmem may mean Quadrics shmem, or SGI shmem. A first try is to # look for _ELAN_SHMEM_H in /usr/include/shmem.h. linux*) # This first case should catch Elan shmem if test -e ${SHMEM_INCLUDE}/shmem.h; then is_quadrics=`grep ELAN_SHMEM ${SHMEM_INCLUDE}/shmem.h` if test -n "$is_quadrics"; then SHMEM_FLAVOUR="ELAN_SHMEM" AC_MSG_RESULT(Quadrics/Elan) GASNET_ENV_DEFAULT(SHMEM_INCLUDE, /usr/include) GASNET_ENV_DEFAULT(SHMEM_LIBDIR, /usr/lib) GASNET_ENV_DEFAULT(SHMEM_LIBS, "-lshmem") fi elif test -e /dev/xpmem; then # SGI Altix uhas xpmem device SHMEM_FLAVOUR="SGI_SHMEM" AC_MSG_RESULT(SGI/Altix) GASNET_ENV_DEFAULT(SHMEM_INCLUDE, /usr/include) # Work around stoopid bug in Intel ecc on Altix: programs won't compile # if -L/usr/lib is explicitly passed. GASNET_ENV_DEFAULT(SHMEM_LIBDIR, /anything/but/usr/lib) GASNET_ENV_DEFAULT(SHMEM_LIBS, [-lsma -lmpi]) else AC_MSG_RESULT(unknown) have_shmem=no fi ;; *) AC_MSG_RESULT(unknown) have_shmem=no ;; esac if test $have_shmem = yes; then GASNET_PUSHVAR(CFLAGS,"$CFLAGS -I${SHMEM_INCLUDE} -I${SHMEM_INCLUDE}/mpp") GASNET_PUSHVAR(LIBS,"$LIBS -L${SHMEM_LIBDIR} ${SHMEM_LIBS}") SHMEM_FLAGS="-D${SHMEM_FLAVOUR}" AC_MSG_CHECKING(for working SHMEM configuration) # only include shmem.h even if some prescribe and rely on the # include search directories to be correct. This approach is more general AC_TRY_LINK( [ #include ], [{ int mype, numpes; mype = shmem_my_pe(); numpes = shmem_n_pes(); }], [ shmem_test_worked=yes ], [ shmem_test_worked=no GASNET_ERR_SAVE() ] ) GASNET_POPVAR(CFLAGS) GASNET_POPVAR(LIBS) if test "$shmem_test_worked" = yes; then AC_MSG_RESULT(yes) SHMEM_FLAGS="-D${SHMEM_FLAVOUR} " else AC_MSG_RESULT(no) AC_MSG_WARN(build test failed: I don't know how to build SHMEM programs on your system) have_shmem=no fi fi if test "$force_shmem$have_shmem" = yesno; then GASNET_MSG_ERROR(User requested --enable-shmem but I don't know how to build shmem programs for your system) fi fi AC_SUBST(SHMEM_INCLUDE) AC_SUBST(SHMEM_LIBDIR) AC_SUBST(SHMEM_LIBS) AC_SUBST(SHMEM_FLAGS) AM_CONDITIONAL(USE_SHMEM_CONDUIT, test "$enabled_shmem$have_shmem" = yesyes) if test "$enabled_shmem$have_shmem" = yesyes ; then CONDUITS="$CONDUITS shmem" CONDUIT_REPORT(ON) else CONDUIT_REPORT(OFF) fi popdef([CONDUIT_DESC]) #-------------------------------------------------------------------------------------------------------- # SCI configuration pushdef([CONDUIT_DESC],[Dolphin SISCI network conduit (sci)]) GASNET_IF_ENABLED_WITH_AUTO(sci, Enable the CONDUIT_DESC (auto-detected), [enabled_sci=yes;force_sci=yes], enabled_sci=no, enabled_sci=yes) if test "$enabled_sci" = yes; then # Look for sci binaries in our path AC_PATH_PROGS(scibench2, scibench2) case "$scibench2" in '') sci_guess=/opt/DIS ;; *) sci_guess=`dirname $scibench2` sci_guess=`dirname $sci_guess` ;; esac GASNET_ENV_DEFAULT(SCIHOME, $sci_guess) GASNET_ENV_DEFAULT(SCI_INCLUDES, [-I$SCIHOME/include -I$SCIHOME/lib/api]) GASNET_ENV_DEFAULT(SCI_LIBS, [-L$SCIHOME/lib -lsisci]) AC_MSG_CHECKING(for working SCI configuration) GASNET_PUSHVAR(CFLAGS,"$CFLAGS $SCI_INCLUDES") GASNET_PUSHVAR(LIBS,"$LIBS $SCI_LIBS") # try to compile and link a simple SCI program AC_TRY_LINK( [ #include #include #include ], [{ sci_desc_t sd; sci_error_t err; SCIOpen(&sd, 0, &err); }], [ have_sci=yes ], [ have_sci=no GASNET_ERR_SAVE() ] ) GASNET_POPVAR(CFLAGS) GASNET_POPVAR(LIBS) AC_MSG_RESULT($have_sci) # Check for conflict if test "$force_sci$have_sci" = yesno; then GASNET_MSG_ERROR([User requested --enable-sci but I don't know how to build SCI programs for your system.]) fi fi AC_SUBST(SCI_INCLUDES) AC_SUBST(SCI_LIBS) AM_CONDITIONAL(USE_SCI_CONDUIT, test "$have_sci" = yes) if test "$have_sci" = yes ; then CONDUITS="$CONDUITS sci" CONDUIT_REPORT(ON) else CONDUIT_REPORT(OFF) fi popdef([CONDUIT_DESC]) ######################################################################## # Configure conduit-independent spawners # Things needed by ssh spawner AC_CHECK_HEADERS(netinet/tcp.h) case "$target_os" in linux*) GASNET_IF_ENABLED(ssh-prctl, Enable use of prctl() in the ssh-based spawner (see other/ssh-spawner/README) (disabled by default), [ AC_MSG_CHECKING(for PR_SET_PDEATHSIG) AC_TRY_LINK([ #include ],[ int rc = prctl(PR_SET_PDEATHSIG, 0); ], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PR_SET_PDEATHSIG) ], AC_MSG_RESULT(no)) ]) ;; esac ######################################################################## # Check for broken asm/atomic.h on Linux case "$target_os" in linux*) AC_MSG_CHECKING(for broken asm/atomic.h) AC_TRY_LINK( [ #include #include #include ], [ atomic_t v; atomic_set(&v,5); atomic_inc(&v); #ifdef cmpxchg /* cmpxchg may fail to link when optimizations are disabled */ do { volatile int x = 1; cmpxchg(&x, 1, 2); } while (0); #endif ], AC_MSG_RESULT(ok), [ AC_MSG_RESULT(broken) AC_DEFINE(BROKEN_LINUX_ASM_ATOMIC_H) ] ) if test "$have_cxx" = 1; then # Do the same check for CXX as well AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING(for broken asm/atomic.h with c++) AC_TRY_LINK( [ #include #include #include ], [ atomic_t v; atomic_set(&v,5); atomic_inc(&v); #ifdef cmpxchg /* cmpxchg may fail to link when optimizations are disabled */ do { volatile int x = 1; cmpxchg(&x, 1, 2); } while (0); #endif ], AC_MSG_RESULT(ok), [ AC_MSG_RESULT(broken) AC_DEFINE(BROKEN_LINUX_ASM_ATOMIC_H) ] ) AC_LANG_RESTORE fi ;; esac # Check for alloca in C code GASNET_FUNC_ALLOCA AC_CHECK_FUNCS(setenv unsetenv putenv) ######################################################################## # Try to discover the C compiler's inline modifier inlinemod="" case "$gasnet_cv_cc_family" in Compaq) # force __inline on Compaq C, because it's the most effective AC_DEFINE(CC_INLINE_MODIFIER, __inline) inlinemod=__inline ;; XLC) # force __inline on XLC, to avoid warnings AC_DEFINE(CC_INLINE_MODIFIER, __inline) inlinemod=__inline ;; HP) # __inline crashes HP C when optimizations are disabled if test "$BUILDCONFIG" = "debug" ; then AC_DEFINE(CC_INLINE_MODIFIER, [ ]) inlinemod=" " fi ;; esac if test "$inlinemod" = ""; then GASNET_TRY_CACHE_CHECK(for inline modifier, cc_modinline, [inline int dummy() { return 1; }], [], AC_DEFINE(CC_INLINE_MODIFIER, inline) inlinemod=inline) fi if test "$inlinemod" = ""; then GASNET_TRY_CACHE_CHECK(for __inline__ modifier, cc_mod__inline__, [__inline__ int dummy() { return 1; }], [], AC_DEFINE(CC_INLINE_MODIFIER, __inline__) inlinemod=__inline__) fi if test "$inlinemod" = ""; then GASNET_TRY_CACHE_CHECK(for __inline modifier, cc_mod__inline, [__inline int dummy() { return 1; }], [], AC_DEFINE(CC_INLINE_MODIFIER, __inline) inlinemod=__inline) fi if test "$inlinemod" = ""; then GASNET_TRY_CACHE_CHECK(for _inline modifier, cc_mod_inline, [_inline int dummy() { return 1; }], [], AC_DEFINE(CC_INLINE_MODIFIER, _inline) inlinemod=_inline) fi if test "$inlinemod" = ""; then GASNET_TRY_CACHE_CHECK(for _Inline modifier, cc_mod_Inline, [_Inline int dummy() { return 1; }], [], AC_DEFINE(CC_INLINE_MODIFIER, _Inline) inlinemod=_Inline) fi if test "$inlinemod" != ""; then AC_MSG_CHECKING(whether static $inlinemod works) AC_TRY_COMPILE([static $inlinemod int dummy() { return 1; }], [], [AC_DEFINE(STATIC_INLINE_WORKS) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) fi # Runtime Var Arrays #GASNET_IF_ENABLED_WITH_AUTO(vararray, Use stack arrays of variable size in code, #AC_DEFINE(VARARRAY_WORKS), #, #GASNET_TRY_CACHE_CHECK(for variable stack arrays, cc_vararray_mod, # [void dummy(int x) { char y[x]; }], [], # AC_DEFINE(VARARRAY_WORKS))) ######################################################################## # different high-precision sleep libraries # Check for usleep GASNET_TRY_CACHE_CHECK(for usleep(), cc_has_usleep, [ #include ], [ usleep(500); ], AC_SEARCH_LIBS(usleep, posix4, AC_DEFINE(HAVE_USLEEP), AC_MSG_RESULT(entry point not found - disabled))) # Check for nanosleep GASNET_TRY_CACHE_CHECK(for nanosleep(), cc_has_nanosleep, [ #include #include ], [ struct timespec tm, tmremaining; tm.tv_sec =1; tm.tv_nsec = 1000000; nanosleep(&tm, &tmremaining); ], AC_SEARCH_LIBS(nanosleep, posix4, AC_DEFINE(HAVE_NANOSLEEP), AC_MSG_RESULT(entry point not found - disabled))) # Check for nsleep GASNET_TRY_CACHE_CHECK(for nsleep(), cc_has_nsleep, [ #include #include ], [ struct timespec tm, tmremaining; tm.tv_sec =1; tm.tv_nsec = 1000000; nsleep(&tm, &tmremaining); ], AC_SEARCH_LIBS(nsleep, posix4, AC_DEFINE(HAVE_NSLEEP), AC_MSG_RESULT(entry point not found - disabled))) # Check for sched_yield GASNET_TRY_CACHE_CHECK(for sched_yield(), cc_has_sched_yield, [ #include ], [ sched_yield(); ], AC_SEARCH_LIBS(sched_yield, posix4, AC_DEFINE(HAVE_SCHED_YIELD), AC_MSG_RESULT(entry point not found - disabled))) # AC_FUNC_MMAP # Check for mmap functionality we actually use case "$target_os" in cygwin*) # mmap is known to be broken on Cygwin - dont even try HAVE_MMAP=0 ;; *) if test "$cross_compiling" = "yes" ; then GASNET_CROSS_VAR(HAVE_MMAP,HAVE_MMAP) else GASNET_TRY_CACHE_RUN(for working mmap(), have_mmap, [ #include #include #include #include #include #include char junk[[16384]]; int testfd(int); int main() { int fd, retval; #if 0 char filename[[255]]; tmpnam(filename); /* unsafe */ fd = open(filename, O_RDWR | O_CREAT); #else char filename[[255]]; strcpy(filename,"/tmp/gasnet-conftemp-XXXXXX"); fd = mkstemp(filename); /* leaves crap laying around */ #endif retval = testfd(fd); close(fd); remove(filename); return retval; } int testfd(int fd) { void *ptr,*ptr2; if (fd == -1) return 1; if (write(fd, junk, 16384) == -1) return 2; ptr = mmap(0, 16384, (PROT_READ|PROT_WRITE), MAP_PRIVATE, fd, 0); if (ptr == MAP_FAILED || ptr == NULL) return 3; if (munmap(ptr,16384) != 0) return 4; ptr2 = mmap(ptr, 16384, (PROT_READ|PROT_WRITE), (MAP_PRIVATE | MAP_FIXED), fd, 0); if (ptr2 == MAP_FAILED || ptr2 == NULL || ptr2 != ptr) return 5; if (munmap(ptr,16384) != 0) return 6; return 0; }],[ HAVE_MMAP=1 ],[ HAVE_MMAP=0 ]) fi ;; esac if test "$HAVE_MMAP" != "0" ; then AC_DEFINE(HAVE_MMAP) fi case "$target" in *-catamount-*) ;; # don't use mallopt on catamount, even if it appears to be available *) dnl Check for ptmalloc's mallopt() to work aroung bugs 495 and 955 AC_CHECK_HEADERS([malloc.h]) GASNET_TRY_CACHE_LINK(for ptmalloc, malloc_is_ptmalloc, [ #if HAVE_STDLIB_H #include #endif #if HAVE_MALLOC_H #include #endif ],[ mallopt(M_TRIM_THRESHOLD, -1); mallopt(M_MMAP_MAX, 0); ],[ AC_DEFINE(HAVE_PTMALLOC) ]) esac case "$target" in *-blrts-*) debugmalloc_support=no ;; # debug malloc vars crash BG/L RTS *) debugmalloc_support=yes ;; # it's a glibc feature, but appears harmless elsewhere esac AM_CONDITIONAL(DEBUGMALLOC,test "$debugmalloc_support" = "yes") AC_SUBST(LIBS) ######################################################################## # Special GCC feature support # Check for __builtin_expect (GCC 3.0) GASNET_TRY_CACHE_LINK(for __builtin_expect, cc_has_builtin_expect, [int x;], [if (__builtin_expect(x,1)) return 1;], AC_DEFINE(HAVE_BUILTIN_EXPECT)) GASNET_TRY_CACHE_LINK(for __builtin_prefetch, cc_has_builtin_prefetch, [int x;], [__builtin_prefetch(&x,0);], AC_DEFINE(HAVE_BUILTIN_PREFETCH)) GASNET_TRY_CACHE_LINK(for __func__, cc_has_func, [], [const char* p = __func__;], AC_DEFINE(HAVE_FUNC)) ######################################################################## ## Misc Header checks AC_CHECK_HEADERS(sys/param.h) ######################################################################## ## ## Supporting Command-Line Tools (continued) ## dnl Use the results of AC_CHECK_SIZEOF(void *) to select 64-bit mode for some tools dnl NOTE: AC_CHECK_SIZEOF may only be safely called after AC_PROG_CC/AC_PROG_CPP case "$target_os" in aix*) # If on AIX, and in 64 bit mode, we need to use 'ranlib -X64' and 'ar -X64' if test x"$ac_cv_sizeof_void_p" = x8; then AR="ar -X64" RANLIB="ranlib -X64" fi ;; osf*) # Tru64 has a default /bin/sh that emits error msgs for missing # commands, even when 2>/dev/null passed. Use posix shell instead. if test -x /usr/bin/posix/sh; then BOURNE_SHELL="/usr/bin/posix/sh" fi ;; esac dnl Store full paths, so we find right ones even if users have dnl some other version in their path if test x"$BOURNE_SHELL" = x; then BOURNE_SHELL="/bin/sh" fi GASNET_PATH_PROGS(AR, $AR ar gar, archiver) #AC_PROG_RANLIB GASNET_PATH_PROGS(RANLIB, $RANLIB ranlib touch, ranlib) case "$target_os" in darwin*) RANLIB="$RANLIB -s -c" ;; # ensure correct common block behavior on darwin esac GASNET_PATH_PROGS(BASENAME, $BASENAME basename, basename) GASNET_PATH_PROGS(DIRNAME, $DIRNAME dirname, dirname) # Some platforms are lacking readlink, and we currently do not require it AC_PATH_PROGS(READLINK, $READLINK readlink) # other optional commands AC_PATH_PROGS(TIMECMD, $TIMECMD time, , /usr/bin:${PATH}) AC_PATH_PROGS(ENVCMD, $ENVCMD env, , /usr/bin/:${PATH}) AC_SUBST(BOURNE_SHELL) AC_SUBST(AR) AC_SUBST(NM) AC_SUBST(RANLIB) AC_SUBST(BASENAME) AC_SUBST(DIRNAME) AC_SUBST(READLINK) AC_SUBST(TIMECMD) AC_SUBST(ENVCMD) ######################################################################## # complete linker setup case "$target_os" in aix*) # AIX linker doesn't allow large enough TOC by default to accomodate # most large applications # LDFLAGS="$LDFLAGS -Wl,-bbigtoc" # set the data segment size to the largest permitted size for 32-bit apps (2GB) # MLW: No. (1) this has no effect when building libraries, only executables # and should be under control of end user. # (2) If this was used for a executable in a 32 bit app there would # only be one segment left for mmap and shared memory segments # and GASNET allocs shared mem region using mmap. # LDFLAGS="$LDFLAGS -Wl,-bmaxdata:0x80000000" ;; darwin*) # Darwin linker complains about symbols defined in multiple dynamic libs. # This is a minor annoyance in some cases, however it becomes a fatal error # when linking with the mpich libs. LDFLAGS="$LDFLAGS -Wl,-multiply_defined,suppress" ;; esac AC_SUBST(LDFLAGS) # Figure out how to install config files GASNET_SET_INSTALL_CMD TOOL_PREFIX=gasnet GASNET_WITH(tool-prefix, [Naming prefix to use for contributed tools], TOOL_PREFIX=$withval) AC_SUBST(TOOL_PREFIX) ######################################################################## ## ## Final Output ## GASNET_FIX_EXEC(gm-conduit/contrib/gasnetrun_gm) GASNET_FIX_EXEC(mpi-conduit/contrib/gasnetrun_mpi) GASNET_FIX_EXEC(sci-conduit/contrib/gasnetrun_sci) GASNET_FIX_EXEC(vapi-conduit/contrib/gasnetrun_vapi) GASNET_FIX_EXEC(other/contrib/gasnet_trace) # Files added here should also be added to ./unBootstrap GASNET_END_CONFIGURE() AC_OUTPUT( Makefile other/perlstart dnl must precede files that use it mpi-conduit/Makefile mpi-conduit/conduit.mak mpi-conduit/contrib/Makefile mpi-conduit/contrib/gasnetrun_mpi udp-conduit/Makefile udp-conduit/conduit.mak gm-conduit/Makefile gm-conduit/conduit.mak gm-conduit/contrib/Makefile gm-conduit/contrib/gasnetrun_gm lapi-conduit/Makefile lapi-conduit/conduit.mak sci-conduit/Makefile sci-conduit/conduit.mak sci-conduit/contrib/Makefile sci-conduit/contrib/gasnetrun_sci smp-conduit/Makefile smp-conduit/conduit.mak elan-conduit/Makefile elan-conduit/conduit.mak vapi-conduit/Makefile vapi-conduit/conduit.mak vapi-conduit/contrib/Makefile vapi-conduit/contrib/gasnetrun_vapi shmem-conduit/Makefile shmem-conduit/conduit.mak other/Makefile other/Makefile-conduit.mak other/fragment-head.mak other/fragment-body.mak other/ammpi/Makefile other/amudp/Makefile other/contrib/Makefile other/contrib/gasnet_trace other/testspawn/Makefile tests/Makefile config-aux/Makefile , GASNET_FIX_EXEC_OUTPUT() [ CONDUIT_LIST=.gasnet-conduit-list.tmp if test -f "$CONDUIT_LIST" ; then echo "----------------------------------------------------------------------" echo "GASNet conduit configuration: $CONDUITS" cat $CONDUIT_LIST echo " " echo " Some conduits require --enable-XXX configure flags and/or additional" echo " variables providing the install location of vendor drivers." echo " See the GASNet documentation for details." echo "----------------------------------------------------------------------" rm -f $CONDUIT_LIST fi ] , GASNET_FIX_EXEC_SETUP() )