📄 configure.in
字号:
dnldnl 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_collchk_conf.h)dnlecho "Configuring MPE Collective and Datatype Checking Library 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/include/collchk.h ; then top_srcdir_abs=$srcdirelse PAC_GETWD( top_srcdir_abs, include/collchk.h )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"COLLCHK_LIBNAME="${MPE_LIBNAME}_collchk"F2CMPI_LIBNAME="${MPE_LIBNAME}_f2cmpi"PROF_LIBS="-l$PROF_LIBNAME"COLLCHK_LIBS="-l$COLLCHK_LIBNAME $PROF_LIBS"F2CMPI_LIBS="-l$F2CMPI_LIBNAME"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 include/collchk.h -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 checking. in MPICHx buiid. The default is yes.], ,with_mpiio=yes )AC_ARG_ENABLE( romio,[--enable-romio - Enable/Disable ROMIO MPI-IO checking 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 )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" )if test -z "$nonopt" ; then nonopt=NONE ; fiAC_CANONICAL_HOSTdnl 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 unistd.h )AC_FUNC_ALLOCAdnl Check MPI_Type_get_envelope() and MPI_Type_get_content()if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then if test "$enable_checkMPI" = "yes" ; then AC_MSG_CHECKING( [for MPI_Datatype decoding functions] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ int nints, naddrs, ntypes, combiner; int *ints; MPI_Aint *addrs; MPI_Datatype *types; MPI_Datatype type; int itmp ], [ itmp=MPI_Type_get_envelope( type, &nints, &naddrs, &ntypes, &combiner ); itmp=MPI_Type_get_contents(type, nints, naddrs, ntypes, ints, addrs, types); combiner=MPI_COMBINER_NAMED; ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) if test "$mpe_link_ok" = "yes" ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) PAC_MSG_ERROR( $enable_softerror, [Missing MPI_Datatype decoding functions!] ) fi fidnl if MPICH2/MPICH1, assume MPI_Type_get_envelope()/MPI_Type_get_content()fidnl Check MPI_COMBINER_xxxif test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then if test "$enable_checkMPI" = "yes" ; then AC_MSG_CHECKING( [for rare MPI_COMBINER_XXX types] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ int cbr1, cbr2, cbr3, cbr4, cbr5, cbr6; ], [ cbr1=MPI_COMBINER_DUP; cbr2=MPI_COMBINER_F90_COMPLEX; cbr3=MPI_COMBINER_INDEXED_BLOCK; cbr4=MPI_COMBINER_HINDEXED_INTEGER; cbr5=MPI_COMBINER_STRUCT_INTEGER; cbr6=MPI_COMBINER_SUBARRAY; ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) if test "$mpe_link_ok" = "yes" ; then AC_MSG_RESULT(yes) AC_DEFINE( HAVE_RARE_MPI_COMBINERS, 1, [Define if rare MPI_COMBINER_xxx exist] ) else AC_MSG_RESULT(no) fi fielsednl if MPICH2, assume are MPI_COMBINER_XXX are available, not in MPICH1 if test "$MPI_IMPL" = "MPICH2" ; then AC_DEFINE( HAVE_RARE_MPI_COMBINERS, 1, [Define if rare MPI_COMBINER_xxx exist] ) fifidnl Check MPI_Add_error_class(), MPI_Add_error_code(), MPI_Add_error_string()dnl and MPI_Comm_call_errhandler()if test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then if test "$enable_checkMPI" = "yes" ; then AC_MSG_CHECKING( [for MPI Error functions] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ int itmp, err_class, err_code; char err_str[]="test"; ], [ itmp=MPI_Add_error_class( &err_class ); itmp=MPI_Add_error_code( err_class, &err_code ); itmp=MPI_Add_error_string( err_code, err_str ); itmp=MPI_Comm_call_errhandler( MPI_COMM_WORLD, err_code ); ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) if test "$mpe_link_ok" = "yes" ; then AC_MSG_RESULT(yes) AC_DEFINE( HAVE_MPI_ERR_FNS, 1, [Define if MPI Error functions exist] ) else AC_MSG_RESULT(no) fi fielsednl if MPICH2, assume MPI_IN_PLACE is available, not in MPICH1 if test "$MPI_IMPL" = "MPICH2" ; then AC_DEFINE( HAVE_MPI_ERR_FNS, 1, [Define if MPI Error functions exist] ) fifidnl Check MPI_IN_PLACEif test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then if test "$enable_checkMPI" = "yes" ; then AC_MSG_CHECKING( [for MPI_IN_PLACE] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ int itmp, iboolean; ], [ itmp=MPI_Allreduce( MPI_IN_PLACE, &iboolean, 1, MPI_INT, MPI_LAND, MPI_COMM_WORLD ) ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) if test "$mpe_link_ok" = "yes" ; then AC_MSG_RESULT(yes) AC_DEFINE( HAVE_MPI_IN_PLACE, 1, [Define if MPI_IN_PLACE exists] ) else AC_MSG_RESULT(no) fi fielsednl if MPICH2, assume MPI_IN_PLACE is available, not in MPICH1 if test "$MPI_IMPL" = "MPICH2" ; then AC_DEFINE( HAVE_MPI_IN_PLACE, 1, [Define if MPI_IN_PLACE exists] ) fifidnl Check MPI_WCHARif test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then if test "$enable_checkMPI" = "yes" ; then AC_MSG_CHECKING( [for MPI_WCHAR] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ MPI_Datatype type; ], [ type = MPI_WCHAR ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) if test "$mpe_link_ok" = "yes" ; then AC_MSG_RESULT(yes) AC_DEFINE( HAVE_MPI_WCHAR, 1, [Define if MPI_WCHAR exists] ) else AC_MSG_RESULT(no) fi fielsednl if MPICH2, assume MPI_SIGNED_CHAR is available, not in MPICH1 if test "$MPI_IMPL" = "MPICH2" ; then AC_DEFINE( HAVE_MPI_WCHAR, 1, [Define if MPI_WCHAR exists] ) fifidnl Check MPI_SIGNED_CHARif test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then if test "$enable_checkMPI" = "yes" ; then AC_MSG_CHECKING( [for MPI_SIGNED_CHAR] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ MPI_Datatype type; ], [ type = MPI_SIGNED_CHAR ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) if test "$mpe_link_ok" = "yes" ; then AC_MSG_RESULT(yes) AC_DEFINE( HAVE_MPI_SIGNED_CHAR, 1, [Define if MPI_SIGNED_CHAR exists] ) else AC_MSG_RESULT(no) fi fielsednl if MPICH2, assume MPI_SIGNED_CHAR is available, not in MPICH1 if test "$MPI_IMPL" = "MPICH2" ; then AC_DEFINE( HAVE_MPI_SIGNED_CHAR, 1, [Define if MPI_SIGNED_CHAR exists] ) fifidnl Check MPI_UNSIGNED_LONG_LONGif test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then if test "$enable_checkMPI" = "yes" ; then AC_MSG_CHECKING( [for MPI_UNSIGNED_LONG_LONG] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ MPI_Datatype type; ], [ type = MPI_UNSIGNED_LONG_LONG ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) if test "$mpe_link_ok" = "yes" ; then AC_MSG_RESULT(yes) AC_DEFINE( HAVE_MPI_UNSIGNED_LONG_LONG, 1, [Define if MPI_UNSIGNED_LONG_LONG exists] ) else AC_MSG_RESULT(no) fi fielsednl if MPICH2, assume MPI_SIGNED_CHAR is available, not in MPICH1 if test "$MPI_IMPL" = "MPICH2" ; then AC_DEFINE( HAVE_MPI_UNSIGNED_LONG_LONG, 1, [Define if MPI_UNSIGNED_LONG_LONG exists] ) fifidnl Check Fortran MPI_Datatype definitions in Cif test "$MPI_IMPL" != "MPICH" -a "$MPI_IMPL" != "MPICH2" ; then if test "$enable_checkMPI" = "yes" ; then AC_MSG_CHECKING( [for Fortran MPI_Datatype in C] ) PAC_MPI_LINK_CC_FUNC( $MPI_CC, [$MPI_CFLAGS], $MPI_LIBS, , [ MPI_Datatype type ], [ type = MPI_COMPLEX; ], [ mpe_link_ok=yes ], [ mpe_link_ok=no ] ) if test "$mpe_link_ok" = "yes" ; then AC_MSG_RESULT(yes) AC_DEFINE( HAVE_FORTRAN_MPI_DATATYPE_IN_C, 1,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -