📄 configure.in
字号:
dnl Caching is usually WRONG for systems with cross-mounted file systemsdnl (the cache file may correspond to a different system). Since configurednl is not on a performance-critical path, go for robustness over speed.dnldefine([AC_CACHE_LOAD], )dnldefine([AC_CACHE_SAVE], )dnldnldnlAC_INIT()AC_PREREQ(2.52)AC_CONFIG_HEADER(mpe_wrappers_conf.h)dnlecho "Configuring MPE Wrapper Libraries For MPI with $ac_configure_args"dnldnl Set top_srcdir_abs to be the ABSOLUTE path to the home directory of MPEdnl top_srcdir is in relative path.if test "X$srcdir" != "X." -a -s $srcdir/src/log_mpi_core.c ; then top_srcdir_abs=$srcdirelse PAC_GETWD( top_srcdir_abs, src/log_mpi_core.c )fiAC_SUBST(top_srcdir_abs)AC_ARG_ENABLE( echo,[--enable-echo - Turn on strong echoing. The default is enable=no.],set -x )AC_ARG_ENABLE( softerror,[--enable-softerror - Turn on soft error, i.e. instead of issuing MSG_ERROR, MSG_WARN + exit 0 are used. The default is enable=no.],, enable_softerror=${mpe_enable_softerror:-no} )MAKE=${MAKE:-make}MPI_IMPL=${MPI_IMPL:-UserSupplied}MPE_BUILD_FORTRAN2C=${MPE_BUILD_FORTRAN2C:-no}CC=${CC:-cc}CLINKER=${CLINKER:-$CC}CFLAGS=${MPE_CFLAGS}MPI_CC=${MPI_CC:-${CC}}MPE_CLINKER=${MPE_CLINKER}F77=${F77:-f77}FLINKER=${FLINKER:-$F77}FFLAGS=${MPE_FFLAGS}MPI_F77=${MPI_F77:-${F77}}MPE_FLINKER=${MPE_FLINKER}FINC_PATH_LEADER=${FINC_PATH_LEADER:-"-I"}FLIB_PATH_LEADER=${FLIB_PATH_LEADER:-"-L"}MPI_CFLAGS=${MPI_CFLAGS}MPI_FFLAGS=${MPI_FFLAGS}MPI_LIBS=${MPI_LIBS}MPE_LIBNAME=${MPE_LIBNAME:-mpe}PROF_LIBNAME="$MPE_LIBNAME"LOG_LIBNAME="l$MPE_LIBNAME"TRACE_LIBNAME="t$MPE_LIBNAME"F2CMPI_LIBNAME="${MPE_LIBNAME}_f2cmpi"PROF_LIBS="-l$PROF_LIBNAME"LOG_LIBS="-l$LOG_LIBNAME $PROF_LIBS"TRACE_LIBS="-l$TRACE_LIBNAME"F2CMPI_LIBS=""dnl Fixup for makePAC_MAKE_IS_GNUMAKEPAC_MAKE_IS_BSD44PAC_MAKE_IS_OSFPAC_MAKE_VPATHAC_SUBST(MAKE) dnl If we are relying on vpath and no vpath is set, then we must exitif test ! -s src/log_mpi_core.c -a -z "$VPATH" ; then AC_MSG_ERROR( [No virtual MAKE path command found. You may need to set your make command The GNU make (sometimes available as gnumake) can be used.] )fidnl CPRP is the version of cp that accepts -r and -p arguments.MKDIR=mkdirCPRP=cpRM=rmMV=mvAC_SUBST(MKDIR)AC_SUBST(CPRP)AC_SUBST(RM)AC_SUBST(MV) AC_ARG_WITH( mpiio,[--with-mpiio - Enable/Disable MPI-IO logging in MPICHx build. The default is yes.], ,with_mpiio=yes )AC_ARG_ENABLE( romio,[--enable-romio - Enable/Disable ROMIO MPI-IO logging in MPICHx build. The default is yes.],with_mpiio=$enableval,with_mpiio=yes )AC_ARG_ENABLE( checkMPI,[--enable-checkMPI - Turn on/off the linking test for the MPI include files, MPI libraries and MPI_CC compiler. The default is enable=yes.], ,enable_checkMPI=yes )AC_ARG_WITH( checkMPIO,[--enable-checkMPIO - Turn on/off the linking test for MPI-IO routines in MPI implementation. The default is enable=yes.], ,enable_checkMPIO=yes )dnl Ideally, enable_f2cmpilib should be extracted from thednl CC/MPI_CC/MPI_CFLAGS/MPI_LIBS supplied by the user of MPE.dnl enable_f2cmpilib is used to determine if libmpe_f2cmpi.a( mpe_proff.o )dnl is needed for profiling of fortran MPI programdnl withOUT a PMPICH type of profiling library.AC_ARG_ENABLE( f2cmpilib,[--enable-f2cmpilib - Indicates if this MPE build will make its own Fortran to C MPI wrapper library. The library is needed for profiling Fortran program in Non-MPICH platform. The default is enable=yes.], ,enable_f2cmpilib=yes )AC_ARG_WITH( f2cmpilibs,[--with-f2cmpilibs=F2CMPI_LIBS - compiler's library flags for Fortran to C MPI wrapper library. Using this option disables building of MPE's internal Fortran to C MPI library, --disable-f2cmpilib. The library is needed for profiling MPI Fortran program. e.g. "-lfmpich" when MPE is building with MPICH.],F2CMPI_LIBS="$withval" ; enable_f2cmpilib=no )AC_ARG_ENABLE( safePMPI,[--enable-safePMPI - Turn on/off the safe PMPI invocation, ie. Turn off logging before making PMPI call. Turn on logging after PMPI call. For non-MPICH2 (standalone build), the default is enable=yes for non-MPICH2 build. For MPICH2 build, the default is enable=no.], ,enable_safePMPI=yes )AC_ARG_ENABLE( debugcheck,[--enable-debugcheck - Turn on/off the debugging & diagnostic checking code in MPE code. The default is enable=no.] )AC_ARG_ENABLE( broken-procnull,[--enable-broken-procnull - Handle MPI implementations with buggy handling of MPI_PROC_NULL.],procnull_broken=$enableval, procnull_broken=default )dnl Set the various build directories from their mpe_ prefixed env variables.dnldnl includebuild_dir is for all user header filesdnl libbuild_dir is used to build the libraries in before they are installed.dnl binbuild_dir is for the scripts/programsdnl sbinbuild_dir is for all system admin toolsdnl etcbuild_dir is for all system admin configuration settingsdnlrootbuild_dir=`pwd`for dir in include lib bin sbin etc ; do dirname=${dir}build_dir mpe_dirname=mpe_${dirname} eval dirvalue=\$"$dirname" eval $dirname=\$\{${mpe_dirname}\}donefor dir in include lib bin sbin etc ; do dirname=${dir}build_dir eval dirvalue=\$"$dirname" if test -n "$dirvalue" ; then if test ! -d $dirvalue ; then if mkdir -p $dirvalue ; then : else PAC_MSG_ERROR( $enable_softerror, [Could not create directory $dirvalue] ) fi fi fidoneAC_SUBST(includebuild_dir)AC_SUBST(libbuild_dir)AC_SUBST(binbuild_dir)AC_SUBST(sbinbuild_dir)AC_SUBST(etcbuild_dir)AC_PROG_CCAC_OBJEXTAC_EXEEXTdnl Check for broken handling of common symbolsdnl PAC_PROG_C_BROKEN_COMMONAC_CHECK_PROG(AR, ar, ar, ;)AC_PROG_RANLIBdnl We need to check that this has worked. The autoconf macro is brokenAC_PROG_CPPif test "$CPP" = "/lib/cpp" -a ! -x /lib/cpp ; then AC_MSG_ERROR( [configure could not find a working C preprocessor] )fidnl Invoking AC_CHECK_LIB before AC_PROG_CC makes AC_PROG_CC faildnl in autoconf 2.59DEBUG_LIBS=""if test "$enable_debugcheck" = "yes" ; then AC_CHECK_LIB( efence, malloc, DEBUG_LIBS="-lefence" )fiAC_SUBST(DEBUG_LIBS)AC_HEADER_STDCAC_C_CONSTdnl Checking HeadersAC_CHECK_HEADERS( stdio.h stdlib.h string.h )AC_CHECK_HEADER( stdarg.h, [AC_DEFINE( HAVE_STDARG_H, 1, [Define if stdarg.h is available] ) havestdarg=1], , )AC_FUNC_ALLOCAdnldnl We need to build mpe with the shared library flagsdnl This should rely on the same approach used in the mpich configure,dnl since just using TRY_LINK or TRY_COMPILE doesn't identify warning messagesdnl about "compiler flag unrecognized".dnldnl It isn't enough to check for stdarg. Even gcc doesn't get it right;dnl on some systems, the gcc version of stdio.h loads stdarg.h WITH THE WRONGdnl OPTIONS (causing it to choose the OLD STYLE va_start etc).dnl if test -n "$havestdarg" ; then PAC_COMPILE_CHECK_FUNC(stdarg is correct,[#include <stdio.h>#include <stdarg.h>int func( int a, ... ){int b;va_list ap;va_start( ap, a );b = va_arg(ap, int);printf( "%d-%d\n", a, b );va_end(ap);fflush(stdout);return 0;}int main() { func( 1, 2 ); return 0;}],AC_DEFINE( USE_STDARG, 1, [Define is stdarg can be used] ))fidnlAC_MSG_CHECKING( [if compiler accepts prototypes] )AC_TRY_COMPILE(, int f(double a);, have_proto=yes, have_proto=no)if test "$have_proto" = "yes" ; then AC_DEFINE( HAVE_PROTOTYPES, 1, [Define if the compiler supports simple prototyptes] ) AC_MSG_RESULT([yes])else AC_MSG_RESULT([no])fiif test -z "$nonopt" ; then nonopt=NONE ; fiAC_CANONICAL_HOSTcase "$host" in *irix*)dnl FIXME: the test has a problem when LAM on irix is configured! if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then if test "$procnull_broken" = "default" ; then procnull_broken=yes fi fi ;; *cray*) if test "$MPE_BUILD_FORTRAN2C" = "yes" ; then AC_MSG_CHECKING( [for Cray's FCD logical type] ) AC_LINK_IFELSE( [ AC_LANG_PROGRAM( [#include <fortran.h>], [ int clogical, flogical; clogical = 1; flogical = _btol( clogical ); clogical = _ltob( &flogical ); ] ) ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) if test "$mpe_link_ok" = "yes" ; then AC_MSG_RESULT(yes) AC_DEFINE( HAVE_CRAY_FCD_LOGICAL, 1, [Define if CRAY's FCD logical is found] ) else AC_MSG_RESULT(no) fi fi ;;esacif test "$procnull_broken" = "yes" ; then AC_DEFINE( HAVE_MPI_STATUS_BROKEN_ON_PROC_NULL, 1, [Define if MPI_PROCNULL not handled in MPI_Status] )fiif test "$MPE_BUILD_FORTRAN2C" = "yes" ; then if test "$enable_f2cmpilib" = "yes" ; then F2CMPI_LIBS="-l$F2CMPI_LIBNAME" fidnl when --enable-f77 and --disable-f2cmpilib are selected,dnl value supplied in --with-f2cmpilibs will be used.elsednl If F2CMPI_LIBS="-lfmpich", disable building of libmpe_f2cmpi.adnl by setting F2CMPI_LIBS="". Leave MPE_BUILD_FORTRAN2C=yes, sodnl fortran link/run tests can be performed. F2CMPI_LIBS=""fidnl Check Safe PMPI invocationsAC_MSG_CHECKING( [for safe PMPI invocations] )if test "$MPI_IMPL" = "MPICH" -o "$MPI_IMPL" = "MPICH2" ; then enable_safePMPI=nofiif test "$enable_safePMPI" = "yes" ; then AC_MSG_RESULT(yes) AC_DEFINE( MAKE_SAFE_PMPI_CALL, 1, [Define if safe PMPI calls are made] )else AC_MSG_RESULT(no)fidnl Check if Thread-support level in MPI implementationif test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then if test "$enable_checkMPI" = "yes" ; then AC_MSG_CHECKING( [for the C version of MPI_Init_thread] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ int itmp; int thread_level ], [ itmp=MPI_Init_thread( NULL, NULL, MPI_THREAD_MULTIPLE, &thread_level ) ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) if test "$mpe_link_ok" = "yes" ; then AC_MSG_RESULT(yes) AC_MSG_CHECKING( [for the C version of PMPI_Init_thread] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ int itmp; int thread_level], [ itmp=PMPI_Init_thread( NULL, NULL, MPI_THREAD_MULTIPLE, &thread_level ) ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) if test "$mpe_link_ok" = "yes" ; then AC_MSG_RESULT(yes) AC_DEFINE(HAVE_MPI_INIT_THREAD, 1, [Define if MPI_Init_thread available])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -