📄 configure.in
字号:
# For building the Fortran files, add the directory where we are building # the object to the include list. This is needed for g77, which makes # includes relative to the source directory of the file, not the # directory that the command is executed in FINCLUDES="$F77_INCDIR`pwd`/src"fiAC_SUBST(FINCLUDES)#PAC_PROG_F77_LIBRARY_DIR_FLAGAC_SUBST(MPIFPMPI)if test "$MPI_WITH_PMPI" = "no" ; then # If the PMPI routines are not in the same library with the MPI # routines, we may need to remove the pmpi declarations PAC_PROG_F77_ALLOWS_UNUSED_EXTERNALS([MPIFPMPI=",PMPI_WTIME,PMPI_WTICK"],[ MPIFPMPI=""; AC_MSG_WARN([Removed PMPI_WTIME and PMPI_WTICK from mpif.h])])else MPIFPMPI=",PMPI_WTIME,PMPI_WTICK"fidnl If Fortran has a pointer extension, we can create a null pointer dnl instead of using the hack of checking for a specific address.PAC_PROG_F77_HAS_POINTER(f77_has_pointer=yes,f77_has_pointer=no)rm -f mpif_bottom.hif test "$f77_has_pointer" = "yes" -a "$use_pointer_in_f77" = "yes" ; then cat >>mpif_bottom.h <<EOF pointer (MPI_BOTTOM_PTR,MPI_BOTTOM) pointer (MPI_STATUS_IG_PTR,MPI_STATUS_IGNORE) pointer (MPI_STATUSES_IG_PTR,MPI_STATUSES_IGNORE) data MPI_BOTTOM_PTR/0/, MPI_STATUS_IG_PTR/0/ data MPI_STATUSES_IG_PTR/0/EOF AC_DEFINE(USE_POINTER_FOR_BOTTOM,,[Define if we want to use nonstandard Fortran Pointer feature]) dnl Note that with this, we do not need the call to mpir_init_fcm dnl in initfcmn.f .else cat >>mpif_bottom.h <<EOF COMMON /MPIPRIV/ MPI_BOTTOM,MPI_STATUS_IGNORE,MPI_STATUSES_IGNORE CC Without this save, some Fortran implementations may make the commonC dynamic!C C For a Fortran90 module, we might replace /MPIPRIV/ with a simpleC SAVE MPI_BOTTOMC SAVE /MPIPRIV/EOFfidnl Up to size checking code in master configure.in (where it tries to dnl find the matching C sizes) as part of defining mpi_integer8 etc.dnl The results are available in pac_cv_sizeof_f77_<type>dnl Size is 0 if unknown or unavailable (or cross-compiling)dnl Due to limitations in autoconf, we cannot put these into a loop.dnl We also check integer to find the type of MPI_Fintdnldnl Cross-compilation results can be included with the --with-cross=filednl option.CROSS_F77_SIZEOF_INTEGER=${CROSS_F77_SIZEOF_INTEGER:-0}CROSS_F77_SIZEOF_REAL=${CROSS_F77_SIZEOF_REAL:-0}CROSS_F77_SIZEOF_DOUBLE_PRECISION=${CROSS_F77_SIZEOF_DOUBLE_PRECISION:-0}PAC_PROG_F77_CHECK_SIZEOF(integer,$CROSS_F77_SIZEOF_INTEGER)PAC_PROG_F77_CHECK_SIZEOF(real,$CROSS_F77_SIZEOF_REAL)PAC_PROG_F77_CHECK_SIZEOF(double precision,$CROSS_F77_SIZEOF_DOUBLE_PRECISION)# If we have sizes for real and double, we do not need to call mpir_get_fsize# at run time.#AC_TRY_COMPILE(,[ integer*1 i],has_integer_1=1,has_integer_1=0)AC_TRY_COMPILE(,[ integer*2 i],has_integer_2=2,has_integer_2=0)AC_TRY_COMPILE(,[ integer*4 i],has_integer_4=4,has_integer_4=0)AC_TRY_COMPILE(,[ integer*8 i],has_integer_8=8,has_integer_8=0)AC_TRY_COMPILE(,[ integer*16 i],has_integer_16=16,has_integer_16=0)dnl PAC_PROG_F77_CHECK_SIZEOF(integer*1,0)dnl PAC_PROG_F77_CHECK_SIZEOF(integer*2,0)dnl PAC_PROG_F77_CHECK_SIZEOF(integer*4,0)dnl PAC_PROG_F77_CHECK_SIZEOF(integer*8,0)dnl PAC_PROG_F77_CHECK_SIZEOF(integer*16,0)dnl PAC_PROG_F77_CHECK_SIZEOF(real*4,0)dnl PAC_PROG_F77_CHECK_SIZEOF(real*8,0)dnl PAC_PROG_F77_CHECK_SIZEOF(real*16,0)AC_TRY_COMPILE(,[ real*4 a],has_real_4=4,has_real_4=0)AC_TRY_COMPILE(,[ real*8 a],has_real_8=8,has_real_8=0)AC_TRY_COMPILE(,[ real*16 a],has_real_16=16,has_real_16=0)# Create the default datatype names for the standard MPI Fortran typesMPI_CHARACTER=0x4c000120AC_SUBST(MPI_CHARACTER)len_integer=$pac_cv_f77_sizeof_integer# Convert to two digit hexif test $len_integer -le 0 ; then len_integer=00elif test $len_integer -le 9 ; then len_integer=0$len_integer elif test $len_integer -le 15 ; then case $len_integer in 10) char=a ;; 11) char=b ;; 12) char=c ;; 13) char=d ;; 14) char=e ;; 15) char=f ;; esac len_integer="0$char"else AC_MSG_ERROR([Integer type sizes greater than 15 are not supported])fiMPI_INTEGER=0x4c00${len_integer}21MPI_REAL=0x4c00${len_integer}22MPI_LOGICAL=0x4c00${len_integer}23AC_SUBST(MPI_INTEGER)AC_SUBST(MPI_REAL)AC_SUBST(MPI_LOGICAL)len_double=$pac_cv_f77_sizeof_double_precision# Convert to two digit hexif test $len_double -le 0 ; then len_double=00elif test $len_double -le 9 ; then len_double=0$len_double elif test $len_double -le 15 ; then case $len_double in 10) char=a ;; 11) char=b ;; 12) char=c ;; 13) char=d ;; 14) char=e ;; 15) char=f ;; esac len_double="0$char"elif test $len_double -le 31 ; then len_double=`expr $len_double - 16` len_double="1$len_double"else AC_MSG_ERROR([Double Precision type sizes greater than 31 are not supported])fiMPI_COMPLEX=0x4c00${len_double}24MPI_DOUBLE_PRECISION=0x4c00${len_double}25MPI_2INTEGER=0x4c00${len_double}26MPI_2REAL=0x4c00${len_double}27AC_SUBST(MPI_COMPLEX)AC_SUBST(MPI_DOUBLE_PRECISION)AC_SUBST(MPI_2INTEGER)AC_SUBST(MPI_2REAL)len_doublecplx=`expr $pac_cv_f77_sizeof_double_precision \* 2`# Convert to two digit hexif test $len_doublecplx -le 0 ; then len_doublecplx=00elif test $len_doublecplx -le 9 ; then len_doublecplx=0$len_doublecplx elif test $len_doublecplx -le 15 ; then case $len_doublecplx in 10) char=a ;; 11) char=b ;; 12) char=c ;; 13) char=d ;; 14) char=e ;; 15) char=f ;; esac len_doublecplx="0$char"elif test $len_doublecplx -le 31 ; then len_doublecplx=`expr $len_doublecplx - 16` if test "$len_doubldcplx" = 0 ; then len_doublecplx="10"; else len_doublecplx="1$len_doublecplx"; fi else AC_MSG_ERROR([Double Complex type sizes greater than 31 are not supported])fiMPI_DOUBLE_COMPLEX=0x4c00${len_doublecplx}28MPI_2DOUBLE_PRECISION=0x4c00${len_doublecplx}29MPI_2COMPLEX=0x4c00${len_doublecplx}2aAC_SUBST(MPI_DOUBLE_COMPLEX)AC_SUBST(MPI_2DOUBLE_PRECISION)AC_SUBST(MPI_2COMPLEX)## Temporary for the vast majority of systems that use 4 byte reals and# 8 byte doubles# Lengths at this point are in hex, hench "10" = 10 base 16 = 16 base 10.if test "$len_double" = "08" ; then F77_COMPLEX8=$MPI_COMPLEXfiif test "$len_doublecplx" = "10" ; then F77_COMPLEX16=$MPI_DOUBLE_COMPLEXfiif test "$len_long_double" = "10" ; then F77_COMPLEX32="0x4c00202b"filen_2dc=`expr $pac_cv_f77_sizeof_double_precision \* 4`firstdigit=0seconddigit=0while test $len_2dc -ge 16 ; do firstdigit=`expr $firstdigit + 1` len_2dc=`expr $len_2dc - 16` donecase $len_2dc in 10) seconddigit=a ;; 11) seconddigit=b ;; 12) seconddigit=c ;; 13) seconddigit=d ;; 14) seconddigit=e ;; 15) seconddigit=f ;; *) seconddigit=$len_2dc ;;esaclen_2dc="$firstdigit$seconddigit"#echo "2double complex = $len_2dc"MPI_2DOUBLE_COMPLEX=0x4c00${len_2dc}2bAC_SUBST(MPI_2DOUBLE_COMPLEX)## Predefined values for LB, UB, and PACKEDMPI_PACKED="0x4c000114"MPI_LB="0x4c000015"MPI_UB="0x4c000016"AC_SUBST(MPI_PACKED)AC_SUBST(MPI_LB)AC_SUBST(MPI_UB)# We must convert all hex values to decimal (!)for var in CHARACTER INTEGER REAL LOGICAL DOUBLE_PRECISION COMPLEX \ DOUBLE_COMPLEX 2INTEGER 2REAL 2COMPLEX 2DOUBLE_PRECISION 2DOUBLE_COMPLEX \ PACKED UB LB ; do fullvar="MPI_$var" eval fullvarvalue=\$$fullvar #echo "$fullvar = $fullvarvalue" value=0 for pos in 3 4 5 6 7 8 9 10 ; do char=`expr substr $fullvarvalue $pos 1` case $char in a) char=10 ;; b) char=11 ;; c) char=12 ;; d) char=13 ;; e) char=14 ;; f) char=15 ;; esac value=`expr $value \* 16 + $char` done #echo "$fullvar = $value" eval $fullvar=$valuedone# Compare the sizes of these types to the C typesAC_LANG_CAC_HEADER_STDCAC_CHECK_HEADERS(stdlib.h string.h)# Get defaults for cross compilation caseCROSS_SIZEOF_CHAR=${CROSS_SIZEOF_CHAR:-0}CROSS_SIZEOF_SHORT=${CROSS_SIZEOF_SHORT:-0}CROSS_SIZEOF_INT=${CROSS_SIZEOF_INT:-0}CROSS_SIZEOF_LONG=${CROSS_SIZEOF_LONG:-0}CROSS_SIZEOF_LONG_LONG=${CROSS_SIZEOF_LONG_LONG:-0}CROSS_SIZEOF_FLOAT=${CROSS_SIZEOF_FLOAT:-0}CROSS_SIZEOF_DOUBLE=${CROSS_SIZEOF_DOUBLE:-0}CROSS_SIZEOF_LONG_DOUBLE=${CROSS_SIZEOF_LONG_DOUBLE:-0}CROSS_SIZEOF_VOID_P=${CROSS_SIZEOF_VOID_P:-0}CROSS_OFFSET_KIND=${CROSS_OFFSET_KIND:-0}CROSS_ADDRESS_KIND=${CROSS_ADDRESS_KIND:-0}AC_CHECK_SIZEOF(char,$CROSS_SIZEOF_CHAR)AC_CHECK_SIZEOF(short,$CROSS_SIZEOF_SHORT)AC_CHECK_SIZEOF(int,$CROSS_SIZEOF_INT)AC_CHECK_SIZEOF(long,$CROSS_SIZEOF_LONG)AC_CHECK_SIZEOF(long long,$CROSS_SIZEOF_LONG_LONG)AC_CHECK_SIZEOF(float,$CROSS_SIZEOF_FLOAT)AC_CHECK_SIZEOF(double,$CROSS_SIZEOF_DOUBLE)AC_CHECK_SIZEOF(long double,$CROSS_SIZEOF_LONG_DOUBLE)# sizeof(void*) is needed for ADDRESS_KIND belowAC_CHECK_SIZEOF(void*,$CROSS_SIZEOF_VOID_P)## Preload the C mpi types# THESE MUST MATCH THE DEFINITIONS IN MPI.H and MPIF.H# We use these to match the optional Fortran typeschar_mpi=${MPI_CHAR:-0}short_mpi=${MPI_SHORT:-0}int_mpi=${MPI_INT:-0}long_mpi=${MPI_LONG:-0}long_long_mpi=${MPI_LONG_LONG:-0}float_mpi=${MPI_FLOAT:-0}double_mpi=${MPI_DOUBLE:-0}long_double_mpi=${MPI_LONG_DOUBLE:-0}for len in 1 2 4 8 16 ; do eval F77_INTEGER$len=0 #eval testval=\$"pac_cv_f77_sizeof_integer_$len" eval testval=\$"has_integer_$len" if test "$testval" = 0 ; then continue ; fi noval="yes" AC_MSG_CHECKING([for C type matching Fortran integer*$len]) for c_type in char short int long "long_long" ; do eval ctypelen=\$"ac_cv_sizeof_$c_type" if test "$testval" = "$ctypelen" -a "$ctypelen" -gt 0 ; then AC_MSG_RESULT($c_type) eval F77_INTEGER$len=\$"${c_type}_mpi" noval="no" break fi done if test "$noval" = "yes" ; then AC_MSG_RESULT([unavailable]) fidone# Complex is set separately abovefor len in 4 8 16 ; do len2=`expr $len + $len` eval F77_REAL$len=0 #eval F77_COMPLEX$len2=0 #eval testval=\$"pac_cv_f77_sizeof_real_$len" eval testval=\$"has_real_$len" if test "$testval" = 0 ; then continue ; fi noval="yes" AC_MSG_CHECKING([for C type matching Fortran real*$len]) for c_type in float double "long_double" ; do eval ctypelen=\$"ac_cv_sizeof_$c_type" if test "$testval" = "$ctypelen" -a "$ctypelen" -gt 0 ; then AC_MSG_RESULT($c_type) eval F77_REAL$len=\$"${c_type}_mpi" #eval F77_COMPLEX$len2=\$"${c_type}_cplx_mpi" noval="no" break fi done if test "$noval" = "yes" ; then AC_MSG_RESULT([unavailable]) fidone# We must convert all hex values to decimal (!)for var in INTEGER1 INTEGER2 INTEGER4 INTEGER8 INTEGER16 \ REAL4 REAL8 REAL16 COMPLEX8 COMPLEX16 COMPLEX32 ; do fullvar="F77_$var" eval fullvarvalue=\$$fullvar if test "$fullvarvalue" = 0 -o -z "$fullvarvalue" ; then eval $fullvar=MPI_DATATYPE_NULL continue fi #echo "$fullvar = $fullvarvalue" value=0 for pos in 3 4 5 6 7 8 9 10 ; do char=`expr substr $fullvarvalue $pos 1` case $char in a) char=10 ;; b) char=11 ;; c) char=12 ;; d) char=13 ;; e) char=14 ;; f) char=15 ;; esac
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -