1mpicc(1)                           LAM TOOLS                          mpicc(1)
2
3
4

NAME

6       mpicc, mpiCC / mpic++ - Compile LAM/MPI C/C++ programs.
7

SYNTAX

9       mpicc [-showme|-showme:compile|-showme:link] ...
10
11       mpiCC [-showme|-showme:compile|-showme:link] ...
12
13       mpic++ [-showme|-showme:compile|-showme:link] ...
14

OPTIONS

16       -showme
17              Does  not  invoke  the  underlying  C/C++ compiler.  Instead, it
18              shows the command line that would be  executed  to  compile  the
19              C/C++ program.
20
21       -showme:compile
22              Does  not  invoke  the  underlying  C/C++ compiler.  Instead, it
23              shows the compiler flags that would be  supplied  to  the  C/C++
24              compiler.
25
26       -showme:link
27              Does  not  invoke  the  underlying  C/C++ compiler.  Instead, it
28              shows the linker flags that would be supplied to the C/C++  com‐
29              piler.
30
31       See  cc(1)  and CC(1) (or whatever your underlying C/C++ compilers are)
32       for all other options.
33

DESCRIPTION

35       mpicc and mpiCC (mpic++ is a synonym for mpiCC provided  for  filenames
36       that  do not support case-sensitive filenames) are convenience wrappers
37       for the local native C and C++ compilers.  Translation of a LAM program
38       requires the linkage of the LAM specific libraries which may not reside
39       in one of the standard search directories  of  ld(1).   It  also  often
40       requires  the inclusion of header files what may also not be found in a
41       standard location.  mpicc passes its arguments to the  local  native  C
42       compiler along with the -I, -L and -l options required by LAM programs.
43       This includes all necessary options for ROMIO and/or C++ bindings  sup‐
44       port (if ROMIO/C++ support was included when LAM was compiled).
45
46       mpiCC  (and  therefore  mpic++)  is similar, but invokes the native C++
47       compiler instead.
48
49       The LAM Team strongly encourages  using  mpicc  and  mpiCC  instead  of
50       attempting to link to the LAM libraries manually.  This allows the spe‐
51       cific implementation of LAM to change without forcing changes to linker
52       directives  in  users'  Makefiles  (the  specific set of underlying LAM
53       libraries has already changed multiple times, and  will  likely  change
54       again in future versions).
55
56       Indeed,  since mpicc/mpiCC are very thin wrappers on top of an underly‐
57       ing compiler, there are very, very few compelling reasons  not  to  use
58       mpicc/mpiCC.    When  it  is  not  possible  to  use  mpicc/mpiCC,  the
59       -showme:compile and -showme:link arguments should be used instead.  For
60       example:
61
62       shell$ cc -c file1.c `mpicc -showme:compile`
63
64       shell$ cc -c file2.c `mpicc -showme:compile`
65
66       shell$ cc file1.o file2.o `mpicc -showme:link` -o my_mpi_program
67

ENVIRONMENT VARIABLES

69       By  default,  mpicc  uses the C compiler that was selected when LAM was
70       configured (with the --with-cc flag to ./configure, or by  setting  the
71       environment  variable  CC  before ./configure was invoked) as the local
72       native C compiler, but this can be overridden by the LAMMPICC  environ‐
73       ment variable (an older name for this environment variable is LAMHCC --
74       this also still works, but its use is deprecated).
75
76       Likewise, mpiCC uses the C++ compiler that was selected  when  LAM  was
77       configured  (with the --with-cpp flag to ./configure, or by setting the
78       environment variable CXX before invoking ./configure) by  default,  but
79       this  can be overridden by the LAMMPICXX environment variable (an older
80       name for this environment variable is LAMHCP -- this also still  works,
81       but its use is deprecated).
82
83       If  the  environment  variable LAMHOME is set, mpicc and mpiCC will use
84       its value as the location of the LAM installation directory instead  of
85       the  value  that  was  compiled  into  mpicc/mpiCC.   This  means  that
86       mpicc/mpiCC will use the value of LAMHOME as the base to create the  -I
87       and  -L  arguments that are passed to the lower-level compiler, not the
88       installation directory that was supplied when mpicc/mpiCC were created.
89       This is almost always a Bad Idea.
90
91       The  use  of  LAMHOME is discouraged except for some rare configuration
92       cases in oddly networked sites (in which case your system administrator
93       should  probably  set  this  up),  and for advanced users with multiple
94       LAM/MPI installations who really know  what  they  are  doing;  if  the
95       LAMHOME  environment  variable is unintentionally left set, it can lead
96       to tremendous user confusion.  For example, if LAMHOME  points  to  LAM
97       installation  A, but the user's PATH points to LAM installation B, then
98       even though B's mpicc will be used, the user program will  be  compiled
99       and linked against LAM installation A.
100
101       The LAMHOME environment variable is mainly only left in place for back‐
102       wards compatibility; it is  not  required  for  normal  functioning  of
103       LAM/MPI.   The  LAM Team discourages the use of the LAMHOME environment
104       variable, and instead advocates simply setting  the  PATH  properly  to
105       switch between multiple LAM/MPI implementations.
106

NOTES

108       Previous  versions  of LAM encouraged the use of hcc and hcp to compile
109       LAM and/or MPI C and C++ applications, respectively.  In very old  ver‐
110       sions  of  LAM, hcc and hcp did not automatically add -lmpi to the com‐
111       mand line.  hcc and hcp were eventually deprecated  and  replaced  with
112       mpicc  and mpiCC (or mpic++ on case-insensitive filesystems).  The exe‐
113       cutables hcc and hcp are now simply symbolic links to mpicc and mpic++,
114       respectively,  just  in  case  there's anyone out there that still uses
115       those names.  It should be harmless to pass in  the  additional  -lmpi;
116       mpicc  and  mpic++ should silently do the Right Thing (only link in the
117       MPI library once).
118

SEE ALSO

120       cc(1), CC(1), ld(1), lam-helpfile(5), mpif77(1)
121
122
123
124LAM 7.1.2                         March, 2006                         mpicc(1)
Impressum