1mpif77(1) LAM TOOLS mpif77(1)
2
3
4
6 mpif77 - Compile LAM FORTRAN programs.
7
9 mpif77 [-showme|-showme:compile|-showme:link] ...
10
12 -showme
13 Does not invoke the underlying FORTRAN compiler. Instead, it
14 shows the full command line that would be executed to compile
15 the FORTRAN program.
16
17 -showme:compile
18 Does not invoke the underlying FORTRAN compiler. Instead, it
19 shows the compiler flags that would be supplied to the FORTRAN
20 compiler.
21
22 -showme:link
23 Does not invoke the underlying FORTRAN compiler. Instead, it
24 shows the linker flags that would be supplied to the FORTRAN
25 compiler.
26
27 See f77(1) (or whatever your underlying FORTRAN compiler is) for all
28 other options.
29
31 mpif77 is a convenience wrapper for the local native FORTRAN compiler.
32 Translation of a LAM program requires the linkage of the LAM essential
33 services libraries which may not reside in one of the standard search
34 directories of ld(1). mpif77 passes its arguments along to the local
35 native FORTRAN compiler along with the -L and -l options required by
36 LAM/MPI programs. This includes all necessary options for ROMIO and/or
37 C++ bindings support (if ROMIO/C++ support was included when LAM was
38 compiled).
39
40 The LAM Team strongly encourages using mpif77 instead of attempting to
41 link to the LAM libraries manually. This allows the specific implemen‐
42 tation of LAM to change without forcing changes to linker directives in
43 users' Makefiles (the specific set of underlying LAM libraries has
44 already changed multiple times, and will likely change again in future
45 versions).
46
47 Indeed, since mpif77 is a very thin wrapper on top of an underlying
48 compiler, there are very, very few compelling reasons not to use
49 mpif77. When it is not possible to use mpif77, the -showme:compile and
50 -showme:link arguments should be used instead. For example:
51
52 shell$ f77 -c file1.f `mpif77 -showme:compile`
53
54 shell$ f77 -c file2.f `mpif77 -showme:compile`
55
56 shell$ f77 file1.o file2.o `mpif77 -showme:link` -o my_mpi_program
57
59 By default, mpif77 uses the FORTRAN compiler that was selected when LAM
60 was configured (with the --with-fc flag to ./configure) as the local
61 native FORTRAN compiler, but this can be overridden by the LAMMPIF77
62 environment variable (an older name for this environment variable is
63 LAMHF77 -- this also still works, but its use is deprecated).
64
65 If the environment variable LAMHOME is set, mpif77 will use its value
66 as the location of the LAM installation directory instead of the value
67 that was compiled into mpif77. This means that mpif77 will use the
68 value of LAMHOME as the base to create the -I and -L arguments that are
69 passed to the lower-level compiler, not the installation directory that
70 was supplied when mpif77 was created. This is almost always a Bad
71 Idea.
72
73 The use of LAMHOME is discouraged except for some rare configuration
74 cases in oddly networked sites (in which case your system administrator
75 should probably set this up), and for advanced users with multiple
76 LAM/MPI installations who really know what they are doing; if the
77 LAMHOME environment variable is unintentionally left set, it can lead
78 to tremendous user confusion. For example, if LAMHOME points to LAM
79 installation A, but the user's PATH points to LAM installation B, then
80 even though B's mpif77 will be used, the user program will be compiled
81 and linked against LAM installation A.
82
83 The LAMHOME environment variable is mainly only left in place for back‐
84 wards compatibility; it is not required for normal functioning of
85 LAM/MPI. The LAM Team discourages the use of the LAMHOME environment
86 variable, and instead advocates simply setting the PATH properly to
87 switch between multiple LAM/MPI implementations.
88
90 Previous versions of LAM encouraged the use of hf77 to compile LAM
91 and/or MPI Fortran applications. In very old versions of LAM, hf77 did
92 not automatically add -lmpi to the command line. hf77 was eventually
93 deprecated and replaced with mpif77. The executable hf77 is now simply
94 a symbolic link to mpif77 just in case there's anyone out there that
95 still uses that name. It should be harmless to pass in the additional
96 -lmpi; mpif77 should silently do the Right Thing (only link in the MPI
97 library once).
98
100 f77(1), ld(1), lam-helpfile(5), mpicc(1)
101
102
103
104LAM 7.1.2 March, 2006 mpif77(1)