📄 mpefc.in
字号:
#! /bin/sh## mpefc : Script to compile and/or link MPI programs with MPE libraries.#MPE_ETCDIR=@etcbuild_dir@MPI_F77="@MPI_F77@"MPI_FLINKER=$MPI_F77MPI_FFLAGS="@MPI_FFLAGS@"MPI_LIBS="@MPI_LIBS@"FFLAGS="@FFLAGS@"LDFLAGS="@LDFLAGS@"MPE_BUILD_FORTRAN2C=@MPE_BUILD_FORTRAN2C@# Set $FC so mpe_xxx.conf recognize this is a fortran wrapperFC="MPE Fortran Compiler Wrapper"# Internal variables# Show is set to echo to cause the compilation command to be echoed instead# of executed.Show=eval# ------------------------------------------------------------------------# Argument processing.# Look through the arguments for arguments that indicate compile only.# If these are *not* found, add the library optionslinking=yesallargs=""for arg in "$@" ; do # Set addarg to no if this arg should be ignored by the C compiler addarg=yes qarg=$arg case $arg in # ---------------------------------------------------------------- # Compiler options that affect whether we are linking or no -c|-S|-E|-M|-MM) # The compiler links by default linking=no ;; # ---------------------------------------------------------------- # Options that control how we use mpicc (e.g., -show, # -cc=* -config=* -echo) addarg=no set -x ;; -mpif77=*) MPI_F77=`echo A$arg | sed -e 's/A-mpif77=//g'` MPI_FLINKER=$MPI_F77 addarg=no ;; -show) addarg=no Show=echo ;; -mpilog|-mpitrace|-mpianim|-mpicheck|-graphics|-log|-nolog) profConf=`echo A$arg | sed -e 's/A-//g'` profConf="mpe_$profConf" addarg=no # Loading the profConf file is handled below ;; -h|-help)cat <<EOFmpefc : To compile or link Fortran MPI programs with MPE profiling libraries. In addition, the following special options are supported. -h|-help : Display this help message. -echo : Do set -x. -show : Print the to be executed command. -mpif77 : Reset the MPI_F77 used in this script.EOF if [ -f $MPE_ETCDIR/mpe_help.conf ] ; then . $MPE_ETCDIR/mpe_help.conf fi exit 1 ;; # ----------------------------------------------------------------- # Other arguments. We are careful to handle arguments with # quotes (we try to quote all arguments in case they include # any spaces) *\"*) qarg="'"$arg"'" ;; *\'*) qarg='\"'"$arg"'\"' ;; *) ;; esac if [ $addarg = yes ] ; then allargs="$allargs $qarg" fidone# Handle the case of a profile switchif [ -n "$profConf" ] ; then if [ -s "$MPE_ETCDIR/$profConf.conf" ] ; then . $MPE_ETCDIR/$profConf.conf else echo "mpefc: **** No profiling configuration file $profConf.conf is found in $MPE_ETCDIR" exit 1; fielse echo "mpefc: **** No profiling option is specifed!"fi# MPE include path, x_INCS, goes in front of MPI include path, MPI_xFLAGS,# in case MPI include path is in MPI_xFLAGS containing old MPE include path.F_INCS="$PROFILE_INCPATHS $MPI_FFLAGS"MPIFC_FLAGS="$F_INCS $MPE_FOPTS"MPIFC_LDFLAGS="$LDFLAGS $F_INCS $MPE_LDOPTS"if [ "$linking" = yes ] ; then $Show $MPI_FLINKER $MPIFC_LDFLAGS $allargs $PROFILE_PRELIB $MPI_LIBS $PROFILE_POSTLIB rc=$?else $Show $MPI_F77 $MPIFC_FLAGS $allargs rc=$?fiexit $rc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -