This file is indexed.

/usr/lib/mpich-mpd/bin/mpif90 is in libmpich-mpd1.0-dev 1.2.7-10ubuntu1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
#! /bin/sh
#
DoLink=1
DoCompile=0
show_compile=0
show_link=0
MPILOG=
Show=eval
allargs=
compileargs=
linkargs=
linkobjs=
gettinglinkarg=0
HasDashC=0
UsesPmpi=0
verbose=0
# Default compiler configuration
#
# Directory locations: Fixed for any MPI implementation
prefix=/usr/lib/mpich-mpd
exec_prefix=${prefix}
sysconfdir=${exec_prefix}/etc
includedir=${prefix}/include
libdir=${exec_prefix}/lib
#
# Directory locations: Can change for each Fortran version
f90includedir=${includedir}
f90libdir=${libdir}
#
F90BASE="gfortran"
F90LINKERBASE="gfortran"
LDFLAGSBASE="-Wl,-Bsymbolic-functions -Wl,-z,relro"
BASE_FFLAGS=" "
F90INC=""
# f90modinc specifies how to add a directory to the search path for modules.
# Some compilers (Intel ifc) do not support this concept, and instead need
# a specific list of files that contain module names and directories.
# The f90modincspec is a more general approach that uses <dir> and <file>
# for the directory and file respectively.
F90MODINC="-I"
F90MODINCSPEC="-I<dir>"
USER_FFLAGS="-fPIC -g -O2"
#
# Linker flags
F90_LDFLAGS=""
BASE_LIB_LIST="   -lpthread  -lrt "
FLIB_LIST=""
F90LIB_PATH_LEADER="-L"
F90LIB_PATH="${libdir}"
MPILIBNAME="mpich-p4mpd"
MPIVERSION="1.2.7 (release) of : 2005/11/04 11:54:51"
FWRAPNAME="fmpich-p4mpd"
FLIBNAME="mpich-p4mpd"
# set to yes if the PMPI routines are in the same library with the MPI routines
# (for example, they are built with weak symbols).
MPI_WITH_PMPI="yes"
proflib=-lp${MPILIBNAME}
proflibfullname=${libdir}/libp${MPILIBNAME}.a
#
hasMPE="yes"
# Shared library support
SHAREDKIND="gcc"
SHARED_LIB_SEARCH_PATH_LEADER='-Wl,-rpath -Wl,'
SHARED_LIB_LOCALDIR=""
sharedlibdir=/usr/lib/mpich-mpd/lib/shared/
#
# Override the compilers using environment variables
F90LINKER="${MPICH_F90LINKER-$F90LINKERBASE}"
if [ -n "$MPICH_F90" ] ; then
    F90="$MPICH_F90"
    F90name=`echo $F90 | sed 's/ /-/g'`
    if [ -s $sysconfdir/mpif90-$F90name.conf ] ; then
        . $sysconfdir/mpif90-$F90name.conf
    fi
else
    F90="$F90BASE"
fi
UseSharedLib=${MPICH_USE_SHLIB-no}

choice=0
for arg in "$@" ; do
#    echo procssing arg $arg
    # Special processing for -o name
    if [ $gettinglinkarg = 1 ] ; then
	linkargs="$linkargs $arg"
	gettinglinkarg=0
	outputfilename="$arg"
	continue
    fi
    case "$arg" in 
	-c)
	# If -c is NOT specified, then we need to perform a link step.
	allargs="$allargs $arg"
	compileargs="$compileargs $arg"
        # If -o was set, then we need to move the output file option
        # to the compile line (note that this is non-standard, and should
        # not be used in portable codes)
        if [ $DoLink = 1 -a -n "$outputfilename" ] ; then
	    compileargs="$compileargs -o $outputfilename"
        fi
	DoLink=0
	HasDashC=1
	;;
        -o)
	# Need to link
	allargs="$allargs $arg"
        if [ $HasDashC = 1 ] ; then
            # Some BUT NOT ALL compilers support -o with -c.  Allow
            # the user to make use of the feature, IF IT EXISTS.
            compileargs="$compileargs $arg"	
        else
	    linkargs="$linkargs $arg"
	    compileargs="$compileargs -c"
	    # Still need to add the target of the -o
	    gettinglinkarg=1
	    DoLink=1
        fi
	;;
	-O*)
	allargs="$allargs $arg"
	compileargs="$compileargs $arg"
	linkargs="$linkargs $arg"
	if [ $choice = 0 ] ; then choice=2 ; fi
	;;
	-choicemod) choice=1 ;;
	-nochoicemod) choice=2 ;;
	-mpilog)
	if [ $UsesPmpi = 1 ] ; then
	    echo "Only one of -mpilog, -mpitrace, or -mpianim may be used."
	    exit 1
	else
	    UsesPmpi=1
        fi
	if [ "$hasMPE" = "yes" ] ; then
		MPILOG="-l${FWRAPNAME} -llmpe -lmpe"
	else
	    echo "-mpilog requires the MPE libraries"
	fi
	;;
	-mpitrace)
	if [ $UsesPmpi = 1 ] ; then
	    echo "Only one of -mpilog, -mpitrace, or -mpianim may be used."
	    exit 1
	else
	    UsesPmpi=1
        fi
	if [ "$hasMPE" = "yes" ] ; then
   	    MPILOG="-l${FWRAPNAME} -ltmpe -lmpe"
	else
	    echo "-mpitrace requires the MPE libraries"
	fi
	;;
	-mpianim)
	if [ $UsesPmpi = 1 ] ; then
	    echo "Only one of -mpilog, -mpitrace, or -mpianim may be used."
	    exit 1
	else
	    UsesPmpi=1
        fi
	if [ "$hasMPE" = "yes" ] ; then
	    MPILOG="-l${FWRAPNAME} -lampe -lmpe"
	else
	    echo "-mpianim requires the MPE libraries"
	fi
	;;
	-echo)
	set -x
	;;
	-show)
	Show=echo
	;;
	-config=*)
	FCname=`echo A$arg | sed -e 's/A-config=//g'`
        if [ -s $sysconfdir/mpif90-$FCname.conf ] ; then
	    . $sysconfdir/mpif90-$FCname.conf 
	else
	    echo "Configuration file mpif90-$FCname.conf not found"
	fi
	# Use the values from the config file in preference to 
	# the defaults and the MPICH_F77 environment
	F90=$F90BASE
	F90LINKER=$F90LINKERBASE
	;;
	-f90=*)
	F90=`echo A$arg | sed -e 's/A-f90=//g'`
	F90LINKER="$F90"
	;;
	-compile_info|-compile-info)
	show_compile=1
	DoLink=0
	Show=echo
	;;
	-link_info|-link-info)
	show_link=1
	Show=echo
	;;
	-shlib)
        UseSharedLib=yes
	;;
	-noshlib)
        UseSharedLib=no
	;;
	-v)
	verbose=1
	echo "mpif90 for $MPIVERSION"
	compileargs="$compileargs -v"
	linkargs="$linkargs -v"
	;;
	-l*)
	# This SHOULD be the -l<lib> argument.  Only for the linker
	linkargs="$linkargs $arg"
	allargs="$allargs $arg"
	;;
	-help)
cat <<EOF
This is a program to compile or link MPI programs
In addition, the following special options are supported
    -mpilog    - Build version that generate MPE log files
    -mpitrace  - Build version that generates traces
    -mpianim   - Build version that generates real-time animation
    -choicemod - Use a version of the MPI module that supports "choice"
                 types.  This is also the default unless -O is specified
    -nochoicemod - Use a basic version of the MPI module.
    -f90=pgm   - Change the program to use to compile and link
                 MPI programs.  WARNING! The program that you
                 choose MUST be compatible with the MPICH 
                 libraries.  If you have trouble, you should
                 reconfigure and rebuild MPICH, selecting
                 this compiler.
    -show      - Show the commands that would be used without
                 runnning them
    -compile-info - Show how to compile a program
    -link-info - Show how to link a program
    -help      - Give this help
    -echo      - Show exactly what this program is doing.
                 This option should normally not be used.
This should be used just like the usual Fortran compiler
For example,
   $0 -c foo.f 
and
   $0 -o foo foo.o
Combining compilation and linking in a single command
   $0 -o foo foo.f
may not work on some systems, and is not recommended.
EOF
	exit 1
	;;
	# Unrecognized args.  Because we do an eval, we need to
	# carefully quote any args that contain quotes.
        *\"*) 
	qarg="'"$arg"'"
	allargs="$allargs $qarg"
	compileargs="$compileargs $qarg"
	linkargs="$linkargs $qarg"
	;;
        *\'*) 
	qarg='\"'"$arg"'\"'
	allargs="$allargs $qarg"
	compileargs="$compileargs $qarg"
	linkargs="$linkargs $qarg"
	;;
        *) allargs="$allargs $arg"
	if [ -s "$arg" ] ; then
	    ext=`expr "$arg" : '.*\(\..*\)'`
	    if [ "$ext" = ".f" -o "$ext" = ".F" -o "$ext" = ".f90" -o \
		 "$ext" = ".for" -o "$ext" = ".FOR" -o "$ext" = ".F90" -o \
		 "$ext" = ".fpp" -o "$ext" = ".FPP" ] ; then
	        DoCompile=1
	        compileargs="$compileargs $arg"
	        fname=`basename $arg $ext`
	        linkobjs="$linkobjs $fname.o"
	    elif [ "$ext" = ".s" -o "$ext" = ".S" ] ; then
	        # Support .s and .S for those compilers that can
	        DoCompile=1
	        compileargs="$compileargs $arg"
	        fname=`basename $arg $ext`
	        linkobjs="$linkobjs $fname.o"
	    elif [ "$ext" = ".o" ] ; then
		if [ $HasDashC = 1 ] ; then
	            compileargs="$compileargs $arg"
                else
	            DoLink=1
	            linkobjs="$linkobjs $arg"
                fi
	    else
	        compileargs="$compileargs $arg"
	        linkargs="$linkargs $arg"
	    fi
	else
            compileargs="$compileargs $arg"
	    linkargs="$linkargs $arg"
	fi
	;;
    esac
done
#
# Set the module directory
if [ $choice -lt 2 ] ; then
    moduledir="${f90includedir}/f90choice"
    modulelib=${MPILIBNAME}f90
else
    moduledir="${f90includedir}/f90base"
    modulelib=${MPILIBNAME}f90nc
fi
if [ -n "$F90MODINCSPEC" ] ; then
    newarg=`echo A"$F90MODINCSPEC" | \
	sed -e 's/^A//' -e 's%<dir>%'"$moduledir%g" -e 's/<file>/mpi/g'`
    compileargs="$compileargs $newarg"
    linkargs="$linkargs -l$modulelib"
elif [ -n "$F90MODINC" ] ; then
    compileargs="$compileargs ${F90MODINC}$moduledir"
    linkargs="$linkargs -l$modulelib"
fi

#
# Make sure that f90linker is defined.
if [ -z "$F90LINKER" -a -n "$F90" ] ; then
    F90LINKER="$F90"
fi
#
# Check for valid and specified compiler
if [ -z "$F90" ] ; then
    echo "No Fortran 90 compiler specified when mpif90 was created,"
    echo "or configuration file does not specify a compiler."
    exit 1
fi
#
# Take care of mpif.h; try to add the link if necessary
# We'll need to edit mpif.h to remove comments if we use mpif.h instead
# of an MPI module
#
added_link=0
if [ -z "${F90INC}" ] ; then
    if [ ! -r mpif.h ] ; then
        #echo "Adding a symbolic link for mpif.h"
	trap "$Show rm -f mpif.h" 0
	# This should really be the (related) f77includedir (see mpif77).
	$Show ln -s ${includedir}/mpif.h mpif.h
	added_link=1
    fi
else
    F90INC=${F90INC}${includedir}
fi
status=0
if [ $HasDashC = 1 -a $DoCompile = 0 -a $DoLink = 0 ] ; then
    # Specified -c but no files.  Try to force -c behavior from compiler
    DoCompile=1
fi
if [ $DoCompile = 1 -o $show_compile = 1 ] ; then 
    if [ $HasDashC != 1 ] ; then
        compileargs="-c $compileargs"
    fi
    $Show $F90 $finc $BASE_FFLAGS $F90FLAGS $compileargs $F90INC
    status=$?
    if [ $status != 0 ] ; then 
	exit $status
    fi
fi
if [ $DoLink = 1 -o $show_link = 1 ] ; then
    # If no LDFLAGS defined, use the ones that MPICH was built with
    if [ -z "$LDFLAGS" ] ; then
        LDFLAGS="$LDFLAGSBASE"
    fi
    # Figure out the library list.  Because we want to support both a single
    # mpi library containing both C and Fortran interfaces, as well as 
    # a library that allows multiple Fortran interfaces, we may need different
    # library link lines.  With a unified C/Fortran library, we just
    # use -l${MPILIBNAME}.  With separate Fortran libraries, we need
    # -l<fortranwrapperlib> -l${MPILIBNAME} -l<fortransuplib>
    # We also handle the profiling library here, which may not be needed
    # for those systems that support weak symbols.
    # If the libraries are separate, the Fortran77 must work with the
    # Fortran 90 files.
    if [ "${MPILIBNAME}" = "${FLIBNAME}" ] ; then
        mpilibs="-l${MPILIBNAME}"
    else
        mpilibs="-l${FLIBNAME} -l${MPILIBNAME} -l${FLIBNAME}fsup"
    fi
    # If the profiling library doesn't exist, or MPICH_NO_PROF environment
    # variable is set, skip the profiling library.
    if [ -n "$MPICH_NO_PROF" -o ! -s "$proflibfullname" ] ; then
        proflib=""
    fi
    # IRIX complains if we include a library twice.  In the case of a
    # library using weak symbols, we don't need the proflib.  Just
    # in case we do, there is an enviroment variable that
    # can be used to override this test.
    if [ "$MPI_WITH_PMPI" = "yes" -a "$MPICH_INCLUDE_PROFLIB" != yes ] ; then
        proflib=""
    fi
    # If proflib is non-empty, then add it
    if [ -n "$proflib" ] ; then
        # We include the last "mpilibs" because the mpilibs contains the
        # ADI routines.  There is a chance that a file in the first mpich.a
        # invokes a pmpi routine that needs an ADIO routine.
        mpilibs="$proflib $mpilibs $proflib $mpilibs"
    fi
    # See the comment in mpicc about UseSharedLib
    # Also, don't use if the shared libraries don't exist yet
    # (because -lmpichfarg.a won't exist yet)
    if [ "$SHAREDKIND" != "ignore" -a $UseSharedLib = "yes" -a \
	-s ${libdir}/lib${FLIBNAME}farg.a ] ; then
	# We also add a library containing MPI_Init and the routines
        # that it uses to call getarg/iarg.  
	flibpath="${F90LIB_PATH_LEADER}${sharedlibdir}" 
        if [ -n "${SHARED_LIB_SEARCH_PATH_LEADER}" ] ; then
	    flibpath="${SHARED_LIB_SEARCH_PATH_LEADER}${sharedlibdir} $flibpath"
	fi
	if [ -n "${SHAREDLIB_LOCALDIR}" ] ; then
	    flibpath="${F90LIB_PATH_LEADER}${SHAREDLIB_LOCALDIR} $flibpath"
 	    if [ -n "${SHARED_LIB_SEARCH_PATH_LEADER}" ] ; then
	        flibpath="${SHARED_LIB_SEARCH_PATH_LEADER}${SHAREDLIB_LOCALDIR} $flibpath"
	    fi
	fi
	mpilibs="-l${FLIBNAME}farg $mpilibs" 
    fi
    $Show $F90LINKER $F90_LDFLAGS $LDFLAGS $BASE_FFLAGS $flibpath ${F90LIB_PATH_LEADER}${F90LIB_PATH} $linkobjs $linkargs $MPILOG $mpilibs $BASE_LIB_LIST $FLIB_LIST
    status=$?
fi
#
# If we added the link, remove it.
if [ $added_link = 1 ] ; then
    $Show rm -f mpif.h
    trap 0
fi
exit $status