📄 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 Library 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}}F77=${F77:-f77}FLINKER=${FLINKER:-$F77}FFLAGS=${MPE_FFLAGS}MPI_F77=${MPI_F77:-${F77}}FINC_PATH_LEADER=${FINC_PATH_LEADER:-"-I"}FLIB_PATH_LEADER=${FLIB_PATH_LEADER:-"-L"}MPI_INC=${MPI_INC}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 - Include/exclude MPI-IO from mpe logging. The default is yes.], ,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_INC/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 )if test -z "$nonopt" ; then nonopt=NONE ; fiAC_CANONICAL_HOSTAC_ARG_ENABLE( broken-procnull,[--enable-broken-procnull - Handle MPI implementations with buggy handling of MPI_PROC_NULL.],procnull_broken=$enableval, procnull_broken=default )if test "$host" = "irix" ; thendnl 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 fifiif test "$procnull_broken" = "yes" ; then AC_DEFINE( HAVE_MPI_STATUS_BROKEN_ON_PROC_NULL, 1, [Define if MPI_PROCNULL not handled in MPI_Status] )fiAC_ARG_ENABLE( debugcheck,[--enable-debugcheck - Turn on/off the debugging & diagnostic checking code in MPE code. The default is enable=no.] )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 etc ; do dirname=${dir}build_dir mpe_dirname=mpe_${dirname} eval dirvalue=\$"$dirname" eval $dirname=\$\{${mpe_dirname}\}donefor dir in include lib bin 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(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] )CFLAGS="$CFLAGS -DUSE_STDARG")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] ) CFLAGS="$CFLAGS -DHAVE_PROTOTYPES" AC_MSG_RESULT([yes])else AC_MSG_RESULT([no])fiif test "$MPE_BUILD_FORTRAN2C" = "yes" ; then if test "$enable_f2cmpilib" = "yes" ; then F2CMPI_LIBS="-l$F2CMPI_LIBNAME" fi# when --enable-f77 and --disable-f2cmpilib are selected,# value supplied in --with-f2cmpilibs will be used.else F2CMPI_LIBS=""fidnl Check MPI-IOif test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then if test "$enable_checkMPI" = "yes" -a "$enable_checkMPIO" = "yes" ; then AC_MSG_CHECKING( [for the C version of MPI_File_open()] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$CFLAGS $MPI_INC], $MPI_LIBS, [ int itmp; MPI_File fh ], [ itmp=MPI_File_open( MPI_COMM_WORLD, "mpiiotest", MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh ) ], [ 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_File_open()] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$CFLAGS $MPI_INC], $MPI_LIBS, [ int itmp; MPI_File fh ], [ itmp=PMPI_File_open( MPI_COMM_WORLD, "mpiiotest", MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh ) ],
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -