Blame src/env/mpifort.sh.in

Packit Service c5cf8c
#! /bin/sh
Packit Service c5cf8c
#
Packit Service c5cf8c
# (C) 2006 by Argonne National Laboratory.
Packit Service c5cf8c
#     See COPYRIGHT in top-level directory.
Packit Service c5cf8c
#
Packit Service c5cf8c
# mpifort
Packit Service c5cf8c
# Simple script to compile and/or link MPI programs.
Packit Service c5cf8c
# This script knows the default flags and libraries, and can handle
Packit Service c5cf8c
# alternative C compilers and the associated flags and libraries.
Packit Service c5cf8c
# The important terms are:
Packit Service c5cf8c
#    includedir, libdir - Directories containing an *installed* mpich
Packit Service c5cf8c
#    prefix, execprefix - Often used to define includedir and libdir
Packit Service c5cf8c
#    FC                 - Fortran 90 compiler
Packit Service c5cf8c
#    WRAPPER_FCFLAGS    - Any special flags needed to compile
Packit Service c5cf8c
#    WRAPPER_LDFLAGS    - Any special flags needed to link
Packit Service c5cf8c
#    WRAPPER_LIBS       - Any special libraries needed in order to link
Packit Service c5cf8c
#    FC_OTHER_LIBS      - Yet more libraries, needed just with FC
Packit Service c5cf8c
#
Packit Service c5cf8c
# We assume that (a) the C compiler can both compile and link programs
Packit Service c5cf8c
#
Packit Service c5cf8c
# Handling of command-line options:
Packit Service c5cf8c
#   This is a little tricky because some options may contain blanks.
Packit Service c5cf8c
#
Packit Service c5cf8c
# Special issues with shared libraries - todo
Packit Service c5cf8c
#
Packit Service c5cf8c
# --------------------------------------------------------------------------
Packit Service c5cf8c
# Set the default values of all variables.
Packit Service c5cf8c
#
Packit Service c5cf8c
# Directory locations: Fixed for any MPI implementation.
Packit Service c5cf8c
# Set from the directory arguments to configure (e.g., --prefix=/usr/local)
Packit Service c5cf8c
prefix=__PREFIX_TO_BE_FILLED_AT_INSTALL_TIME__
Packit Service c5cf8c
exec_prefix=__EXEC_PREFIX_TO_BE_FILLED_AT_INSTALL_TIME__
Packit Service c5cf8c
sysconfdir=__SYSCONFDIR_TO_BE_FILLED_AT_INSTALL_TIME__
Packit Service c5cf8c
includedir=__INCLUDEDIR_TO_BE_FILLED_AT_INSTALL_TIME__
Packit Service c5cf8c
libdir=__LIBDIR_TO_BE_FILLED_AT_INSTALL_TIME__
Packit Service c5cf8c
modincdir=@modincdir@
Packit Service c5cf8c
Packit Service c5cf8c
# Default settings for compiler, flags, and libraries
Packit Service c5cf8c
# Determined by a combination of environment variables and tests within
Packit Service c5cf8c
# configure (e.g., determining whehter -lsocket is needee)
Packit Service c5cf8c
FC="@FC@"
Packit Service c5cf8c
FCCPP="@FCCPP@"
Packit Service c5cf8c
#
Packit Service c5cf8c
# Fortran 90 Compiler characteristics
Packit Service c5cf8c
FCINC="@FCINC@"
Packit Service c5cf8c
# f90modinc specifies how to add a directory to the search path for modules.
Packit Service c5cf8c
# Some compilers (Intel ifc version 5) do not support this concept, and
Packit Service c5cf8c
# instead need
Packit Service c5cf8c
# a specific list of files that contain module names and directories.
Packit Service c5cf8c
# The FCMODINCSPEC is a more general approach that uses <dir> and <file>
Packit Service c5cf8c
# for the directory and file respectively.
Packit Service c5cf8c
FCMODINC="@FCMODINCFLAG@"
Packit Service c5cf8c
FCMODINCSPEC="@FCMODINCSPEC@"
Packit Service c5cf8c
FCEXT="@FCEXT@"
Packit Service c5cf8c
#
Packit Service c5cf8c
MPICH_VERSION="@MPICH_VERSION@"
Packit Service c5cf8c
Packit Service c5cf8c
enable_wrapper_rpath="@enable_wrapper_rpath@"
Packit Service c5cf8c
@fc_shlib_conf@
Packit Service c5cf8c
Packit Service c5cf8c
# Internal variables
Packit Service c5cf8c
# Show is set to echo to cause the compilation command to be echoed instead
Packit Service c5cf8c
# of executed.
Packit Service c5cf8c
Show=eval
Packit Service c5cf8c
#
Packit Service c5cf8c
# End of initialization of variables
Packit Service c5cf8c
#---------------------------------------------------------------------
Packit Service c5cf8c
# Environment Variables.
Packit Service c5cf8c
# The environment variables MPICH_FC may be used to override the
Packit Service c5cf8c
# default choices.
Packit Service c5cf8c
# In addition, if there is a file $sysconfdir/mpifort-$FCname.conf,
Packit Service c5cf8c
# where FCname is the name of the compiler with all spaces replaced by hyphens
Packit Service c5cf8c
# (e.g., "fc -64" becomes "fc--64", that file is sources, allowing other
Packit Service c5cf8c
# changes to the compilation environment.  See the variables used by the
Packit Service c5cf8c
# script (defined above)
Packit Service c5cf8c
# Added MPICH_FC_OLD, MPICH_FC can be used to prefix FC with external utility,
Packit Service c5cf8c
# e.g. setenv MPICH_FC 'eval linkcache $MPICH_FC_OLD'
Packit Service c5cf8c
if [ -n "$MPICH_FC" ] ; then
Packit Service c5cf8c
    MPICH_FC_OLD="$FC"
Packit Service c5cf8c
    FC="$MPICH_FC"
Packit Service c5cf8c
    FCname=`echo $FC | sed 's/ /-/g'`
Packit Service c5cf8c
    if [ -s $sysconfdir/mpifort-$FCname.conf ] ; then
Packit Service c5cf8c
        . $sysconfdir/mpifort-$FCname.conf
Packit Service c5cf8c
    fi
Packit Service c5cf8c
fi
Packit Service c5cf8c
# Allow a profiling option to be selected through an environment variable
Packit Service c5cf8c
if [ -n "$MPIFORT_PROFILE" ] ; then
Packit Service c5cf8c
    profConf=$MPIFORT_PROFILE
Packit Service c5cf8c
fi
Packit Service c5cf8c
#
Packit Service c5cf8c
# ------------------------------------------------------------------------
Packit Service c5cf8c
# Argument processing.
Packit Service c5cf8c
# This is somewhat awkward because of the handling of arguments within
Packit Service c5cf8c
# the shell.  We want to handle arguments that include spaces without
Packit Service c5cf8c
# loosing the spacing (an alternative would be to use a more powerful
Packit Service c5cf8c
# scripting language that would allow us to retain the array of values,
Packit Service c5cf8c
# which the basic (rather than enhanced) Bourne shell does not.
Packit Service c5cf8c
#
Packit Service c5cf8c
# Look through the arguments for arguments that indicate compile only.
Packit Service c5cf8c
# If these are *not* found, add the library options
Packit Service c5cf8c
#
Packit Service c5cf8c
linking=yes
Packit Service c5cf8c
allargs=""
Packit Service c5cf8c
interlib_deps=yes
Packit Service c5cf8c
static_mpi=no
Packit Service c5cf8c
for arg in "$@" ; do
Packit Service c5cf8c
    # Set addarg to no if this arg should be ignored by the C compiler
Packit Service c5cf8c
    addarg=yes
Packit Service c5cf8c
    qarg=$arg
Packit Service c5cf8c
    case $arg in
Packit Service c5cf8c
	# ----------------------------------------------------------------
Packit Service c5cf8c
	# Compiler options that affect whether we are linking or no
Packit Service c5cf8c
    -c|-S|-E|-M|-MM)
Packit Service c5cf8c
    # The compiler links by default
Packit Service c5cf8c
    linking=no
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
	# ----------------------------------------------------------------
Packit Service c5cf8c
	# Options that control how we use mpifort (e.g., -show,
Packit Service c5cf8c
	# -fc=* -config=*
Packit Service c5cf8c
    -static)
Packit Service c5cf8c
    interlib_deps=no
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    -static-mpi)
Packit Service c5cf8c
    interlib_deps=no
Packit Service c5cf8c
    static_mpi=yes
Packit Service c5cf8c
    addarg=no
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    -echo)
Packit Service c5cf8c
    addarg=no
Packit Service c5cf8c
    set -x
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    -fc=*)
Packit Service c5cf8c
    FC=`echo A$arg | sed -e 's/A-fc=//g'`
Packit Service c5cf8c
    addarg=no
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    -fc=*)
Packit Service c5cf8c
    FC=`echo A$arg | sed -e 's/A-fc=//g'`
Packit Service c5cf8c
    addarg=no
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    -show)
Packit Service c5cf8c
    addarg=no
Packit Service c5cf8c
    Show=echo
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    -config=*)
Packit Service c5cf8c
    addarg=no
Packit Service c5cf8c
    FCname=`echo A$arg | sed -e 's/A-config=//g'`
Packit Service c5cf8c
    if [ -s "$sysconfdir/mpifort-$FCname.conf" ] ; then
Packit Service c5cf8c
        . "$sysconfdir/mpifort-$FCname.conf"
Packit Service c5cf8c
    else
Packit Service c5cf8c
	echo "Configuration file mpifort-$FCname.conf not found"
Packit Service c5cf8c
    fi
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    -compile-info|-compile_info)
Packit Service c5cf8c
    # -compile_info included for backward compatibility
Packit Service c5cf8c
    Show=echo
Packit Service c5cf8c
    addarg=no
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    -link-info|-link_info)
Packit Service c5cf8c
    # -link_info included for backward compatibility
Packit Service c5cf8c
    Show=echo
Packit Service c5cf8c
    addarg=no
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    -v)
Packit Service c5cf8c
    # Pass this argument to the compiler as well.
Packit Service c5cf8c
    echo "mpifort for MPICH version $MPICH_VERSION"
Packit Service c5cf8c
    # if there is only 1 argument, it must be -v.
Packit Service c5cf8c
    if [ "$#" -eq "1" ] ; then
Packit Service c5cf8c
        linking=no
Packit Service c5cf8c
    fi
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    -profile=*)
Packit Service c5cf8c
    # Pass the name of a profiling configuration.  As
Packit Service c5cf8c
    # a special case, lib<name>.so or lib<name>.la may be used
Packit Service c5cf8c
    # if the library is in $libdir
Packit Service c5cf8c
    profConf=`echo A$arg | sed -e 's/A-profile=//g'`
Packit Service c5cf8c
    addarg=no
Packit Service c5cf8c
    # Loading the profConf file is handled below
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    -nativelinking)
Packit Service c5cf8c
    # Internal option to use native compiler for linking without MPI libraries
Packit Service c5cf8c
    nativelinking=yes
Packit Service c5cf8c
    addarg=no
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    -help)
Packit Service c5cf8c
    NC=`echo "$FC" | sed 's%\/% %g' | awk '{print $NF}' -`
Packit Service c5cf8c
    if [ -f "$sysconfdir/mpixxx_opts.conf" ] ; then
Packit Service c5cf8c
        . $sysconfdir/mpixxx_opts.conf
Packit Service c5cf8c
        echo "    -fc=xxx       - Reset the native compiler to xxx."
Packit Service c5cf8c
    else
Packit Service c5cf8c
        if [ -f "./mpixxx_opts.conf" ] ; then
Packit Service c5cf8c
            . ./mpixxx_opts.conf
Packit Service c5cf8c
            echo "    -fc=xxx       - Reset the native compiler to xxx."
Packit Service c5cf8c
        fi
Packit Service c5cf8c
    fi
Packit Service c5cf8c
    exit 0
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
        # -----------------------------------------------------------------
Packit Service c5cf8c
	# Other arguments.  We are careful to handle arguments with
Packit Service c5cf8c
	# quotes (we try to quote all arguments in case they include
Packit Service c5cf8c
	# any spaces)
Packit Service c5cf8c
    *\"*)
Packit Service c5cf8c
    qarg="'"$arg"'"
Packit Service c5cf8c
    case $arg in
Packit Service c5cf8c
       -D*)
Packit Service c5cf8c
       cppflags="$cppflags $qarg"
Packit Service c5cf8c
       ;;
Packit Service c5cf8c
    esac
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    *\'*)
Packit Service c5cf8c
    qarg='\"'"$arg"'\"'
Packit Service c5cf8c
    case $arg in
Packit Service c5cf8c
       -D*)
Packit Service c5cf8c
       cppflags="$cppflags $qarg"
Packit Service c5cf8c
       ;;
Packit Service c5cf8c
    esac
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    # The following are special args used to handle .F files when the
Packit Service c5cf8c
    # Fortran compiler itself does not handle these options
Packit Service c5cf8c
    -I*)
Packit Service c5cf8c
    cppflags="$cppflags $arg"
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    -D*)
Packit Service c5cf8c
    cppflags="$cppflags $arg"
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    *.F|*.F90|.fpp|.FPP)
Packit Service c5cf8c
# If FCCPP is not empty, then we need to do the following:
Packit Service c5cf8c
#    If any input files have the .F or .F90 extension, then
Packit Service c5cf8c
#        If FCCPP = false, then
Packit Service c5cf8c
#            generate an error message and exit
Packit Service c5cf8c
#        Use FCCPP to convert the file from .F to .f, using
Packit Service c5cf8c
#            $TMPDIR/f$$-$count.f as the output file name
Packit Service c5cf8c
#            Replace the input file with this name in the args
Packit Service c5cf8c
# This is needed only for very broken systems
Packit Service c5cf8c
#
Packit Service c5cf8c
    if [ -n "$FCCPP" ] ; then
Packit Service c5cf8c
        if [ "$FCCPP" = "false" ] ; then
Packit Service c5cf8c
            echo "This Fortran compiler does not accept .F or .F90 files"
Packit Service c5cf8c
	    exit 1
Packit Service c5cf8c
        fi
Packit Service c5cf8c
        addarg=no
Packit Service c5cf8c
	# Remove and directory names and extension
Packit Service c5cf8c
	$ext=`expr "$arg" : '.*\(\..*\)'`
Packit Service c5cf8c
        bfile=`basename $arg $ext`
Packit Service c5cf8c
	#
Packit Service c5cf8c
	TMPDIR=${TMPDIR:-/tmp}
Packit Service c5cf8c
	# Make sure that we use a valid extension for the temp file.
Packit Service c5cf8c
        tmpfile=$TMPDIR/f$$-$bfile.$FCEXT
Packit Service c5cf8c
        if $FCCPP $cppflags $arg > $tmpfile ; then
Packit Service c5cf8c
            # Add this file to the commandline list
Packit Service c5cf8c
	    count=`expr $count + 1`
Packit Service c5cf8c
	    allargs="$allargs $tmpfile"
Packit Service c5cf8c
	    rmfiles="$rmfiles $tmpfile"
Packit Service c5cf8c
        else
Packit Service c5cf8c
	    echo "Aborting compilation because of failure in preprocessing step"
Packit Service c5cf8c
	    echo "for file $arg ."
Packit Service c5cf8c
	    exit 1
Packit Service c5cf8c
        fi
Packit Service c5cf8c
    fi
Packit Service c5cf8c
    # Otherwise, just accept the argument
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
    # - end of special handling for .F files
Packit Service c5cf8c
Packit Service c5cf8c
    *)
Packit Service c5cf8c
    qarg="'$arg'"
Packit Service c5cf8c
    ;;
Packit Service c5cf8c
Packit Service c5cf8c
    esac
Packit Service c5cf8c
    if [ $addarg = yes ] ; then
Packit Service c5cf8c
        allargs="$allargs $qarg"
Packit Service c5cf8c
    fi
Packit Service c5cf8c
done
Packit Service c5cf8c
Packit Service c5cf8c
if [ $# -eq 0 ] ; then
Packit Service c5cf8c
    echo "Error: Command line argument is needed!"
Packit Service c5cf8c
    "$0" -help
Packit Service c5cf8c
    exit 1
Packit Service c5cf8c
fi
Packit Service c5cf8c
Packit Service c5cf8c
Packit Service c5cf8c
# -----------------------------------------------------------------------
Packit Service c5cf8c
# Derived variables.  These are assembled from variables set from the
Packit Service c5cf8c
# default, environment, configuration file (if any) and command-line
Packit Service c5cf8c
# options (if any)
Packit Service c5cf8c
Packit Service c5cf8c
PROFILE_FOO=
Packit Service c5cf8c
# Handle the case of a profile switch
Packit Service c5cf8c
if [ -n "$profConf" ] ; then
Packit Service c5cf8c
    profConffile=
Packit Service c5cf8c
    if [ -s "$libdir/lib$profConf.a" -o -s "$libdir/lib$profConf.so" ] ; then
Packit Service c5cf8c
	PROFILE_FOO="-l$profConf"
Packit Service c5cf8c
    elif [ -s "$sysconfdir/$profConf.conf" ] ; then
Packit Service c5cf8c
	profConffile="$sysconfdir/$profConf.conf"
Packit Service c5cf8c
    elif [ -s "$profConf.conf" ] ; then
Packit Service c5cf8c
        profConffile="$profConf.conf"
Packit Service c5cf8c
    else
Packit Service c5cf8c
        echo "Profiling configuration file $profConf.conf not found in $sysconfdir"
Packit Service c5cf8c
    fi
Packit Service c5cf8c
    if [ -n "$profConffile" -a -s "$profConffile" ] ; then
Packit Service c5cf8c
	. $profConffile
Packit Service c5cf8c
    fi
Packit Service c5cf8c
fi
Packit Service c5cf8c
Packit Service c5cf8c
# Construct the line to add the include directory (not all compilers
Packit Service c5cf8c
# use -I, unfortunately)
Packit Service c5cf8c
if [ -z "${FCINC}" ] ; then
Packit Service c5cf8c
    # If there is no path, add a link to the mpif.h file.
Packit Service c5cf8c
    # There *must* be a way to provide the path the any modules (there
Packit Service c5cf8c
    # may be too many to link)
Packit Service c5cf8c
    if [ ! -r mpif.h ] ; then
Packit Service c5cf8c
        #echo "Adding a symbolic link for mpif.h"
Packit Service c5cf8c
	trap "$Show rm -f mpif.h" 0
Packit Service c5cf8c
	# This should really be the (related) f77includedir.
Packit Service c5cf8c
	$Show ln -s ${includedir}/mpif.h mpif.h
Packit Service c5cf8c
	# Remember to remove this file
Packit Service c5cf8c
	rmfiles="$rmfiles mpif.h"
Packit Service c5cf8c
    fi
Packit Service c5cf8c
    FCINCDIRS=
Packit Service c5cf8c
else
Packit Service c5cf8c
    # Normally, FCINC is just -I, but some compilers have used different
Packit Service c5cf8c
    # command line arguments
Packit Service c5cf8c
    FCINCDIRS=${FCINC}${includedir}
Packit Service c5cf8c
fi
Packit Service c5cf8c
Packit Service c5cf8c
# Handle the specification of the directory containing the modules
Packit Service c5cf8c
if [ -n "$FCMODINCSPEC" ] ; then
Packit Service c5cf8c
    newarg=`echo A"$FCMODINCSPEC" | \
Packit Service c5cf8c
	sed -e 's/^A//' -e 's%<dir>%'"$includedir%g" -e 's/<file>/mpi/g'`
Packit Service c5cf8c
    FCMODDIRS="$newarg"
Packit Service c5cf8c
elif [ -n "$FCMODINC" ] ; then
Packit Service c5cf8c
    FCMODDIRS="${FCMODINC}$modincdir"
Packit Service c5cf8c
fi
Packit Service c5cf8c
Packit Service 3f36f5
final_fcflags="@MPICH_MPIFORT_FCFLAGS@ "
Packit Service 3f36f5
final_ldflags="@MPICH_MPIFORT_LDFLAGS@ "
Packit Service c5cf8c
final_libs="@MPICH_MPIFORT_LIBS@"
Packit Service c5cf8c
if test "@INTERLIB_DEPS@" = "no" -o "${interlib_deps}" = "no" ; then
Packit Service c5cf8c
    final_ldflags="${final_ldflags} @LDFLAGS@"
Packit Service 3f36f5
    final_libs="${final_libs} @LIBS@ "
Packit Service c5cf8c
fi
Packit Service c5cf8c
Packit Service c5cf8c
# A temporary statement to invoke the compiler
Packit Service c5cf8c
# Place the -L before any args incase there are any mpi libraries in there.
Packit Service c5cf8c
# Eventually, we'll want to move this after any non-MPI implementation
Packit Service c5cf8c
# libraries
Packit Service c5cf8c
if [ "$linking" = yes ] ; then
Packit Service c5cf8c
    # Attempt to encode rpath info into the executable if the user has not
Packit Service c5cf8c
    # disabled rpath usage and some flavor of rpath makes sense on this
Packit Service c5cf8c
    # platform.
Packit Service c5cf8c
    # TODO configure and config.rpath are computing more sophisticated rpath
Packit Service c5cf8c
    # schemes than this simple one.  Consider updating this logic accordingly.
Packit Service c5cf8c
    if test "X$enable_wrapper_rpath" = "Xyes" ; then
Packit Service c5cf8c
        eval rpath_flags=\"${hardcode_libdir_flag_spec}\"
Packit Service c5cf8c
    else
Packit Service c5cf8c
	rpath_flags=""
Packit Service c5cf8c
    fi
Packit Service c5cf8c
Packit Service c5cf8c
    if [ "$nativelinking" = yes ] ; then
Packit Service c5cf8c
        $Show $FC $PROFILE_INCPATHS ${final_fcflags} ${final_ldflags} $allargs
Packit Service c5cf8c
        rc=$?
Packit Service c5cf8c
    else
Packit Service c5cf8c
        if [ "$static_mpi" = no ] ; then
Packit Service c5cf8c
          $Show $FC $PROFILE_INCPATHS ${final_fcflags} ${final_ldflags} "${allargs[@]}" $FCINCDIRS $FCMODDIRS -L$libdir -l@MPIFCLIBNAME@ $PROFILE_PRELIB $PROFILE_FOO $rpath_flags -l@MPILIBNAME@ @LPMPILIBNAME@ $PROFILE_POSTLIB ${final_libs} @FC_OTHER_LIBS@
Packit Service c5cf8c
        else
Packit Service c5cf8c
          fabric_dep=""
Packit Service c5cf8c
          if [ "@ofi_embedded@" = yes ] ; then
Packit Service c5cf8c
              fabric_dep=`pkg-config --static --libs $libdir/pkgconfig/libfabric.pc`
Packit Service c5cf8c
              fabric_dep=`echo $fabric_dep | sed 's/-lfabric//'`
Packit Service c5cf8c
          elif [ -f @with_libfabric@/lib/pkgconfig/libfabric.pc ] ; then
Packit Service c5cf8c
              fabric_dep=`pkg-config --static --libs @with_libfabric@/lib/pkgconfig/libfabric.pc`
Packit Service c5cf8c
          else
Packit Service c5cf8c
              fabric_dep=`pkg-config --static --libs libfabric`
Packit Service c5cf8c
          fi
Packit Service c5cf8c
          $Show $FC $PROFILE_INCPATHS ${final_fcflags} ${final_ldflags} "${allargs[@]}" $FCINCDIRS $FCMODDIRS -L$libdir -l@MPIFCLIBNAME@ $PROFILE_PRELIB $PROFILE_FOO $rpath_flags $libdir/libmpi.a @LPMPILIBNAME@ $PROFILE_POSTLIB ${final_libs} @FC_OTHER_LIBS@ ${fabric_dep}
Packit Service c5cf8c
        fi
Packit Service c5cf8c
        rc=$?
Packit Service c5cf8c
    fi
Packit Service c5cf8c
else
Packit Service c5cf8c
    $Show $FC $PROFILE_INCPATHS ${final_fcflags} $allargs $FCINCDIRS $FCMODDIRS
Packit Service c5cf8c
    rc=$?
Packit Service c5cf8c
fi
Packit Service c5cf8c
if [ -n "$rmfiles" ] ; then
Packit Service c5cf8c
    for file in $rmfiles ; do
Packit Service c5cf8c
        objfile=`basename $file .f`
Packit Service c5cf8c
	if [ -s "${objfile}.o" ] ; then
Packit Service c5cf8c
	    # Rename
Packit Service c5cf8c
	    destfile=`echo $objfile | sed -e "s/.*$$-//"`
Packit Service c5cf8c
	    mv -f ${objfile}.o ${destfile}.o
Packit Service c5cf8c
	fi
Packit Service c5cf8c
        rm -f $file
Packit Service c5cf8c
    done
Packit Service c5cf8c
    rm -f $rmfiles
Packit Service c5cf8c
fi
Packit Service c5cf8c
exit $rc