mpcc_r Purpose mpcc_r - Invokes a shell script to compile C programs which use MPI. Format mpcc_r [cc_flags]... program.c The mpcc_r shell script compiles C programs while linking in the Partition Manager, the Message Passing Interface (MPI), and (optionally) Low-level Applications Programming Interface (LAPI). Flags Any of the compiler flags normally accepted by the xlc_r or cc_r command can also be used on mpcc_r. For a complete listing of these flag options, refer to the manual page for the compiler cc_r command. Typical options to mpcc_r include: -v causes a "verbose" output listing of the shell script. -g produces an object file with symbol table references. This object file is needed for debugging with the pdbx debugger. -o names the executable. -l (lower-case L) names additional libraries to be searched. Several libraries are automatically included, and are listed below in the CONTEXT section. Note: Not all AIX libraries are thread safe. Verify that your intended use is supported. -I (upper-case i) names directories for additional includes. The directory /usr/lpp/ppe.poe/include or the appropriate subdirectory is included automatically. Command line or makefile hard coding of include paths for PE header files should normally be avoided. Such specifications will take precedence over the directory selected by the script and may result in generating incorrect code. -p enables profiling with the prof command. For more information, see the appendix on profiling Programs in IBM Parallel Environment for AIX: Operation and Use, Volume 2. -pg enables profiling with the xprofiler and gprof commands. For more information, see the xprofiler information in AIX 5L(TM) Version 5.2 Performance Tools Guide and Reference or AIX 5L Version 5.3 Performance Tools Guide and Reference and the appendix on profiling programs in IBM Parallel Environment for AIX: Operation and Use, Volume 2. -q64 enables compiling of 64-bit applications. Usage The mpcc_r shell script invokes the xlc_r command. In addition, the Partition Manager and data communication interfaces are automatically linked in. The script creates an executable that dynamically binds with the communication subsystem libraries. Flags are passed by mpcc_r to the xlc_r command, so any of the xlc_r options can be used on the mpcc_r shell script. The communication subsystem library implementation is dynamically linked when you invoke the executable using the poe command. The value specified by the MP_EUILIB environment variable or the -euilib flag will then determine which communication subsystem library implementation is dynamically linked. System Environment MP_BYTECOUNT For users who are collecting byte count data (the number of bytes sent and received) using the Performance Collection Tool, this variable specifies which PE Benchmarker profiling library should be linked to the application. Note that the Performance Collection Tool (the ppe.perf file set) must first be installed before you can compile a program with MP_BYTECOUNT. Also, you must set MP_BYTECOUNT before invoking this compiler script. The valid values are mpi to profile MPI communications, lapi to profile LAPI communications, or both to profile both MPI and LAPI communications. MP_PREFIX Sets an alternate path to the scripts library. If not set or NULL, the standard path /usr/lpp/ppe.poe is used. If this environment variable is set, then all libraries are prefixed by $MP_PREFIX/ppe.poe. MP_UTE Setting this variable to yes causes the UTE library to be added to the link step, allowing the user to collect data from the application using PE Benchmarker. Note that the Performance Collection Tool (the ppe.perf file set) must first be installed before compiling a program with MP_UTE. OBJECT_MODE Setting this variable to 64 causes the 64-bit libraries to be linked to the executable, as if the -q64 option had been set. If set to anything other than 64 or if not set, it will not affect how the executables are built. Examples To compile a C program, enter: mpcc_r program.c -o program Context When you compile a program using mpcc_r, the following libraries are automatically selected: /usr/lpp/ppe.poe/lib/libmpi_r.a (Message Passing Interface, collective communication routines) /usr/lpp/ppe.poe/lib/libppe_r.a (PE common routines) The following library is selected if it exists as a symbolic link to /opt/rsct/lapi/lib/liblapi_r.a: /usr/lib/liblapi_r.a When you specify a value with the MP_BYTECOUNT environment variable, the corresponding library is included, as follows: * If you specify MP_BYTECOUNT = mpi, the /usr/lpp/ppe.perf/lib/libmpicount_r.a library is included. * If you specify MP_BYTECOUNT = lapi, the /usr/lpp/ppe.perf/lib/liblapicount_r.a library is included. * If you specify MP_BYTECOUNT = both, the /usr/lpp/ppe.perf/lib/libmpicount_r.a and /usr/lpp/ppe.perf/lib/liblapicount_r.a libraries are both included. When you specify MP_UTE = yes, the /usr/lpp/ppe.perf/lib/libute_r.a library is included. Commands: mpCC_r(1), cc(1), pdbx(1)